protected void scanChange_Click(object sender, EventArgs e) { Controls_ProductShow show = sender as Controls_ProductShow; string barcode = show.BarCode; int len = this.gridview.Rows.Count; Label lb; string productid = show.ProductId; for (int i = 0; i < len; i++) { lb = this.gridview.Rows[i].FindControl("lbBarCode") as Label; Console.Write(lb.Text.Trim()); Console.Write(barcode.ToString()); if (lb.Text.Trim() == barcode) { this.gridview.Rows[i].ForeColor = System.Drawing.Color.Red; string now = System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); string loginuser = "******"; this.gridview.Rows[i].Cells[5].Text = now; this.gridview.Rows[i].Cells[6].Text = loginuser; string sql = "update Plan_Product set OutStoreTime=cast('" + now + "',datetime),OutStoreScanner='" + loginuser + "',state='" + ProductStateEnum.OutStoreScanString + "' where PlanId=" + ViewState[Plan_Id].ToString() + " and ProductId=" + productid; FT.DAL.DataAccessFactory.GetDataAccess().ExecuteSql(sql); sql = "update Product set ProductStatus=" + ProductStateEnum.OutStoreScanInt + ",State='" + ProductStateEnum.OutStoreScanString + "' where Product_Id=" + productid; FT.DAL.DataAccessFactory.GetDataAccess().ExecuteSql(sql); } show.Clear(); show.Focus(); } ViewState[Product_BarCode] = barcode; }
protected void scanChange_Click(object sender, EventArgs e) { Controls_ProductShow show = sender as Controls_ProductShow; string productId = show.ProductId; // ViewState[Product_Id] = productId; string sql = "SELECT SaleRecord.CustomerName " + " FROM Sale_Product INNER JOIN " + " SaleRecord ON Sale_Product.SaleId = SaleRecord.Id where Sale_Product.ProductId=" + productId; object obj = FT.DAL.DataAccessFactory.GetDataAccess().SelectScalar(sql); if (obj != null) { this.txtCustomerName.Text = obj.ToString(); ViewState[Product_Id] = productId; } }
protected void scanChange_Click(object sender, EventArgs e) { Controls_ProductShow show = sender as Controls_ProductShow; //string barcode = show.BarCode; string productId = show.ProductId; ArrayList lists = ViewState[Sale_List] as ArrayList; if (lists.Contains(productId)) { lists.Remove(productId); } else { lists.Add(productId); } //ViewState[Sale_List]=lists; this.ReBind(); /* * int len = this.gridview.Rows.Count; * * Label lb; * * string productid = show.ProductId; * for (int i = 0; i < len; i++) * { * lb = this.gridview.Rows[i].FindControl("lbBarCode") as Label; * if (lb.Text.Trim() == barcode) * { * this.gridview.Rows[i].ForeColor = System.Drawing.Color.Red; * string now = System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); * string loginuser = "******"; * this.gridview.Rows[i].Cells[5].Text = now; * this.gridview.Rows[i].Cells[6].Text = loginuser; * string sql = "update Plan_Product set OutStoreTime=cast('" + now + "',datetime),OutStoreScanner='" + loginuser + "',state='出库扫描完成' where PlanId=" + ViewState[Plan_Id].ToString() + " and ProductId=" + productid; + FT.DAL.DataAccessFactory.GetDataAccess().ExecuteSql(sql); + } + } + ViewState[Product_BarCode] = barcode; * */ }
protected void scanChange_Click(object sender, EventArgs e) { Controls_ProductShow show = sender as Controls_ProductShow; }