protected void Page_Load(object sender, EventArgs e) { try { if (Session["username"] != null && Session["gs_name"] != null) { string act = Request["act"] == null ? "" : Request["act"].ToString(); if (act.Equals("del")) { del(); } else if (act.Equals("insert")) { insert(); } else if (act.Equals("update")) { update(); } List <qi_chu_info> list = can.ck_sp_select(Session["username"].ToString(), Session["gs_name"].ToString()); int listi = 0; foreach (qi_chu_info qci in list) { if (qci.Cpsl.ToString() == "undefined") { list[listi].Cpsl = "0"; } if (qci.Cpsj.ToString() == "undefined") { list[listi].Cpsj = "0"; } listi++; } List <zl_and_jc_info> jichu = can.select_jczl(Session["username"].ToString(), Session["gs_name"].ToString()); shangpingname.DataSource = jichu; shangpingname.DataBind(); fenlei.DataSource = jichu; fenlei.DataBind(); RepAll.DataSource = list; RepAll.DataBind(); } } catch (Exception ex) { throw ex; } }
protected void Page_Load(object sender, EventArgs e) { try { //if (!IsPostBack) //{ List <ming_xi_info> list = new List <ming_xi_info>(); List <ku_cun> kc = new List <ku_cun>(); List <zl_and_jc_info> jichu = new List <zl_and_jc_info>(); string act = Request["act"] == null ? "" : Request["act"].ToString(); if (act.Equals("update")) { update(); } else if (act.Equals("del")) { del(); } else if (act.Equals("Jiansuo")) { list = selectWhere(); } if (!act.Equals("Jiansuo") && Session["username"] != null && Session["gs_name"] != null) { userid = Session["username"].ToString(); gongsi = Session["gs_name"].ToString(); list = cal.ming_xi_select(Session["username"].ToString(), Session["gs_name"].ToString()).FindAll(fn => fn.Mxtype.Equals("出库")); kc = cal.SelectKucun().FindAll(fn => fn.gs_name.Equals(Session["gs_name"]) && fn.zh_name.Equals(Session["username"])); jichu = cal.select_jczl(Session["username"].ToString(), Session["gs_name"].ToString()); } RepAll.DataSource = list; RepAll.DataBind(); repkucun.DataSource = kc; repkucun.DataBind(); shouhuo.DataSource = jichu.FindAll(fd => !fd.Gong_huo.Equals("无") && !fd.Gong_huo.Equals(string.Empty)); shouhuo.DataBind(); //} } catch (Exception ex) { throw ex; } }