protected void Page_Load(object sender, EventArgs e) { AdminPopedom.IsHoldModel("15"); DataSet ds = DbSession.Default.FromProc("Web_pGetDataPager") .AddInputParameter("@PageSize", DbType.Int32, anpPageIndex.PageSize) .AddInputParameter("@CurrentPage", DbType.Int32, PageIndex) .AddInputParameter("@Columns", DbType.String, "*") .AddInputParameter("@TableName", DbType.String, "Web_ClearFasciPropDefine") .AddInputParameter("@Wheres", DbType.String, "") .AddInputParameter("@KeyName", DbType.String, "ID") .AddInputParameter("@OrderBy", DbType.String, "ID") .ToDataSet(); if (ds.Tables.Count > 0 && ds.Tables[1].Rows.Count > 0) { anpPageIndex.RecordCount = (int)ds.Tables[0].Rows[0][0]; anpPageIndex.CurrentPageIndex = PageIndex; ProList.DataSource = ds.Tables[1]; ProList.DataBind(); ProList.Visible = true; NoProList.Visible = false; } else { ProList.Visible = false; NoProList.Visible = true; } }
/// <summary> /// 获取签名前拼接字符串 /// </summary> public static string GetStringSignTemp <T>(T model, string SignKey, bool ParaAsc = true, StringComparison StrCompar = StringComparison.Ordinal, string SplitStr = "&", Func <string, string, string> KeyValueJoin = null, BindingFlags?bindingAttr = null) { StringBuilder stringSignTemp = new StringBuilder(); if (model != null) { List <PropertyInfo> ProList; if (bindingAttr.HasValue) { ProList = model.GetType().GetProperties(bindingAttr.Value).ToList(); } else { ProList = model.GetType().GetProperties().ToList(); } if (ParaAsc) { ProList.Sort((x, y) => string.Compare(x.Name, y.Name, StrCompar)); } else { ProList.Sort((x, y) => - (string.Compare(x.Name, y.Name, StrCompar))); } for (int i = 0; i < ProList.Count; i++) { if (THelper.GetCustomAttribute <NoSignAttribute>(ProList[i]) == null) { object ProIValue = ProList[i].GetValue(model, null); if (ProIValue != null) { if (!string.IsNullOrEmpty(ProIValue.ToString().Trim())) { if (stringSignTemp.Length > 0) { stringSignTemp.Append(SplitStr); } if (KeyValueJoin != null) { stringSignTemp.Append(KeyValueJoin(ProList[i].Name, ProIValue.ToString())); } else { stringSignTemp.Append(ProList[i].Name + "=" + ProIValue.ToString()); } } } } } } if (!string.IsNullOrEmpty(SignKey)) { stringSignTemp.Append(SignKey); } return(stringSignTemp.ToString()); }
protected void Page_Load(object sender, EventArgs e) { AdminPopedom.IsHoldModel("15"); DataSet ds = DbSession.Default.FromProc("Web_pGetDataPager") .AddInputParameter("@PageSize", DbType.Int32, anpPageIndex.PageSize) .AddInputParameter("@CurrentPage", DbType.Int32, PageIndex) .AddInputParameter("@Columns", DbType.String, "*") .AddInputParameter("@TableName", DbType.String, "TPropDefine") .AddInputParameter("@Wheres", DbType.String, " and proptype=0") .AddInputParameter("@KeyName", DbType.String, "PropID") .AddInputParameter("@OrderBy", DbType.String, "PropID desc") .ToDataSet(); if (ds.Tables.Count > 0) { anpPageIndex.RecordCount = (int)ds.Tables[0].Rows[0][0]; anpPageIndex.CurrentPageIndex = PageIndex; if (ds.Tables[1].Rows.Count > 0) { ProList.Visible = true; NoProList.Visible = false; ProList.DataSource = ds.Tables[1]; ProList.DataBind(); } else { NoProList.Visible = false; ProList.Visible = true; } } /* * DataTable sd = new DataTable(); * string para = ""; * string[] sql = new string[2]; * sql[0] = "select ROW_NUMBER() OVER(ORDER BY PropID DESC) AS RowNumber,* from TPropDefine"; * sql[1] = "select Count(*) from TPropDefine"; * string url = "JpPrices.aspx"; * PageLink page_set = new PageLink(url, 20, 10, para, sql); * page_set.paraLinkType = paraLinkShow.middling.ToString(); * sd = page_set.get_table(); * if (sd.Rows.Count > 0) * { * Repeater Viste = (Repeater)Page.FindControl("ProList"); * Viste.DataSource = sd; * Viste.DataBind(); * this.pageList.Text = page_set.pageList(); * } * else * this.NoProList.Visible = true; * sd.Clear();*/ }
private void AfterDone(object sender, RunWorkerCompletedEventArgs e) { ProList.Items.Clear(); foreach (ListViewItem item in Processing.lvitemCollection) { ProList.Items.Add(item); } ProList.Refresh(); ProList.Sorting = SortOrder.Ascending; ProList.Sorting = SortOrder.None; toolStripStatusLabel2.Text = "Loaded"; ProList.Enabled = true; button1.Enabled = true; }
public JsonResult adnpro(string proname, DateTime?fdate, DateTime?sdate, DateTime?tdate, DateTime?declaredate, decimal?totalval, int?kprofk, int?purnamefk, int cby) { ProList pl = new ProList(); pl.ProName = proname; pl.TotalVal = totalval ?? 0; pl.KProFK = kprofk; pl.PurNameFK = purnamefk; pl.FirstAccepteDate = fdate; pl.SecandAccepteDate = sdate; pl.ThirdAceepteDate = tdate; pl.CreateBy = cby; pl.CreateDate = DateTime.Now; pl.IsActive = true; pl.Posted = 1; pl.ProStop = false; db.ProList.Add(pl); db.SaveChanges(); return(Json(new { Success = true, Message = " تم إضافة المشروع بنجاح" }, JsonRequestBehavior.AllowGet)); }
protected void Page_Load(object sender, EventArgs e) { client = new UserServiceClient(); pClient = new ProductServiceClient(); users = client.GetAllUsers(); products = pClient.GetAllProducts(); if (!IsPostBack) { List <ListItem> items = new List <ListItem>(); List <ListItem> prods = new List <ListItem>(); foreach (User u in users) { if (!u.User_Type.Equals("admin")) { ListItem li = new ListItem(); li.Text = u.UserID + " " + u.Name.ToString() + "(" + u.User_Type + ")"; li.Value = u.UserID + " " + u.Name.ToString() + "(" + u.User_Type + ")"; items.Add(li); } } Towner.DataSource = items; Towner.DataBind(); foreach (Product p in products) { ListItem x = new ListItem(); x.Text = p.P_ID + " " + p.P_Name + " " + "Current Quantity=" + " " + p.P_Quantity.ToString(); x.Value = p.P_ID.ToString(); prods.Add(x); } ListItem newProd = new ListItem(); newProd.Text = "New Incoming Product!!!"; newProd.Text = "New Incoming Product!!!"; prods.Add(newProd); ProList.DataSource = prods; ProList.DataBind(); } }