Пример #1
0
 private void btnUpdate_Click_1(object sender, EventArgs e)
 {
     try
     {
         if (HTDataID == 0)
         {
             this.ShowMessage("请保存产品后修改!");
             return;
         }
         this.BaseFocusLabel.Focus();
         int ID = SysConvert.ToInt32(gridView1.GetRowCellValue(gridView1.FocusedRowHandle, "DtsID"));
         if (ID > 0)
         {
             frmGBAdd frm = new frmGBAdd();
             frm.ID    = HTDataID;
             frm.DID   = ID;
             frm.Owner = this;
             frm.ShowDialog();
             BindGrid();
             ProcessGrid.GridViewFocus(gridView1, new string[1] {
                 "DtsID"
             }, new string[1] {
                 ID.ToString()
             });
         }
         else
         {
             this.ShowMessage("请选择需要修改的挂板!");
         }
     }
     catch (Exception E)
     {
         this.ShowMessage(E.Message);
     }
 }
Пример #2
0
        private void pictureBox1_Click(object sender, EventArgs e)
        {
            try
            {
                if (HTDataID == 0)
                {
                    this.ShowMessage("请保存产品后添加挂板!");
                    return;
                }

                frmGBAdd frm = new frmGBAdd();
                frm.ID    = HTDataID;
                frm.Owner = this;
                frm.ShowDialog();

                BindGrid();
                ProcessGrid.GridViewFocus(gridView1, new string[1] {
                    "DtsID"
                }, new string[1] {
                    frm.DID.ToString()
                });
            }
            catch (Exception E)
            {
                this.ShowMessage(E.Message);
            }
        }