Exemple #1
0
        private void btnAdd2List_Click(object sender, EventArgs e)
        {
            Goods goods = autxtNSupplyGoods.SelectedObj as Goods;

            if (null == goods)
            {
                if (!StringUtil.isEmpty(autxtNSupplyGoods.Term))
                {
                    DialogResult rslt = MessageBox.Show("无此商品!是否新增?", "操作结果", MessageBoxButtons.OKCancel, MessageBoxIcon.Question);
                    if (rslt == DialogResult.OK)
                    {
                        Usr       usr   = MainForm.usr;
                        GoodsForm gForm = new GoodsForm(null, goodsManager, InterfaceProxyGenerator.CreateInterfaceProxy <ISubCatgManager>(usr));
                        gForm.ShowDialog();
                    }
                }
                return;
            }
            foreach (DataGridViewRow row in dtgvStockin.Rows)
            {
                long gId = StringUtil.Obj2Long(row.Cells[colGID.Name].Value);
                if (gId == goods.GID__PK)
                {
                    MainForm.Warn("此商品已添加,请重新选择!");
                    autxtNSupplyGoods.clear();
                    return;
                }
            }
            int index = dtgvStockin.Rows.Add();

            InitRow(index, goods);
            autxtNSupplyGoods.clear();
        }
Exemple #2
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            GoodsForm    gForm  = new GoodsForm(null, manager, subCatgManager);
            DialogResult result = gForm.ShowDialog();

            if (result == DialogResult.OK)
            {
                BindData();
            }
        }
        private void btnAddGoods_Click(object sender, EventArgs e)
        {
            GoodsForm    gForm  = new GoodsForm(null, goodsManager, subCatgManager);
            DialogResult result = gForm.ShowDialog();

            if (result == DialogResult.OK)
            {
                btnQuery.PerformClick();
            }
        }
Exemple #4
0
        private void dtgvMGoods_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            DataGridViewRow curRow = dtgvMGoods.CurrentRow;

            if (null != curRow)
            {
                Goods goods = new Goods();
                goods.GID__PK   = StringUtil.Obj2Int(curRow.Cells[colGId.Name].Value);
                goods.GName     = StringUtil.Obj2Str(curRow.Cells[colGName.Name].Value);
                goods.Specs     = StringUtil.Obj2Str(curRow.Cells[colSpecs.Name].Value);
                goods.Abbr      = StringUtil.Obj2Str(curRow.Cells[colAbbr.Name].Value);
                goods.ShelfLife = StringUtil.Obj2Str(curRow.Cells[colShelfLife.Name].Value);
                goods.SubCatgID = StringUtil.Obj2Short(curRow.Cells[colSubCatgId.Name].Value);
                goods.Remark    = StringUtil.Obj2Str(curRow.Cells[colRemark.Name].Value);
                goods.St        = StringUtil.Obj2Str(curRow.Cells[colStEnum.Name].Value);

                GoodsForm    gForm  = new GoodsForm(goods, manager, subCatgManager);
                DialogResult result = gForm.ShowDialog();
                if (result == DialogResult.OK)
                {
                    BindData();
                }
            }
        }