Пример #1
0
        private void btn_checkup_Click(object sender, EventArgs e)
        {
            if (dgvStockIn.CurrentRow != null)
            {
                if (dgvStockIn.CurrentRow.Cells["流水号"].Value.ToString().Equals(""))
                {
                    return;
                }
                if (!dgvStockIn.CurrentRow.Cells["审批"].Value.ToString().Equals(""))
                {
                    MessageBox.Show("该记录已审批完,请选择其它记录!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                }
                if (dgvStockIn.CurrentRow.Cells["审核"].Value.ToString().Equals(""))
                {
                    MessageBox.Show("该记录未审核,请审核后在进行审批操作!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                }
                long id     = Convert.ToInt64(dgvStockIn.CurrentRow.Cells[0].Value.ToString());
                var  estate = checkup();
                if (estate.ToString().Equals("Yes"))
                {
                    if (sIRLogic.Material_Checkup("I", id, this.userName))
                    {
                        MessageBox.Show("审批成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        setDataGridView();

                        // 执行审批操作后,执行计算库存的方法;
                        var s = ssl.Stock_Material();
                    }
                }
                else
                {
                    var i = sIRLogic.Material_Assess("I", id, "NULL");
                    setDataGridView();
                }
            }
            else
            {
                MessageBox.Show("未选中任何一条记录,请选中一条记录后进行审核操作!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Пример #2
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            if (formHelper.inputCheck(groupBox1))
            {
                Get_para();
                if (mOutDepotLogic.InsertMaterialOutDepot(mOutDepot))
                {
                    // 材料手工出库成功后,自动算一下材料库存;
                    StockStatLogic ssl = new StockStatLogic();
                    ssl.Stock_Material();

                    this.DialogResult = DialogResult.OK;
                    this.Close();
                }
                else
                {
                    MessageBox.Show("新增记录失败,请从新操作!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }