private void GetList() { Database_Output_SaleShop_ArticleCate_Result c = (Database_Output_SaleShop_ArticleCate_Result)Page.LoadControl("SaleShop_ArticleCate_Result.ascx"); DO_SaleShop_ArticleCate.UO_SaleShop_ArticleCate l = new DO_SaleShop_ArticleCate.UO_SaleShop_ArticleCate(); GetTogether.Web.WebHelper.SetValues <DO_SaleShop_ArticleCate.UO_SaleShop_ArticleCate>(l, "SaleShop_ArticleCate_"); if (string.IsNullOrEmpty(Sort)) { Sort = DO_SaleShop_ArticleCate.Columns.Id.ToString(); } PagingResult <DO_SaleShop_ArticleCate.UO_SaleShop_ArticleCate, DO_SaleShop_ArticleCate.UOList_SaleShop_ArticleCate> resultPaging = BO_SaleShop_ArticleCate.GetPagingList(l, PageIndex, PageSize, Sort, IsAsc); c.JsFunction = "SaleShop_ArticleCate_Search"; c.SetData <DO_SaleShop_ArticleCate.UO_SaleShop_ArticleCate, DO_SaleShop_ArticleCate.UOList_SaleShop_ArticleCate>(resultPaging.Result); c.Total = resultPaging.Total; c.Sort = Sort; c.PageIndex = PageIndex; c.PageSize = PageSize; c.IsAsc = IsAsc; this.Controls.Add(c); }
protected void Page_Load(object sender, EventArgs e) { Int64 id = 0; if (!string.IsNullOrEmpty(Request["id"])) { id = Convert.ToInt64(Request["id"]); } if (id > 0) { UO = BO_SaleShop_ArticleCate.GetObjectById(id); } if (UO == null) { UO = new DO_SaleShop_ArticleCate.UO_SaleShop_ArticleCate(); } if (Request.Form.Keys.Count > 0) { GetTogether.Web.WebHelper.SetValues <DO_SaleShop_ArticleCate.UO_SaleShop_ArticleCate>(UO, "SaleShop_ArticleCate_"); if (id > 0) { //Pending UO["UpdateOn", "yyyy-MM-dd"] = DateTime.Now.ToString("yyyy-MM-dd"); UO["UpdateBy"] = string.Concat("WS-", Request.UserHostAddress); UO.Update(BO_SaleShop_ArticleCate.GetConditionsById(id)); } else { //Pending UO["CreateOn", "yyyy-MM-dd"] = DateTime.Now.ToString("yyyy-MM-dd"); UO["CreateBy"] = string.Concat("WS-", Request.UserHostAddress); UO.Insert(); } Response.Redirect("SaleShop_ArticleCate.aspx"); } }
///<summary> ///Update object by primary key string(with transation). ///</summary> public static bool UpdateObjectByPrimaryKeyString(DO_SaleShop_ArticleCate.UO_SaleShop_ArticleCate obj, string primaryKeyString, IDbConnection connection, IDbTransaction transaction) { return(obj.Update(connection, transaction, GetConditionsByPrimaryKeyString(primaryKeyString)) > 0); }
///<summary> ///Update object by primary key string. ///</summary> public static bool UpdateObjectByPrimaryKeyString(DO_SaleShop_ArticleCate.UO_SaleShop_ArticleCate obj, string primaryKeyString) { return(obj.Update(GetConditionsByPrimaryKeyString(primaryKeyString)) > 0); }
///<summary> ///Update object by primary key(with transation). ///</summary> public static bool UpdateObject(DO_SaleShop_ArticleCate.UO_SaleShop_ArticleCate obj, System.Int64 Id, IDbConnection connection, IDbTransaction transaction) { return(obj.Update(connection, transaction, GetConditionsByPrimaryKey(Id)) > 0); }
///<summary> ///Update object by primary key. ///</summary> public static bool UpdateObject(DO_SaleShop_ArticleCate.UO_SaleShop_ArticleCate obj, System.Int64 Id) { return(obj.Update(GetConditionsByPrimaryKey(Id)) > 0); }
///<summary> ///Get paging list. ///</summary> public static PagingResult <DO_SaleShop_ArticleCate.UO_SaleShop_ArticleCate, DO_SaleShop_ArticleCate.UOList_SaleShop_ArticleCate> GetPagingList(DO_SaleShop_ArticleCate.UO_SaleShop_ArticleCate parameterObj, int pageNumber, int pageSize, string sortBy, bool isAsc) { return(parameterObj.GetPagingList(GetConditionsByObject(parameterObj, true, TokenTypes.Like, null), pageNumber, pageSize, sortBy, isAsc)); }
///<summary> ///Get paging list. ///</summary> public static PagingResult <DO_SaleShop_ArticleCate.UO_SaleShop_ArticleCate, DO_SaleShop_ArticleCate.UOList_SaleShop_ArticleCate> GetPagingList(DO_SaleShop_ArticleCate.UO_SaleShop_ArticleCate parameterObj, int pageNumber, int pageSize, string sortBy, bool isAsc, bool isAnd, TokenTypes tokenTypes, Dictionary <DO_SaleShop_ArticleCate.Columns, TokenTypes> extTokens) { return(parameterObj.GetPagingList(GetConditionsByObject(parameterObj, isAnd, tokenTypes, extTokens), pageNumber, pageSize, sortBy, isAsc)); }
///<summary> ///Get list by object. ///</summary> public static DO_SaleShop_ArticleCate.UOList_SaleShop_ArticleCate GetList(DO_SaleShop_ArticleCate.UO_SaleShop_ArticleCate parameterObj) { return(GetList(parameterObj, true, TokenTypes.Equal, null)); }
///<summary> ///Get list by object. ///</summary> public static DO_SaleShop_ArticleCate.UOList_SaleShop_ArticleCate GetList(DO_SaleShop_ArticleCate.UO_SaleShop_ArticleCate parameterObj, bool isAnd, TokenTypes tokenTypes, Dictionary <DO_SaleShop_ArticleCate.Columns, TokenTypes> extTokens) { return(parameterObj.GetList(GetConditionsByObject(parameterObj, isAnd, tokenTypes, extTokens))); }
///<summary> ///Get records count. ///</summary> public static int GetRecordsCount(DO_SaleShop_ArticleCate.UO_SaleShop_ArticleCate parameterObj, bool isAnd, TokenTypes tokenTypes, Dictionary <DO_SaleShop_ArticleCate.Columns, TokenTypes> extTokens) { DO_SaleShop_ArticleCate da = new DO_SaleShop_ArticleCate(); return(da.GetRecordsCount(GetConditionsByObject(parameterObj, isAnd, tokenTypes, extTokens))); }
///<summary> ///Get records count. ///</summary> public static int GetRecordsCount(DO_SaleShop_ArticleCate.UO_SaleShop_ArticleCate parameterObj) { return(GetRecordsCount(parameterObj, true, TokenTypes.Equal, null)); }
///<summary> ///Get conditions by object with Multi-TokenType. ///</summary> public static ParameterCollection GetConditionsByObject(DO_SaleShop_ArticleCate.UO_SaleShop_ArticleCate parameterObj, bool isAnd, TokenTypes tokenTypes, Dictionary <DO_SaleShop_ArticleCate.Columns, TokenTypes> extTokens) { ParameterCollection objectConditions = new ParameterCollection(); TokenTypes tt = tokenTypes; ParameterType pt = isAnd ? ParameterType.And : ParameterType.Or; if (parameterObj.Id != 0 || (extTokens != null && extTokens.ContainsKey(DO_SaleShop_ArticleCate.Columns.Id))) { objectConditions.AddCondition(pt, GetColumnTokenType(tt, DO_SaleShop_ArticleCate.Columns.Id, extTokens), DO_SaleShop_ArticleCate.Columns.Id, parameterObj.Id); } if (parameterObj.Level != 0 || (extTokens != null && extTokens.ContainsKey(DO_SaleShop_ArticleCate.Columns.Level))) { objectConditions.AddCondition(pt, GetColumnTokenType(tt, DO_SaleShop_ArticleCate.Columns.Level, extTokens), DO_SaleShop_ArticleCate.Columns.Level, parameterObj.Level); } if (parameterObj.ParentId != 0 || (extTokens != null && extTokens.ContainsKey(DO_SaleShop_ArticleCate.Columns.ParentId))) { objectConditions.AddCondition(pt, GetColumnTokenType(tt, DO_SaleShop_ArticleCate.Columns.ParentId, extTokens), DO_SaleShop_ArticleCate.Columns.ParentId, parameterObj.ParentId); } if (!string.IsNullOrEmpty(parameterObj.Name)) { objectConditions.AddCondition(pt, GetColumnTokenType(tt, DO_SaleShop_ArticleCate.Columns.Name, extTokens), DO_SaleShop_ArticleCate.Columns.Name, parameterObj.Name); } if (parameterObj.CateType != 0 || (extTokens != null && extTokens.ContainsKey(DO_SaleShop_ArticleCate.Columns.CateType))) { objectConditions.AddCondition(pt, GetColumnTokenType(tt, DO_SaleShop_ArticleCate.Columns.CateType, extTokens), DO_SaleShop_ArticleCate.Columns.CateType, parameterObj.CateType); } if (parameterObj.ShopId != 0 || (extTokens != null && extTokens.ContainsKey(DO_SaleShop_ArticleCate.Columns.ShopId))) { objectConditions.AddCondition(pt, GetColumnTokenType(tt, DO_SaleShop_ArticleCate.Columns.ShopId, extTokens), DO_SaleShop_ArticleCate.Columns.ShopId, parameterObj.ShopId); } if (!string.IsNullOrEmpty(parameterObj.UrlAlias)) { objectConditions.AddCondition(pt, GetColumnTokenType(tt, DO_SaleShop_ArticleCate.Columns.UrlAlias, extTokens), DO_SaleShop_ArticleCate.Columns.UrlAlias, parameterObj.UrlAlias); } if (parameterObj.AddTime != DateTime.MinValue) { objectConditions.AddCondition(pt, GetColumnTokenType(tt, DO_SaleShop_ArticleCate.Columns.AddTime, extTokens), DO_SaleShop_ArticleCate.Columns.AddTime, parameterObj.AddTime); } if (!string.IsNullOrEmpty(parameterObj.Adder)) { objectConditions.AddCondition(pt, GetColumnTokenType(tt, DO_SaleShop_ArticleCate.Columns.Adder, extTokens), DO_SaleShop_ArticleCate.Columns.Adder, parameterObj.Adder); } if (!string.IsNullOrEmpty(parameterObj.SeoKeywords)) { objectConditions.AddCondition(pt, GetColumnTokenType(tt, DO_SaleShop_ArticleCate.Columns.SeoKeywords, extTokens), DO_SaleShop_ArticleCate.Columns.SeoKeywords, parameterObj.SeoKeywords); } if (!string.IsNullOrEmpty(parameterObj.SeoDescription)) { objectConditions.AddCondition(pt, GetColumnTokenType(tt, DO_SaleShop_ArticleCate.Columns.SeoDescription, extTokens), DO_SaleShop_ArticleCate.Columns.SeoDescription, parameterObj.SeoDescription); } if (parameterObj.OrderNum != 0 || (extTokens != null && extTokens.ContainsKey(DO_SaleShop_ArticleCate.Columns.OrderNum))) { objectConditions.AddCondition(pt, GetColumnTokenType(tt, DO_SaleShop_ArticleCate.Columns.OrderNum, extTokens), DO_SaleShop_ArticleCate.Columns.OrderNum, parameterObj.OrderNum); } if (!string.IsNullOrEmpty(parameterObj.Editor)) { objectConditions.AddCondition(pt, GetColumnTokenType(tt, DO_SaleShop_ArticleCate.Columns.Editor, extTokens), DO_SaleShop_ArticleCate.Columns.Editor, parameterObj.Editor); } if (parameterObj.EditTime != DateTime.MinValue) { objectConditions.AddCondition(pt, GetColumnTokenType(tt, DO_SaleShop_ArticleCate.Columns.EditTime, extTokens), DO_SaleShop_ArticleCate.Columns.EditTime, parameterObj.EditTime); } return(objectConditions); }