コード例 #1
0
 private void gvMultiple_CellClick(object sender, DataGridViewCellEventArgs e)
 {
     if (e.RowIndex >= 0)
     {
         if (e.ColumnIndex == gvMultiple.Columns["Delete"].Index)
         {
             string Status = gvMultiple.Rows[e.RowIndex].Cells[gvMultiple.Columns["STATUS"].Index].Value.ToString();
             if (Status == "WORKING" && CommonData.LogUserId.ToUpper() != "ADMIN")
             {
                 MessageBox.Show("This record cannot deleted.", "SSCRM Application", MessageBoxButtons.OK, MessageBoxIcon.Information);
             }
             else
             {
                 //DialogResult dlgResult = MessageBox.Show("Do you want delete this record?", "Confirm?", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
                 //if (dlgResult == DialogResult.Yes)
                 {
                     string sEcode  = gvMultiple.Rows[e.RowIndex].Cells[gvMultiple.Columns["HAMH_EORA_CODE"].Index].Value.ToString();
                     string sApplNo = gvMultiple.Rows[e.RowIndex].Cells[gvMultiple.Columns["HAMH_APPL_NUMBER"].Index].Value.ToString();
                     objHRInfo = new HRInfo();
                     int isqlqry = objHRInfo.DelDuplicatRecords(Convert.ToInt32(sApplNo), Convert.ToInt32(sEcode), 102);
                     objHRInfo = null;
                     if (isqlqry > 0)
                     {
                         //MessageBox.Show("Selected information Has Been Deleted", "SSCRM Application", MessageBoxButtons.OK, MessageBoxIcon.Information);
                     }
                     else
                     {
                         MessageBox.Show("Selected information not Deleted", "SSCRM Application", MessageBoxButtons.OK, MessageBoxIcon.Information);
                     }
                     GetDatatoGrid();
                 }
             }
         }
     }
 }