protected void GridView1_SelectedIndexChanged(object sender, EventArgs e) { lblMsg.Text = "Selected id=" + GridView1.SelectedRow.Cells[1].Text; //关键,必须为主键控件赋值 this.dlCHJLH.Text = GridView1.SelectedRow.Cells[1].Text; //填充数据 MyWebForm.Instance.AutoSelectIBForm(this.Controls); //设置下拉框的选项 //得到当前条码号 string sn = this.dtbSN.Text; GoodsManageBIZ biz = new GoodsManageBIZ(); GoodsBaseInfo info = biz.GetGoodsBaseInfo(sn); this.ddlGoodsNames.Text = info.GoodsName; List<GoodsBaseInfoVM> list = biz.GetGoodsBaseInfoWhithGoodsName(info.GoodsName); this.ddlManufacturer.DataTextField = "Manufacturer"; this.ddlManufacturer.DataValueField = "SerialNumber"; this.ddlManufacturer.DataSource = list; this.ddlManufacturer.DataBind(); this.ddlManufacturer.SelectedValue = sn; }
private void bindGrid() { GoodsManageBIZ biz = new GoodsManageBIZ(); this.ProPageToolBar1.AllCount = biz.GetAllGoodsBaseInfoCount(); this.GridView1.DataSource = biz.GetGoodsBaseInfoList(this.ProPageToolBar1.PageSize, 1, this.ProPageToolBar1.AllCount); this.GridView1.DataBind(); }
/// <summary> /// 指定的客户是否还需要继续等待 /// </summary> /// <param name="customer"></param> /// <param name="salePriceVM">销售价格单</param> /// <returns></returns> public bool Waite(Customer customer) { if (this.processingCustomer == customer) { //是当前用户,开始收银 //如果客户同意付款 //对客户所购物品的售价进行实际的计算 List <GoodsSalePriceVM> salesPriceInfo = new List <GoodsSalePriceVM>(); GoodsManageBIZ biz = new GoodsManageBIZ(); CustomerManageBIZ cbiz = new CustomerManageBIZ(); bool isCustomer = (cbiz.GetCustomerContactInfo(customer.CustomerID) != null); foreach (Goods goods in customer.Goodss) { GoodsSalePriceVM vm = new GoodsSalePriceVM(goods); int integral; decimal sellPrice = biz.GoodsSellPrice(goods.GoodsID, goods.SerialNumber, goods.GoodsNumber, isCustomer, out integral); if (sellPrice == 0) { vm.GoodsNumber = 0; goods.GoodsNumber = 0; } vm.DiscountPrice = sellPrice; //goods.GoodsPrice = sellPrice; goods.Integral = integral; salesPriceInfo.Add(vm); } this.CurrCRManchines.ReSet(); this.CurrCRManchines.GoodsSalePriceList = salesPriceInfo; return(false); } else { if (this.processingCustomer == null) { if (customerQueue.Count > 0) { //准备进行下一个客户的处理 this.processingCustomer = customerQueue.Dequeue(); this.lastProcessTime = DateTime.Now; } } else { //当前客户可能已经离开,放弃购物了,需要强行清除,否则后面的客户将会一直等待 if (DateTime.Now.Subtract(lastProcessTime).Minutes > 5) { this.processingCustomer = null; } } return(true); } }
protected void ProPageToolBar1_PageChangeIndex(object sender, EventArgs e) { GoodsManageBIZ biz = new GoodsManageBIZ(); this.GridView1.DataSource = biz.GetGoodsBaseInfoList( this.ProPageToolBar1.PageSize, this.ProPageToolBar1.CurrentPage, this.ProPageToolBar1.AllCount ); this.GridView1.DataBind(); }
/// <summary> /// 指定的客户是否还需要继续等待 /// </summary> /// <param name="customer"></param> /// <param name="salePriceVM">销售价格单</param> /// <returns></returns> public bool Waite(Customer customer) { if (this.processingCustomer == customer) { //是当前用户,开始收银 //如果客户同意付款 //对客户所购物品的售价进行实际的计算 List<GoodsSalePriceVM> salesPriceInfo = new List<GoodsSalePriceVM>(); GoodsManageBIZ biz = new GoodsManageBIZ(); CustomerManageBIZ cbiz = new CustomerManageBIZ(); bool isCustomer = (cbiz.GetCustomerContactInfo(customer.CustomerID) != null); foreach (Goods goods in customer.Goodss) { GoodsSalePriceVM vm = new GoodsSalePriceVM(goods); int integral; decimal sellPrice = biz.GoodsSellPrice(goods.GoodsID, goods.SerialNumber, goods.GoodsNumber, isCustomer, out integral); if (sellPrice == 0) { vm.GoodsNumber = 0; goods.GoodsNumber = 0; } vm.DiscountPrice = sellPrice; //goods.GoodsPrice = sellPrice; goods.Integral = integral; salesPriceInfo.Add(vm); } this.CurrCRManchines.ReSet(); this.CurrCRManchines.GoodsSalePriceList = salesPriceInfo; return false; } else { if (this.processingCustomer == null) { if (customerQueue.Count > 0) { //准备进行下一个客户的处理 this.processingCustomer = customerQueue.Dequeue(); this.lastProcessTime = DateTime.Now; } } else { //当前客户可能已经离开,放弃购物了,需要强行清除,否则后面的客户将会一直等待 if (DateTime.Now.Subtract(lastProcessTime).Minutes > 5) this.processingCustomer = null; } return true; } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { GoodsManageBIZ biz = new GoodsManageBIZ(); List<string> nameList = biz.GetAllGoodsNames(); nameList.Insert(0, "请选择"); this.ddlGoodsNames.DataSource = nameList; this.ddlGoodsNames.DataBind(); } }
protected void GridView1_SelectedIndexChanged(object sender, EventArgs e) { lblMsg.Text = "Selected id=" + GridView1.SelectedRow.Cells[1].Text; string sn = GridView1.SelectedRow.Cells[1].Text; //调用业务层方法获取实体 GoodsManageBIZ biz = new GoodsManageBIZ(); GoodsBaseInfo info=biz.GetGoodsBaseInfo(sn); //将实体与页面控件绑定 WebControlDataMap.FillDataFromEntityClass(info, MyWebForm.GetIBControls(this.tbGoosBaseInfo.Controls) ); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { GoodsManageBIZ biz = new GoodsManageBIZ(); this.ProPageToolBar1.PageSize = 5; this.ProPageToolBar1.AllCount = biz.GetAllGoodsBaseInfoCount(); this.GridView1.DataSource = biz.GetGoodsBaseInfoList(this.ProPageToolBar1.PageSize, 1, this.ProPageToolBar1.AllCount); this.GridView1.DataBind(); } }
protected void btnSave_Click(object sender, EventArgs e) { if (dbtSN.Text.Trim() == "") { lblMsg.Text = "没有条码号,请输入!"; return; } //实例化一个控件数据映射对象 ControlDataMap cdm = new ControlDataMap(); //收集数据到实体对象 GoodsBaseInfo info = cdm.CollectDataToObject<GoodsBaseInfo>( MyWebForm.GetIBControls(this.tbGoosBaseInfo.Controls) ); //调用业务类,保存数据 GoodsManageBIZ biz = new GoodsManageBIZ(); if (biz.SaveGoodsBaseInfo(info)) lblMsg.Text = "保存成功!"; else lblMsg.Text = "保存失败."; bindGrid(); }
protected void Page_Load(object sender, EventArgs e) { if (!SuperMarketBIZ.Instance.InBusiness || Session["Curr_Customer"] == null) Response.Redirect("~/Default.aspx"); if (!IsPostBack) { GoodsManageBIZ biz = new GoodsManageBIZ(); this.GridView1.DataKeyNames = new string[] { "GoodsID" }; this.GridView1.DataSource = biz.GetGoodsSaleInfo(); this.GridView1.DataBind(); Customer customer = (Customer)Session["Curr_Customer"]; this.lblWelcomeMsg.Text = string.Format("你好[{0}],你的客户号是:{1}", customer.CustomerName, customer.CustomerID); btnBuy.Enabled = false; btnEditBuyCount.Enabled = false; lblGoodsCount.Text = customer.Goodss.Count.ToString(); ((Site2)this.Master).NavigateMessage = "今日商品信息"; } }
/// <summary> /// 开始营业 /// </summary> /// <returns></returns> public bool StartBusiness() { Message = ""; if (this.InBusiness) { Message = "已经在营业中!"; return(false); } GoodsManageBIZ gm = new GoodsManageBIZ(); if (gm.GetAllGoodsBaseInfoCount() <= 0) { Message += "没有商品基础信息;\r\n"; return(false); } if (gm.GetGoodsStockCount() <= 0) { Message += "没有商品存货信息;\r\n"; return(false); } if (CashierManageBIZ.WorkingCashier.Count == 0) { Message += "没有收银员到岗,请管理员先进行【收银台管理】!\r\n"; return(false); } //实例化收银台属性 this.CashierConsole = new List <CashierRegisterBIZ>(); foreach (Cashier cashier in CashierManageBIZ.WorkingCashier) { this.CashierConsole.Add(new CashierRegisterBIZ(cashier)); } this.InBusiness = true; return(true); }
/// <summary> /// 开始营业 /// </summary> /// <returns></returns> public bool StartBusiness() { Message = ""; if (this.InBusiness) { Message = "已经在营业中!"; return false ; } GoodsManageBIZ gm = new GoodsManageBIZ(); if (gm.GetAllGoodsBaseInfoCount() <= 0) { Message += "没有商品基础信息;\r\n"; return false; } if (gm.GetGoodsStockCount() <= 0) { Message += "没有商品存货信息;\r\n"; return false; } if (CashierManageBIZ.WorkingCashier.Count == 0) { Message += "没有收银员到岗,请管理员先进行【收银台管理】!\r\n"; return false; } //实例化收银台属性 this.CashierConsole = new List<CashierRegisterBIZ>(); foreach (Cashier cashier in CashierManageBIZ.WorkingCashier) { this.CashierConsole.Add(new CashierRegisterBIZ(cashier)); } this.InBusiness = true; return true ; }
protected void btnDelete_Click(object sender, EventArgs e) { if (this.dlCHJLH.Text != "") { GoodsManageBIZ biz = new GoodsManageBIZ(); GoodsStock info = new GoodsStock() { GoodsID = int.Parse( this.dlCHJLH.Text) }; biz.DeleteGoodsStock(info); lblMsg.Text = "删除成功!"; MyWebForm.ClearIBData(this.Controls); //重新绑定数据 this.ProPageToolBar1.ReBindResultData(); } else { lblMsg.Text = "请先选择一条记录!"; } }
protected void ddlGoodsNames_SelectedIndexChanged(object sender, EventArgs e) { lblMsg.Text = "请选择厂商"; string goodsName = this.ddlGoodsNames.SelectedItem.Text; if (goodsName != "请选择") { GoodsManageBIZ biz = new GoodsManageBIZ(); List<GoodsBaseInfoVM> list = biz.GetGoodsBaseInfoWhithGoodsName(goodsName); this.ddlManufacturer.DataTextField = "Manufacturer"; this.ddlManufacturer.DataValueField = "SerialNumber";//"SerialNumber" this.ddlManufacturer.DataSource = list ; this.ddlManufacturer.DataBind(); } }