protected void Page_Load(object sender, EventArgs e) { Int32 id = 0; if(!string.IsNullOrEmpty(Request["id"])) id = Convert.ToInt32(Request["id"]); if (id > 0) { UO = BO_Goods_lable.GetObjectById(id); } if (UO == null) UO = new DO_Goods_lable.UO_Goods_lable(); if (Request.Form.Keys.Count > 0) { GetTogether.Web.WebHelper.SetValues<DO_Goods_lable.UO_Goods_lable>(UO, "Goods_lable_"); 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_Goods_lable.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("Goods_lable.aspx"); } }
private void GetList() { Database_Output_Goods_lable_Result c = (Database_Output_Goods_lable_Result)Page.LoadControl("Goods_lable_Result.ascx"); DO_Goods_lable.UO_Goods_lable l = new DO_Goods_lable.UO_Goods_lable(); GetTogether.Web.WebHelper.SetValues <DO_Goods_lable.UO_Goods_lable>(l, "Goods_lable_"); if (string.IsNullOrEmpty(Sort)) { Sort = DO_Goods_lable.Columns.lableid.ToString(); } PagingResult <DO_Goods_lable.UO_Goods_lable, DO_Goods_lable.UOList_Goods_lable> resultPaging = BO_Goods_lable.GetPagingList(l, PageIndex, PageSize, Sort, IsAsc); c.JsFunction = "Goods_lable_Search"; c.SetData <DO_Goods_lable.UO_Goods_lable, DO_Goods_lable.UOList_Goods_lable>(resultPaging.Result); c.Total = resultPaging.Total; c.Sort = Sort; c.PageIndex = PageIndex; c.PageSize = PageSize; c.IsAsc = IsAsc; this.Controls.Add(c); }