private void button1_Click(object sender, EventArgs e) { ClientProduceOutputBillSave dmo = new ClientProduceOutputBillSave(); dmo.AccountingUnit_ID = SysConfig.Current.AccountingUnit_ID ?? 0; dmo.Department_ID = SysConfig.Current.Department_ID ?? 0; dmo.Domain_ID = SysConfig.Current.Domain_ID; dmo.User_ID = SysConfig.Current.User_ID; foreach (ListViewItem item in listView1.Items) { if (item.Checked) { var goods = item.Tag as ClientGoods; var detail = new ClientGoods(); detail.Goods_ID = goods.Goods_ID; decimal?number = null; try { number = decimal.Parse(item.SubItems[2].Text); } catch (Exception) { } detail.Goods_Number = number; dmo.Details.Add(detail); } } XmlSerializerUtil.ClientXmlSerializer(dmo); SyncBillUtil.SyncProductInStore(); MessageBox.Show("操作成功"); Close(); }
void LoadGoodsFromRpc() { var list = RpcFacade.Call <List <RpcObject> >("/MainSystem/B3Butchery/Rpcs/ProduceOutputRpc/GetTodayGoodsByStore", SysConfig.Current.AccountingUnit_ID, SysConfig.Current.Department_ID, mStoreId, mProductPlanId); listView1.BeginUpdate(); listView1.Items.Clear(); foreach (RpcObject item in list) { var goods = new ClientGoods(); goods.Goods_ID = item.Get <long>("Goods_ID"); goods.Goods_Name = item.Get <string>("Goods_Name"); goods.Goods_Number = item.Get <decimal?>("Number"); goods.Goods_SecondNumber = item.Get <decimal?>("InnerPackingPer"); goods.Goods_InnerPackingPer = item.Get <decimal?>("Goods_InnerPackingPer"); var lvItem = new ListViewItem(goods.Goods_Name); lvItem.Tag = goods; lvItem.SubItems.Add(goods.Goods_Number.ToString()); lvItem.SubItems.Add(goods.Goods_Number.ToString()); lvItem.SubItems.Add(goods.Goods_SecondNumber.ToString()); listView1.Items.Add(lvItem); //listView1.Items[] } listView1.EndUpdate(); }
//确定 private void button2_Click(object sender, EventArgs e) { try { ClientProduceOutputBillSave clientDmo = new ClientProduceOutputBillSave { AccountingUnit_ID = SysConfig.Current.AccountingUnit_ID.Value, Department_ID = SysConfig.Current.Department_ID ?? 0, Domain_ID = SysConfig.Current.Domain_ID, User_ID = SysConfig.Current.User_ID, CreateTime = DateTime.Now }; var clientDetail = new ClientGoods(); clientDetail.Goods_ID = mClientGoods.Goods_ID; clientDetail.Goods_Number = decimal.Parse(txtNumber.Text); clientDmo.Details.Add(clientDetail); XmlSerializerUtil.ClientXmlSerializer(clientDmo); SyncBillUtil.SyncProductOut(); MessageBox.Show("操作成功"); txtNumber.Text = ""; textBox1.Text = ""; } catch (Exception ex) { MessageBox.Show(ex.Message);; } }
private void ProductInStoreConfirmOK_Load(object sender, EventArgs e) { var list = RpcFacade.Call <List <RpcObject> >("/MainSystem/B3Butchery/Rpcs/ProductInStoreRpc/GetRpcEasyProductInStoreDetailById", long.Parse(pId)); listView1.BeginUpdate(); foreach (RpcObject item in list) { var lvItem = new ListViewItem(item.Get <string>("Goods_Name")); try { lvItem.SubItems.Add(item.Get <decimal>("SecondNumber").ToString()); lvItem.SubItems.Add(item.Get <decimal>("Number").ToString()); var goods = new ClientGoods(); goods.Bill_ID = long.Parse(pId); goods.ID = item.Get <long>("ID"); goods.Goods_Name = item.Get <string>("Goods_Name"); goods.Goods_Number = item.Get <decimal>("Number"); lvItem.Tag = goods; } catch (Exception) { lvItem.SubItems.Add(""); } listView1.Items.Add(lvItem); } listView1.EndUpdate(); }
public FrozenInStoreInputNumber(ClientGoods goods) { InitializeComponent(); this.Text = goods.Goods_Name; mClientGoods = goods; SumNumber = mClientGoods.Goods_Number ?? 0; }
private void DataBindGoods() { cbxGoods.DataSource = mGoodsList; cbxGoods.DisplayMember = "Goods_Name"; cbxGoods.ValueMember = "Goods_ID"; if (mGoodsList.Count > 0) { mClientGoods = mGoodsList[0]; } }
void SelectIndexChanged() { if (mGoodsList.Count > 0) { var goodsId = cbxGoods.SelectedValue as long?; if (goodsId.HasValue) { mClientGoods = mGoodsList.FirstOrDefault(x => x.Goods_ID == goodsId); } else { mClientGoods = mGoodsList.FirstOrDefault(); } } txtNumber.Text = "0"; textBox1.Focus(); }
private void btnOk_Click(object sender, EventArgs e) { try { var dmo = new ClientProduceOutputBillSave(); dmo.ID = long.Parse(pId); foreach (ListViewItem item in listView1.Items) { var goods = item.Tag as ClientGoods; var detail = new ClientGoods(); detail.Bill_ID = goods.Bill_ID; detail.ID = goods.ID; detail.Goods_ID = goods.Goods_ID; detail.Goods_Number = goods.Goods_Number; dmo.Details.Add(detail); } var cprkId = SyncBillUtil.ProductInStoreSaveAndCheck(dmo); if (cprkId == 0) { MessageBox.Show("没有成品入库新建权限"); return; } else if (cprkId == -1) { MessageBox.Show("没有成品入库审核权限"); return; } MessageBox.Show("审核成功"); state = 1; try { //九联业务,如果九联模块用户个性设置中,{默认其他出库会计单位}{默认其他出库仓库}和单据相同,生成【其他出库单】 var id = RpcFacade.Call <long>("/MainSystem/B3_JiuLian/Rpcs/ButcherTouchScreenRpc/OtherOutStoreRpc/OtherOutStoreInsertAndCheck", long.Parse(pId)); if (id == 0) { MessageBox.Show("没有其他出库新建权限"); return; } else if (id == -1) { MessageBox.Show("没有其他出库审核权限"); return; } else if (id == -2) { return; } else if (id == -3) { return; } MessageBox.Show("生成已审核其他出库No." + id); } catch (Exception) { } //RpcFacade.Call<List<RpcObject>>("/MainSystem/B3Butchery/Rpcs/ProductInStoreRpc/ProductInStoreCheck", long.Parse(pId)); //MessageBox.Show("审核成功"); } catch (Exception ex) { MessageBox.Show(ex.ToString()); } finally { this.Close(); } }