protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { this.cmdReturn1["Return"].NavigateUrl = this.cmdReturn2["Return"].NavigateUrl = WebUtil.Param("return"); this.hidReturnUrl.Value = WebUtil.Param("return"); this.drpPeriod.Items.Clear(); this.txtMbrID.Text = WebUtil.Param("mnum"); this.txtMbrName.Text = WebUtil.Param("mname"); using (ISession session = new Session()) { IList <INVPeriod> periods = INVPeriod.ClosedPeriods(session); foreach (INVPeriod p in periods) { this.drpPeriod.Items.Add(new ListItem(p.PeriodCode, p.PeriodID.ToString())); } this.drpPeriod.SelectedValue = WebUtil.Param("pd"); this.QueryAndBindData(session, 1, this.magicPagerMain.PageSize, true); } } else { this.frameDownload.Attributes["src"] = "about:blank;"; } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { this.txtDateFrom.Text = DateTime.Now.AddDays(-1).ToString("yyyy-MM-dd"); this.txtDateTo.Text = DateTime.Now.ToString("yyyy-MM-dd"); this.drpPeriod.Items.Clear(); this.drpPeriod.Items.Add(new ListItem(" ", "0")); using (ISession session = new Session()) { IList <INVPeriod> periods = INVPeriod.ClosedPeriods(session); foreach (INVPeriod p in periods) { this.drpPeriod.Items.Add(new ListItem(p.PeriodCode, p.PeriodID.ToString())); } if (this.drpPeriod.Items.Count > 1) { this.drpPeriod.SelectedIndex = 1; } this.RestoreLastQuery(session); } } else { this.frameDownload.Attributes["src"] = "about:blank;"; } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { this.drpPeriod.Items.Clear(); this.drpItemCat.Items.Clear(); this.drpItemCat.Items.Add(new ListItem(" ", "0")); using (ISession session = new Session()) { IList <INVPeriod> periods = INVPeriod.ClosedPeriods(session); foreach (INVPeriod p in periods) { this.drpPeriod.Items.Add(new ListItem(p.PeriodCode, p.PeriodID.ToString())); } IList <ItemCategory> cats = session.CreateEntityQuery <ItemCategory>() .List <ItemCategory>(); foreach (ItemCategory c in cats) { this.drpItemCat.Items.Add(new ListItem(c.CatName, c.CategoryID.ToString())); } if (WebUtil.Param("mode").Trim().ToLower() == "fix") { this.cmdReturn1.Visible = true; this.cmdReturn2.Visible = true; this.cmdReturn1["Return"].NavigateUrl = "StockBalanceSum.aspx?pd=" + WebUtil.Param("pd"); this.cmdReturn2["Return"].NavigateUrl = "StockBalanceSum.aspx?pd=" + WebUtil.Param("pd"); this.drpItemCat.SelectedValue = WebUtil.Param("cat"); this.drpPeriod.SelectedValue = WebUtil.Param("pd"); } else { this.cmdReturn1.Visible = false; this.cmdReturn2.Visible = false; } this.QueryAndBindData(session, 1, this.magicPagerMain.PageSize, true); } } else { this.frameDownload.Attributes["src"] = "about:blank;"; } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { this.drpPeriod.Items.Clear(); using (ISession session = new Session()) { IList <INVPeriod> periods = INVPeriod.ClosedPeriods(session); foreach (INVPeriod p in periods) { this.drpPeriod.Items.Add(new ListItem(p.PeriodCode, p.PeriodID.ToString())); } this.QueryAndBindData(session); } } else { this.frameDownload.Attributes["src"] = "about:blank;"; } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { this.cmdReturn1.Visible = false; this.cmdReturn2.Visible = false; this.txtDateFrom.Text = DateTime.Now.AddDays(-1).ToString("yyyy-MM-dd"); this.txtDateTo.Text = DateTime.Now.ToString("yyyy-MM-dd"); this.drpPeriod.Items.Clear(); this.drpPeriod.Items.Add(new ListItem(" ", "0")); this.drpFlush.Items.Clear(); this.drpFlush.Items.Add(new ListItem(" ", "0")); this.drpPayment.Items.Clear(); this.drpPayment.Items.Add(new ListItem(" ", "0")); using (ISession session = new Session()) { IList <INVPeriod> periods = INVPeriod.ClosedPeriods(session); foreach (INVPeriod p in periods) { this.drpPeriod.Items.Add(new ListItem(p.PeriodCode, p.PeriodID.ToString())); } if (this.drpPeriod.Items.Count > 1) { this.drpPeriod.SelectedIndex = 1; } IList <FlushType> flush = FlushType.EffectiveList(session); foreach (FlushType f in flush) { this.drpFlush.Items.Add(new ListItem(f.Name, f.ID.ToString())); } //直接sql取了 IList <PaymentMethod> payment = session.CreateObjectQuery(@" Select * From s_payment_METHOD Where Id In( Select Distinct pay_method From mbr_money_history ) order by name") .List <PaymentMethod>(); foreach (PaymentMethod p in payment) { this.drpPayment.Items.Add(new ListItem(p.Name, p.ID.ToString())); } string mode = WebUtil.Param("mode"); if (mode.Trim().ToLower() == "fix") { //从帐户变动汇总导航过来 this.cmdReturn1.Visible = true; this.cmdReturn2.Visible = true; this.cmdReturn1["Return"].NavigateUrl = this.cmdReturn2["Return"].NavigateUrl = WebUtil.Param("return"); this.drpPeriod.SelectedValue = WebUtil.ParamInt("pd", 0).ToString(); this.drpFlush.SelectedValue = WebUtil.ParamInt("flush", 0).ToString(); this.drpPayment.SelectedValue = WebUtil.ParamInt("payment", 0).ToString(); DateTime dt; dt = Cast.DateTime(WebUtil.Param("df"), new DateTime(1900, 1, 1)); if (dt > new DateTime(1900, 1, 1)) { this.txtDateFrom.Text = dt.ToString("yyyy-MM-dd"); } dt = Cast.DateTime(WebUtil.Param("dt"), new DateTime(1900, 1, 1)); if (dt > new DateTime(1900, 1, 1)) { this.txtDateTo.Text = dt.ToString("yyyy-MM-dd"); } this.txtMbrID.Text = WebUtil.Param("mbr"); } this.QueryAndBindData(session, 1, this.magicPagerMain.PageSize, true); } } else { this.frameDownload.Attributes["src"] = "about:blank;"; } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { this.cmdReturn1.Visible = false; this.cmdReturn2.Visible = false; this.txtDateFrom.Text = DateTime.Now.AddDays(-1).ToString("yyyy-MM-dd"); this.txtDateTo.Text = DateTime.Now.ToString("yyyy-MM-dd"); this.drpPeriod.Items.Clear(); this.drpPeriod.Items.Add(new ListItem(" ", "0")); this.drpLogis.Items.Clear(); this.drpLogis.Items.Add(new ListItem(" ", "0")); using (ISession session = new Session()) { IList <INVPeriod> periods = INVPeriod.ClosedPeriods(session); foreach (INVPeriod p in periods) { this.drpPeriod.Items.Add(new ListItem(p.PeriodCode, p.PeriodID.ToString())); } if (this.drpPeriod.Items.Count > 1) { this.drpPeriod.SelectedIndex = 1; } IList <Logistics> logis = session.CreateEntityQuery <Logistics>() .OrderBy("ShortName") .List <Logistics>(); foreach (Logistics lg in logis) { this.drpLogis.Items.Add(new ListItem(lg.ShortName, lg.LogisticCompID.ToString())); } string mode = WebUtil.Param("mode"); if (mode.Trim().ToLower() == "fix") { //从销售款统计导航过来 this.cmdReturn1.Visible = true; this.cmdReturn2.Visible = true; this.cmdReturn1["Return"].NavigateUrl = this.cmdReturn2["Return"].NavigateUrl = WebUtil.Param("return"); this.drpPeriod.SelectedValue = WebUtil.ParamInt("pd", 0).ToString(); int logisId = WebUtil.ParamInt("lg", 0); if (logisId < 0) { logisId = 0; } this.drpLogis.SelectedValue = logisId.ToString(); DateTime dt; dt = Cast.DateTime(WebUtil.Param("df"), new DateTime(1900, 1, 1)); if (dt > new DateTime(1900, 1, 1)) { this.txtDateFrom.Text = dt.ToString("yyyy-MM-dd"); } dt = Cast.DateTime(WebUtil.Param("dt"), new DateTime(1900, 1, 1)); if (dt > new DateTime(1900, 1, 1)) { this.txtDateTo.Text = dt.ToString("yyyy-MM-dd"); } } this.RestoreLastQuery(session); } } else { this.frameDownload.Attributes["src"] = "about:blank;"; } }