public void UpdateSectionMasterDetails() { try { SectionMaster s = new SectionMaster(); s.sectionId = Convert.ToInt32(txtSectionId.Text); s.sectionName = txtSectionName.Text; if (cmbStatus.SelectedItem == "Active") { s.sectionStatus = 0; } else { s.sectionStatus = 1; } SectioMasterBL bl = new SectioMasterBL(); int n = bl.UpdateSectiondata(s); MessageBox.Show("Record is Updated..."); } catch (Exception ex) { MessageBox.Show("Records are not Saved...Please Try Again"); } finally { //DisableControls(this); } }
public void SaveSectionDetails() { SectionMaster section = new SectionMaster(); section.sectionId = Convert.ToInt32(txtSectionId.Text); section.sectionName = txtSectionName.Text; section.sectionStatus = cmbStatus.SelectedIndex; SectioMasterBL s = new SectioMasterBL(); s.SaveSectionMasterdata(section); MessageBox.Show("Record is Saved", "Message", MessageBoxButtons.OK); ClearControls(); }
public void DeleteSectionMasterDetails() { try { SectionMaster objSec = new SectionMaster(); objSec.sectionId = Convert.ToInt32(txtSectionId.Text); SectioMasterBL bl = new SectioMasterBL(); int n = bl.DeleteSectionData(objSec); MessageBox.Show("Record is Deleted..."); } catch (Exception ex) { MessageBox.Show("Records are not Saved...Please Try Again"); } finally { DisableControls(this); } }