Example #1
0
        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();
        }
Example #2
0
        //确定
        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);;
            }
        }