예제 #1
0
        private void toolStripButton_Edit_Click(object sender, EventArgs e)
        {
            if (this.dgvMain.SelectedRows.Count > 0)
            {
                DataRow   dr     = ((DataRowView)dgvMain.Rows[this.dgvMain.CurrentCell.RowIndex].DataBoundItem).Row;
                string    BillID = dr["BillID"].ToString();
                DataTable dt     = bll.FillDataTable("WMS.SelectOutStock", new DataParameter[] { new DataParameter("{0}", "BillID='" + BillID + "'") });
                if (int.Parse(dt.Rows[0]["State"].ToString()) > 0)
                {
                    Logger.Info("出库单号 " + dr["BillID"].ToString() + " 已经" + dt.Rows[0]["StateDesc"].ToString() + ",不能修改!");
                    return;
                }

                if (dr["SourceBillID"].ToString().Length != 0)
                {
                    Logger.Info("MES上传单据,不能修改!");
                    return;
                }
                frmOutStockEdit f = new frmOutStockEdit("edit");
                f.Owner  = this;
                f.drEdit = dr;
                if (f.ShowDialog() == DialogResult.OK)
                {
                    this.BindData();
                }
            }
            else
            {
                Logger.Info("请选择要修改的数据行");
            }
        }
예제 #2
0
        private void toolStripButton_Add_Click(object sender, EventArgs e)
        {
            frmOutStockEdit f = new frmOutStockEdit("add");

            f.Owner = this;
            if (f.ShowDialog() == DialogResult.OK)
            {
                this.BindData();
            }
        }