Exemple #1
0
 /// <summary>
 /// area grid cell double click for update
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void dgvArea_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
 {
     try
     {
         if (e.RowIndex != -1)
         {
             string strArea = dgvArea.CurrentRow.Cells["dgvtxtarea"].Value.ToString();
             if (strArea != "NA")
             {
                 AreaInfo infoArea = new AreaInfo();
                 AreaSP   spArea   = new AreaSP();
                 infoArea          = spArea.AreaFill(Convert.ToDecimal(dgvArea.CurrentRow.Cells[1].Value.ToString()));
                 txtAreaName.Text  = infoArea.AreaName;
                 txtNarration.Text = infoArea.Narration;
                 btnSave.Text      = "Update";
                 btnDelete.Enabled = true;
                 txtAreaName.Focus();
                 decAreaId = Convert.ToDecimal(dgvArea.CurrentRow.Cells[1].Value.ToString());
             }
             else
             {
                 Messages.WarningMessage("NA Area cannot update or delete");
                 Clear();
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("AR16" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
        public AreaInfo AreaFill(decimal decAreaId)
        {
            AreaInfo infoArea = new AreaInfo();

            try
            {
                infoArea = SpArea.AreaFill(decAreaId);
            }
            catch (Exception ex)
            {
                MessageBox.Show("AR6" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            return(infoArea);
        }