Esempio n. 1
0
 private void btnEditArea_Click(object sender, EventArgs e)
 {
     try
     {
         if (dgvArea.CurrentRow != null)
         {
             AreaSetSortedColumns();
             frmAreaEntry fArea = new frmAreaEntry((int)Common.Constant.Mode.Modify, (Int64)dgvArea.CurrentRow.Cells["AreaID"].Value, dgvCountry.CurrentRow.Cells["CountryName"].Value.ToString(), dgvState.CurrentRow.Cells["StateName"].Value.ToString(), (long)dgvCity.CurrentRow.Cells["CityID"].Value, dgvCity.CurrentRow.Cells["CityName"].Value.ToString());
             fArea.ShowDialog();
             AreasetDefaultGridRecords(sender, e);
         }
     }
     catch (Exception exc)
     {
         Utill.Common.ExceptionLogger.writeException("Area", exc.StackTrace);
         MessageBox.Show(Utill.Common.CommonMessage.ExceptionMesg, "Exception");
     }
 }
Esempio n. 2
0
 private void btnNewArea_Click(object sender, EventArgs e)
 {
     try
     {
         if (dgvCity.CurrentRow != null)
         {
             frmAreaEntry fArea = new frmAreaEntry((int)Common.Constant.Mode.Insert, 0, dgvCountry.CurrentRow.Cells["CountryName"].Value.ToString(), dgvState.CurrentRow.Cells["StateName"].Value.ToString(), (long)dgvCity.CurrentRow.Cells["CityID"].Value, dgvCity.CurrentRow.Cells["CityName"].Value.ToString());
             fArea.ShowDialog();
             LoadAreaList();
             if (dgvArea.Rows.Count > 0)
             {
                 dgvArea.CurrentCell = dgvArea.Rows[0].Cells[0];
             }
         }
     }
     catch (Exception exc)
     {
         Utill.Common.ExceptionLogger.writeException("Area", exc.StackTrace);
         MessageBox.Show(Utill.Common.CommonMessage.ExceptionMesg, "Exception");
     }
 }