protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e) { string goodNo = this.GoodNo.Text; string startTime = this.StartTime.Text; string endTime = this.EndTime.Text; string sellNo = this.SellNo.Text; this.GridView1.DataSource = SellBackLogic.QuerySellBackInfo(goodNo, sellNo, startTime, endTime); this.GridView1.PageIndex = e.NewPageIndex; this.GridView1.DataBind(); this.TotalPrice.Text = SellBackLogic.QuerySellBackTotalPrice(goodNo, sellNo, startTime, endTime).ToString();; }
protected void Btn_Query_Click(object sender, EventArgs e) { float buyTotalPrice = BuyInfoLogic.QueryBuyInfoTotalPrice("", "", 0, this.StartTime.Text, this.EndTime.Text); float buyBackTotalPrice = BuyBackInfoLogic.QueryBuyBackTotalMoney("", "", 0, this.StartTime.Text, this.EndTime.Text); float sellTotalPrice = SellLogic.QuerySellTotalPrice("", "", this.StartTime.Text, this.EndTime.Text); float sellBackTotalPrice = SellBackLogic.QuerySellBackTotalPrice("", "", this.StartTime.Text, this.EndTime.Text); float profits = sellTotalPrice + buyBackTotalPrice - buyTotalPrice - sellBackTotalPrice; this.BuyTotalPrice.Text = buyTotalPrice.ToString(); this.BuyBackTotalPrice.Text = buyBackTotalPrice.ToString(); this.SellTotalPrice.Text = sellTotalPrice.ToString(); this.SellBackTotalPrice.Text = sellBackTotalPrice.ToString(); this.Profits.Text = sellTotalPrice.ToString() + " + " + buyBackTotalPrice.ToString() + " - " + buyTotalPrice.ToString() + " - " + sellBackTotalPrice.ToString() + " = " + profits.ToString(); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { /*判断管理员是否已经登陆了系统*/ if (Session["adminFlag"] == null) { Response.Write("<script>top.location.href='../login.aspx';</script>"); return; } this.GridView1.DataSource = SellBackLogic.QuerySellBackInfo("", "", "", ""); this.GridView1.DataBind(); this.TotalPrice.Text = SellBackLogic.QuerySellBackTotalPrice("", "", "", "").ToString(); } }
protected void Btn_Add_Click(object sender, EventArgs e) { SellBackInfoModel sellBackInfoModel = new SellBackInfoModel(); sellBackInfoModel.SellNo = this.SellNo.Text; sellBackInfoModel.GoodNo = this.GoodNo.Text; if (this.Price.Text == "" || this.Number.Text == "") { Response.Write("<script>商品价格或数量信息输入不能为空!</script>"); } try { sellBackInfoModel.Price = Convert.ToSingle(this.Price.Text); } catch { Response.Write("<script>alert('请输入正确的价格信息!');</script>"); return; } try { sellBackInfoModel.Number = Int32.Parse(this.Number.Text); } catch { Response.Write("alert('请输入正确的商品数量!');"); } sellBackInfoModel.TotalPrice = sellBackInfoModel.Price * sellBackInfoModel.Number; sellBackInfoModel.SellBackReason = this.SellBackReason.Text; sellBackInfoModel.SellBackTime = DateTime.Now; bool isGood = (Int32.Parse(this.IsGood.SelectedValue) == 1)?true:false; SellBackLogic sellBackLogic = new SellBackLogic(); if (sellBackLogic.SellBackInfoAdd(sellBackInfoModel, isGood)) { Response.Write("<script>alert('商品退货成功!');location.href='SellBackInfoAdd.aspx';</script>"); } else { Response.Write("<script>alert('" + sellBackLogic.ErrMessage + "');</script>"); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { /*判断管理员是否已经登陆了系统*/ if (Session["adminFlag"] == null) { Response.Write("<script>top.location.href='../login.aspx';</script>"); return; } } float buyTotalPrice = BuyInfoLogic.QueryBuyInfoTotalPrice("", "", 0, "", ""); float buyBackTotalPrice = BuyBackInfoLogic.QueryBuyBackTotalMoney("", "", 0, "", ""); float sellTotalPrice = SellLogic.QuerySellTotalPrice("", "", "", ""); float sellBackTotalPrice = SellBackLogic.QuerySellBackTotalPrice("", "", "", ""); float profits = sellTotalPrice + buyBackTotalPrice - buyTotalPrice - sellBackTotalPrice; this.BuyTotalPrice.Text = buyTotalPrice.ToString(); this.BuyBackTotalPrice.Text = buyBackTotalPrice.ToString(); this.SellTotalPrice.Text = sellTotalPrice.ToString(); this.SellBackTotalPrice.Text = sellBackTotalPrice.ToString(); this.Profits.Text = sellTotalPrice.ToString() + " + " + buyBackTotalPrice.ToString() + " - " + buyTotalPrice.ToString() + " - " + sellBackTotalPrice.ToString() + " = " + profits.ToString(); }