-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 4f55318
Showing
1,450 changed files
with
254,993 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,122 @@ | ||
using System; | ||
using System.Data; | ||
using System.Configuration; | ||
using System.Linq; | ||
using System.Web; | ||
using System.Web.Security; | ||
using System.Web.UI; | ||
using System.Web.UI.HtmlControls; | ||
using System.Web.UI.WebControls; | ||
using System.Web.UI.WebControls.WebParts; | ||
using System.Xml.Linq; | ||
|
||
using System.Collections.Generic; | ||
|
||
/// <summary> | ||
/// Summary description for Breadcrumb | ||
/// </summary> | ||
namespace Library.Breadcrumb | ||
{ | ||
public class LinkEntity | ||
{ | ||
public string Title { get; set; } | ||
public string Link { get; set; } | ||
public string Alt { get; set; } | ||
public bool Last { get; set; } | ||
} | ||
|
||
public class Breadcrumb | ||
{ | ||
MasterPage _masterpage; | ||
Page _page = new Page(); | ||
Control _control; | ||
int _levelMasterPage = 2; | ||
string _controlId = "ucMyBreadcrumb"; | ||
|
||
List<LinkEntity> _link = new List<LinkEntity>(); | ||
|
||
public Breadcrumb(Page page) | ||
{ | ||
_page = page; | ||
} | ||
|
||
/// <summary> | ||
/// Init Breadcrumb | ||
/// </summary> | ||
/// <param name="levelMasterPage">Cấp của master page chính</param> | ||
/// <param name="controlId">Tên của control Breadcrumb tren main master page</param> | ||
public void Init(int levelMasterPage, string controlId) | ||
{ | ||
_levelMasterPage = levelMasterPage; | ||
_controlId = controlId; | ||
_masterpage = _page.Master; | ||
for (int i = 1; i <= levelMasterPage - 1; i++) | ||
_masterpage = _masterpage.Master as MasterPage; | ||
_control = _masterpage.FindControl(controlId); | ||
} | ||
|
||
/// <summary> | ||
/// Init Breadcrumb | ||
/// </summary> | ||
/// <param name="levelMasterPage">Cấp của master page chính</param> | ||
public void Init(int levelMasterPage) | ||
{ | ||
_levelMasterPage = levelMasterPage; | ||
Init(levelMasterPage, _controlId); | ||
} | ||
|
||
public void Init() | ||
{ | ||
Init(_levelMasterPage, _controlId); | ||
} | ||
|
||
public void Add(string title, string link) | ||
{ | ||
Add(title, link, "", false); | ||
} | ||
|
||
public void Add(string title, string link, string alt) | ||
{ | ||
Add(title, link, alt, false); | ||
} | ||
|
||
public void Add(string title, string link, string alt, bool last) | ||
{ | ||
LinkEntity item = new LinkEntity(); | ||
item.Title = title; | ||
item.Link = link; | ||
item.Alt = alt; | ||
item.Last = last; | ||
_link.Add(item); | ||
} | ||
|
||
public void StartBreadcrumb(string titleHome, string linkHome, string alt) | ||
{ | ||
LinkEntity item = new LinkEntity(); | ||
item.Title = titleHome; | ||
item.Link = linkHome; | ||
item.Alt = alt; | ||
item.Last = false; | ||
_link.Insert(0, item); | ||
//StartBreadcrumb(); | ||
|
||
Repeater rpt = (Repeater)_control.FindControl("rptLink"); | ||
rpt.DataSource = _link; | ||
rpt.DataBind(); | ||
} | ||
|
||
public void StartBreadcrumb() | ||
{ | ||
LinkEntity item = new LinkEntity(); | ||
item.Title = "Trang chủ"; | ||
item.Link = Library.Tools.UrlBuilder.RootUrl; | ||
item.Alt = "Du lịch Việt Nam"; | ||
item.Last = false; | ||
_link.Insert(0, item); | ||
|
||
Repeater rpt = (Repeater)_control.FindControl("rptLink"); | ||
rpt.DataSource = _link; | ||
rpt.DataBind(); | ||
} | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
VbnLibrary/Library/LayerHelper/ShopCake/DataAccessAdapterFactory.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
using System; | ||
using System.Collections; | ||
using System.Configuration; | ||
using System.Data; | ||
using System.Data.SqlClient; | ||
using SD.LLBLGen.Pro.ORMSupportClasses; | ||
|
||
namespace LayerHelper.ShopCake.BLL | ||
{ | ||
|
||
public class DataAccessAdapterFactory | ||
{ | ||
public DataAccessAdapterBase CreateAdapter() | ||
{ | ||
return (new LayerHelper.ShopCake.DAL.DatabaseSpecific.DataAccessAdapter()); | ||
} | ||
} | ||
|
||
} | ||
|
40 changes: 40 additions & 0 deletions
40
VbnLibrary/Library/LayerHelper/ShopCake/Manager/AdvertsGroupManager.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
|
||
/* | ||
'=============================================================================== | ||
' LayerHelper.ShopCake.BL.AdvertsGroupManager | ||
'=============================================================================== | ||
*/ | ||
|
||
using System; | ||
using System.Configuration; | ||
using System.Data; | ||
using System.Data.SqlClient; | ||
using LayerHelper.ShopCake.BLL; | ||
using LayerHelper.ShopCake.DAL; | ||
using LayerHelper.ShopCake.DAL.EntityClasses; | ||
using LayerHelper.ShopCake.DAL.FactoryClasses; | ||
using LayerHelper.ShopCake.DAL.HelperClasses; | ||
using SD.LLBLGen.Pro.ORMSupportClasses; | ||
|
||
namespace LayerHelper.ShopCake.BLL | ||
{ | ||
public class AdvertsGroupManager : AdvertsGroupManagerBase | ||
{ | ||
/// <summary> | ||
/// Purpose: Class constructor. | ||
/// </summary> | ||
public AdvertsGroupManager() | ||
{ | ||
// Nothing for now. | ||
} | ||
|
||
/// <summary> | ||
/// Method to create an instance of AdvertsGroupManager | ||
/// </summary> | ||
/// <returns>An instant of AdvertsGroupManager class</returns> | ||
public static AdvertsGroupManager CreateInstant() | ||
{ | ||
return new AdvertsGroupManager(); | ||
} | ||
} | ||
} |
177 changes: 177 additions & 0 deletions
177
VbnLibrary/Library/LayerHelper/ShopCake/Manager/AdvertsManager.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,177 @@ | ||
|
||
/* | ||
'=============================================================================== | ||
' LayerHelper.ShopCake.BL.AdvertsManager | ||
'=============================================================================== | ||
*/ | ||
|
||
using System; | ||
using System.Configuration; | ||
using System.Data; | ||
using System.Data.SqlClient; | ||
using LayerHelper.ShopCake.BLL; | ||
using LayerHelper.ShopCake.DAL; | ||
using LayerHelper.ShopCake.DAL.EntityClasses; | ||
using LayerHelper.ShopCake.DAL.FactoryClasses; | ||
using LayerHelper.ShopCake.DAL.HelperClasses; | ||
using SD.LLBLGen.Pro.ORMSupportClasses; | ||
|
||
using Library.Tools; | ||
|
||
namespace LayerHelper.ShopCake.BLL | ||
{ | ||
public class AdvertsManager : AdvertsManagerBase | ||
{ | ||
/// <summary> | ||
/// Purpose: Class constructor. | ||
/// </summary> | ||
public AdvertsManager() | ||
{ | ||
// Nothing for now. | ||
} | ||
|
||
/// <summary> | ||
/// Method to create an instance of AdvertsManager | ||
/// </summary> | ||
/// <returns>An instant of AdvertsManager class</returns> | ||
public static AdvertsManager CreateInstant() | ||
{ | ||
return new AdvertsManager(); | ||
} | ||
|
||
public void DeleteAdvertById(Guid AdvertId) | ||
{ | ||
string strSQL = "Advert_DeleteByAdvertId"; | ||
SqlParameter param = new SqlParameter("@AdvertId", AdvertId); | ||
SqlHelper.ExecuteNonQuery(SqlHelper.ConnectionStringShopCake, CommandType.StoredProcedure, strSQL, param); | ||
} | ||
|
||
public DataTable GetAdvertSetting(string PositionId) | ||
{ | ||
string strSQL = "Advert_ShowByPosition"; | ||
SqlParameter param = new SqlParameter("@PositionId", PositionId); | ||
return SqlHelper.ExecuteDataTable(SqlHelper.ConnectionStringShopCake, CommandType.StoredProcedure, strSQL, param); | ||
} | ||
|
||
public DataTable GetAdvertSettingGroup(Guid AdvertPositionId) | ||
{ | ||
string strSQL = "Advert_ShowByGroup"; | ||
SqlParameter param = new SqlParameter("@AdvertPositionId", AdvertPositionId); | ||
return SqlHelper.ExecuteDataTable(SqlHelper.ConnectionStringShopCake, CommandType.StoredProcedure, strSQL, param); | ||
} | ||
|
||
public void UpdateGroup(Guid AdvertId, Guid AdvertPositionId) | ||
{ | ||
string strSQL = "Advert_UpdateGroup"; | ||
SqlParameter[] param = new SqlParameter[2]; | ||
param[0] = new SqlParameter("@AdvertId", AdvertId); | ||
param[1] = new SqlParameter("@AdvertPositionId", AdvertPositionId); | ||
SqlHelper.ExecuteNonQuery(SqlHelper.ConnectionStringShopCake, CommandType.StoredProcedure, strSQL, param); | ||
} | ||
|
||
public DataTable GetAdvertByPositionId(string PositionId, string PositionType) | ||
{ | ||
string strSQL = "Select ad.* " + | ||
"From Adverts ad, AdvertsGroup adg, AdvertsPosition adp, Position p " + | ||
"Where ad.Id=adg.AdvertId and adg.AdvertPositionId=adp.Id and adp.PositionId=p.Id " + | ||
" and adp.IsVisible=1 and adp.NumberOfGroup>0 " + | ||
" and DateDiff(Day,BeginDate,getDate())>=0 and DateDiff(Day,getdate(),EndDate)>=0 " + | ||
" and adp.PositionTypeId='" + PositionType + "' " + | ||
" {0} " + | ||
"Order By p.OrderIndex, adp.OrderIndex, ad.AdvertName "; | ||
|
||
string[] p = PositionId.Split('|'); | ||
string subSQL = ""; | ||
for (int i = 0; i < p.Length; i++) | ||
{ | ||
subSQL += " or adp.PositionId='" + p[i] + "' "; | ||
} | ||
if (!string.IsNullOrEmpty(subSQL)) | ||
subSQL = " and (" + subSQL.Substring(3) + ") "; | ||
|
||
strSQL = string.Format(strSQL, subSQL); | ||
|
||
return SqlHelper.ExecuteDataTable(SqlHelper.ConnectionStringShopCake, CommandType.Text, strSQL, null); | ||
} | ||
|
||
public DataTable GetAdvertGroupByPositionId(string PositionId, string PositionType) | ||
{ | ||
string strSQL = "Select adp.* " + | ||
"From AdvertsPosition adp, Position p " + | ||
"Where adp.PositionId=p.Id " + | ||
" and adp.IsVisible=1 and adp.NumberOfGroup>0 " + | ||
" and adp.PositionTypeId='" + PositionType + "' " + | ||
" {0} " + | ||
"Order By p.OrderIndex, adp.OrderIndex "; | ||
|
||
string[] p = PositionId.Split('|'); | ||
string subSQL = ""; | ||
for (int i = 0; i < p.Length; i++) | ||
{ | ||
subSQL += " or adp.PositionId='" + p[i] + "' "; | ||
} | ||
if (!string.IsNullOrEmpty(subSQL)) | ||
subSQL = " and (" + subSQL.Substring(3) + ") "; | ||
|
||
strSQL = string.Format(strSQL, subSQL); | ||
|
||
return SqlHelper.ExecuteDataTable(SqlHelper.ConnectionStringShopCake, CommandType.Text, strSQL, null); | ||
} | ||
|
||
public DataTable GetAdvert(Guid AdvertPositionId) | ||
{ | ||
string strSQL = "Select ad.* " + | ||
"From Adverts ad, AdvertsGroup adg, AdvertsPosition adp " + | ||
"Where ad.Id=adg.AdvertId and adg.AdvertPositionId=adp.Id " + | ||
" and adp.IsVisible=1 and ad.IsVisible=1 " + | ||
" and DateDiff(Day,BeginDate,getDate())>=0 and DateDiff(Day,getdate(),EndDate)>=0 "+ | ||
" and adp.Id=@AdvertPositionId"; | ||
SqlParameter param = new SqlParameter("@AdvertPositionId", AdvertPositionId); | ||
return SqlHelper.ExecuteDataTable(SqlHelper.ConnectionStringShopCake, CommandType.Text, strSQL, param); | ||
} | ||
|
||
public bool IsDelete(Guid AdvertId) | ||
{ | ||
EntityCollection<AdvertsGroupEntity> items = AdvertsGroupManager.CreateInstant().SelectByAdvertIdLST(AdvertId); | ||
if (items != null && items.Count > 0) | ||
return false; | ||
return true; | ||
} | ||
|
||
public void DeleteAll(Guid AdvertId) | ||
{ | ||
EntityCollection<AdvertsGroupEntity> items = AdvertsGroupManager.CreateInstant().SelectByAdvertIdLST(AdvertId); | ||
if (items != null && items.Count > 0) | ||
{ | ||
for (int i = 0; i < items.Count; i++) | ||
{ | ||
AdvertsPositionManager.CreateInstant().Delete(items[i].AdvertPositionId); | ||
} | ||
} | ||
|
||
AdvertsGroupManager.CreateInstant().DeleteByAdvertId(AdvertId); | ||
AdvertsManager.CreateInstant().Delete(AdvertId); | ||
} | ||
|
||
public DataTable GetAllAdverts() | ||
{ | ||
string strSQL = "prcGetAllAdvert"; | ||
return SqlHelper.ExecuteDataTable(SqlHelper.ConnectionStringShopCake, CommandType.StoredProcedure, strSQL, null); | ||
} | ||
|
||
public AdvertsEntity GetById(Guid Id) | ||
{ | ||
EntityCollection<AdvertsEntity> items = SelectByIdLST(Id); | ||
if (items != null && items.Count > 0) | ||
return items[0]; | ||
return null; | ||
} | ||
|
||
public DataTable GetSetting(Guid AdvertId) | ||
{ | ||
string strSQL = "AdvertSetting"; | ||
SqlParameter param = new SqlParameter("@AdvertId", AdvertId); | ||
return SqlHelper.ExecuteDataTable(SqlHelper.ConnectionStringShopCake, CommandType.StoredProcedure, strSQL, param); | ||
} | ||
} | ||
} |
Oops, something went wrong.