示例#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.SelectBillMaster", new DataParameter[] { new DataParameter("{0}", "Main.BillID='" + BillID + "'") });
         if (int.Parse(dt.Rows[0]["State"].ToString()) > 0)
         {
             Logger.Info("空箱出库单号 " + dr["BillID"].ToString() + " 已经" + dt.Rows[0]["StateDesc"].ToString() + ",不能修改!");
             return;
         }
         frmPalletOutEdit f = new frmPalletOutEdit("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)
        {
            frmPalletOutEdit f = new frmPalletOutEdit("add");

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