private void setCondition() { if (PlanCode.SelectedIndex < 0) { return; } List <string> stores = new System.Collections.Generic.List <string>(); string planCode = PlanCode.SelectedItem.Value.ToString(); List <PlanBomEntity> allEntities = PlanBOMFactory.GetByOrderCode(planCode); List <LineSideStockEntity> dataSource = new List <LineSideStockEntity>(); foreach (var a in allEntities) { LineSideStockEntity ls = LineSideStockFactory.GetStoreItem(a.LINESIDE_STOCK_CODE, a.ITEM_CODE); if (ls != null) { dataSource.Add(ls); if (!stores.Contains(a.RESOURCE_STORE)) { stores.Add(a.RESOURCE_STORE);//添加采购虚拟区 } } } ASPxGridView1.DataSource = dataSource; ASPxGridView1.DataBind(); DestinationStore.Items.Clear(); DestinationStore.Items.Add("CGXN", "CGXN"); foreach (var s in stores) { DestinationStore.Items.Add(s, s); } }
private void setCondition() { //绑定表数据 userManager theUserManager = (userManager)Session["theUserManager"]; theCompanyCode = theUserManager.getCompanyCode(); string theUserId = theUserManager.getUserId(); List <WorkShopEntity> workShop = WorkShopFactory.GetUserWorkShops(theUserId); ASPxGridView1.DataSource = LineSideStockFactory.GetByWorkShopID(workShop[0].RMES_ID); GridViewDataComboBoxColumn col = ASPxGridView1.Columns["PLINE_CODE"] as GridViewDataComboBoxColumn; col.PropertiesComboBox.DataSource = ProductLineFactory.GetAll(); col.PropertiesComboBox.ValueField = "RMES_ID"; col.PropertiesComboBox.TextField = "PLINE_NAME"; GridViewDataComboBoxColumn col1 = ASPxGridView1.Columns["LOCATION_CODE"] as GridViewDataComboBoxColumn; col1.PropertiesComboBox.DataSource = db.Fetch <LocationEntity>(""); col1.PropertiesComboBox.ValueField = "RMES_ID"; col1.PropertiesComboBox.TextField = "LOCATION_NAME"; ASPxGridView1.DataBind(); }
protected void UpdateButton_Click(object sender, EventArgs e) { string planCode = PlanCode.SelectedItem.Value.ToString(); string resourceStore = ResourceStore.Text; string itemCode = ItemCode.Text; int resourceQTY = int.Parse(ResourceQTY.Text); string destinationStore = ""; int transQTY = 0; if (DestinationStore.SelectedIndex < 0) { ErrorLabel.Visible = true; ErrorLabel.Text = "请选择一个目标库!"; return; } destinationStore = DestinationStore.SelectedItem.Value.ToString(); if (resourceStore.Equals(destinationStore) || resourceStore == destinationStore) { ErrorLabel.Visible = true; ErrorLabel.Text = "目标库不能与源库相同!"; return; } if (string.IsNullOrEmpty(TransQTY.Text)) { ErrorLabel.Visible = true; ErrorLabel.Text = "请输入一个移库数量!"; return; } try { transQTY = int.Parse(TransQTY.Text); } catch (Exception ex) { ErrorLabel.Visible = true; ErrorLabel.Text = "请输入正确的移库数量!"; return; } if ((resourceQTY - transQTY) < 0) { ErrorLabel.Visible = true; ErrorLabel.Text = "移库数量不能大于库存数量!"; return; } string msg = LineSideStockFactory.TransStore(planCode, resourceStore, itemCode, destinationStore, transQTY); if (msg == "true") { Response.Write("<script>alert('移库完成!');self.location.href=self.location.href;</script>"); } else { Response.Write("<script>alert('" + msg + "!');</script>"); return; } }
private void setCondition() { //绑定表数据 userManager theUserManager = (userManager)Session["theUserManager"]; theCompanyCode = theUserManager.getCompanyCode(); string theUserId = theUserManager.getUserId(); List <LineSideStockEntity> dataSource = LineSideStockFactory.GetAll(); if (!plineCode.SelectedItem.Value.ToString().Equals("All")) { dataSource = (from s in dataSource where s.PLINE_CODE == (plineCode.SelectedItem.Value.ToString()) select s).ToList <LineSideStockEntity>(); } if (storeCode.SelectedItem != null && !storeCode.SelectedItem.Value.ToString().Equals("All")) { dataSource = (from s in dataSource where s.STORE_CODE == (storeCode.SelectedItem.Value.ToString()) select s).ToList <LineSideStockEntity>(); } ASPxGridView1.DataSource = dataSource; GridViewDataComboBoxColumn comFactory = ASPxGridView1.Columns["FACTORY_CODE"] as GridViewDataComboBoxColumn; DataTable dt_factory = new DataTable(); dt_factory.Columns.Add("text"); dt_factory.Columns.Add("value"); dt_factory.Rows.Add("园区", "8101"); dt_factory.Rows.Add("基地", "8102"); comFactory.PropertiesComboBox.TextField = "text"; comFactory.PropertiesComboBox.ValueField = "value"; GridViewDataComboBoxColumn comStore = ASPxGridView1.Columns["STORE_CODE"] as GridViewDataComboBoxColumn; List <LineSideStoreEntity> stores = LinesideStoreFactory.GetAll(); comStore.PropertiesComboBox.DataSource = stores; comStore.PropertiesComboBox.TextField = "STORE_NAME"; comStore.PropertiesComboBox.ValueField = "STORE_CODE"; GridViewDataComboBoxColumn comPline = ASPxGridView1.Columns["PLINE_CODE"] as GridViewDataComboBoxColumn; List <ProductLineEntity> plines = ProductLineFactory.GetAll(); comPline.PropertiesComboBox.DataSource = plines; comPline.PropertiesComboBox.TextField = "PLINE_NAME"; comPline.PropertiesComboBox.ValueField = "RMES_ID"; GridViewDataComboBoxColumn comLocation = ASPxGridView1.Columns["LOCATION_CODE"] as GridViewDataComboBoxColumn; ASPxGridView1.DataBind(); }
private void setCondition() { if (PlanCode.SelectedIndex < 0) { return; } string planCode = PlanCode.SelectedItem.Value.ToString(); List <PlanBomEntity> allEntities = PlanBOMFactory.GetByOrderCode(planCode); List <LineSideStockEntity> dataSource = new List <LineSideStockEntity>(); foreach (var a in allEntities) { LineSideStockEntity ls = LineSideStockFactory.GetStoreItem(a.LINESIDE_STOCK_CODE, a.ITEM_CODE); if (ls != null) { dataSource.Add(ls); } } ASPxGridView1.DataSource = dataSource; ASPxGridView1.DataBind(); }
private void btnOK_Click(object sender, EventArgs e) { try { ent.ITEM_QTY = int.Parse(txtItemQty.Text); } catch (Exception ex) { MessageBox.Show("请输入有效字符"); return; } if (string.IsNullOrWhiteSpace(txtItemCode.Text)) { MessageBox.Show("物料编码不能为空"); return; } ent.ITEM_CODE = txtItemCode.Text; ent.ITEM_NAME = txtItemName.Text; LineSideStockFactory.Storage(ent); txtItemName.Text = ""; txtItemCode.Text = ""; txtItemQty.Text = ""; }
private void btnOK_Click(object sender, EventArgs e) { if (selCount == 0) { return; } progressBar1.Maximum = selCount + 1; progressBar1.Value = 0; for (int i = 0; i < dgvBom.Rows.Count; i++) { if (dgvBom.Rows[i].Cells["colItemChecked"].EditedFormattedValue.ToString() == "True") { string rmes_id = dgvBom.Rows[i].Cells["colRmesID"].Value.ToString(); string strItemQty = dgvBom.Rows[i].Cells["colItemQty"].Value.ToString(); string item_code = dgvBom.Rows[i].Cells["colItemCode"].Value.ToString(); object obj_vendor_code = dgvBom.Rows[i].Cells["colVendorCode"].Value; object obj_batch_code = dgvBom.Rows[i].Cells["colItemBatch"].Value; float complete_qty = float.Parse(strItemQty); string vendor_code = obj_vendor_code == null ? "" : obj_vendor_code.ToString(); string batch_code = obj_batch_code == null ? "" : obj_batch_code.ToString(); SNBomTempFactory.HandleBomItemComplete(companyCode, rmes_id, item_code, vendor_code, batch_code, complete_qty); LineSideStockFactory.OutOfStorage(item_code, vendor_code, batch_code, LinesideStock, plineCode, complete_qty); progressBar1.Value = progressBar1.Value + 1; } } progressBar1.Value = progressBar1.Maximum; MessageBox.Show("物料消耗数据批处理完成!"); RMESEventArgs thisEventArg = new RMESEventArgs(); thisEventArg.MessageHead = "BOM"; thisEventArg.MessageBody = SN; SendDataChangeMessage(thisEventArg); (Parent as frmBomItemMng).Close(); }
public void InitLinesideStock() { List <LineSideStockEntity> lst = LineSideStockFactory.GetByStoreCode(LinesideStockCode); gridLSS.DataSource = lst; }