예제 #1
0
        public static ClientAllGoods CreateClientAllGoods(RpcObject obj)
        {
            var goods = new ClientAllGoods();

            goods.Goods_ID         = obj.Get <long>("Goods_ID");
            goods.Goods_BarCode    = obj.Get <string>("Goods_Code");
            goods.Goods_Name       = obj.Get <string>("Goods_Name");
            goods.Goods_MainUnit   = obj.Get <string>("Goods_MainUnit");
            goods.Goods_SecondUnit = obj.Get <string>("Goods_SecondUnit");

            var d = obj.Get <NamedValue>("Goods_UnitConvertDirection");

            if (d != null)
            {
                if (d.Value == 0)
                {
                    goods.Goods_UnitConvertDirection = GoodsUnitConvertDirection.双向转换;
                }
                else if (d.Value == 1)
                {
                    goods.Goods_UnitConvertDirection = GoodsUnitConvertDirection.由主至辅;
                }
                else if (d.Value == 2)
                {
                    goods.Goods_UnitConvertDirection = GoodsUnitConvertDirection.由辅至主;
                }
            }

            goods.Goods_MainUnitRatio   = obj.Get <decimal?>("Goods_MainUnitRatio");
            goods.Goods_SecondUnitRatio = obj.Get <decimal?>("Goods_SecondUnitRatio");

            return(goods);
        }
예제 #2
0
 private void DataBindGoods()
 {
     cbxGoods.DataSource    = mGoodsList;
     cbxGoods.DisplayMember = "Goods_Name";
     cbxGoods.ValueMember   = "Goods_ID";
     if (mGoodsList.Count > 0)
     {
         mClientGoods = mGoodsList[0];
     }
 }
예제 #3
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();
 }
예제 #4
0
        private void btn_OK_Click(object sender, EventArgs e)
        {
            try
            {
                #region
                //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
                //};
                #endregion

                ClientProductInStore productInStore = new ClientProductInStore
                {
                    Department_ID  = SysConfig.Current.Department_ID ?? 0,
                    InStoreType_ID = 01,
                };
                var clientDetail = new ClientAllGoods();
                clientDetail.Goods_ID     = mClientGoods.Goods_ID;
                clientDetail.Goods_Name   = mClientGoods.Goods_Name;
                clientDetail.Goods_Number = decimal.Parse(txtNumber.Text);
                mSelectList.Add(clientDetail);



                MessageBox.Show("操作成功");
                txtNumber.Text = "";
                textBox1.Text  = "";
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);;
            }
        }