public void DeleteSectionRackMapDetails(int secRacId) { try { secRac = new SectionRackMapMaster(); secRac.sr_rac_map_id = Convert.ToInt32(txt_SecRac_ID.Text); secRacBL = new SecRackMapBL(); if (secRacBL.DeleteSectionRackMapDetails(secRacId) > 0) { MessageBox.Show("Records Are Deleted..", "Information", MessageBoxButtons.OK); } else { MessageBox.Show("Records Are Not Deleted..", "Information", MessageBoxButtons.OK); } } catch (Exception ex) { string errorMessage = ErrorHandling.Class1.CreateErrorMessage(ex); ErrorHandling.Class1.LogFileWrite(errorMessage); MessageBox.Show("Records Are Not Deleted..", "Information", MessageBoxButtons.OK); } }
public void UpdateSectionRackMapDetails() { try { secRac = new SectionRackMapMaster(); secRac.sr_rac_map_id = Convert.ToInt32(txt_SecRac_ID.Text); secRac.racId = cmbRackName.SelectedIndex + 1; secRac.secId = cmbSectioName.SelectedIndex + 1; secRac.print = Convert.ToInt32(txtPrint.Text); secRac.status = cmbStatus.Text == "Active" ? 1 : 0; secRacBL = new SecRackMapBL(); if (secRacBL.UpdateSecRacMapRecords(secRac) > 0) { MessageBox.Show("Records Are Updated..", "Information", MessageBoxButtons.OK); } else { MessageBox.Show("Records Are Not Updated..", "Information", MessageBoxButtons.OK); } } catch (Exception ex) { string errorMessage = ErrorHandling.Class1.CreateErrorMessage(ex); ErrorHandling.Class1.LogFileWrite(errorMessage); MessageBox.Show("Records Are Not Updated..", "Information", MessageBoxButtons.OK); } }
public int SaveSecRacMapRecordsToDB(SectionRackMapMaster SecRacMap) { try { cmd = new SqlCommand("spInsertSecRacMapDetails", conectn.ActiveCon()); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("Sr_Id", SecRacMap.sr_rac_map_id); cmd.Parameters.AddWithValue("Rack_Id", SecRacMap.racId); cmd.Parameters.AddWithValue("Sec_Id", SecRacMap.secId); cmd.Parameters.AddWithValue("Sr_Print", SecRacMap.print); cmd.Parameters.AddWithValue("Sr_Status", SecRacMap.status); int count = cmd.ExecuteNonQuery(); return(count); } catch (Exception ex) { string errorMessage = ErrorHandling.Class1.CreateErrorMessage(ex); ErrorHandling.Class1.LogFileWrite(errorMessage); return(-1); } finally { conectn.CloseCon(); } }
public int UpdateSecRacMapRecords(SectionRackMapMaster SecRacMap) { try { sectnDA = new SecRackMapDA(); return(sectnDA.UpdateSectionRackMapDetailsToDB(SecRacMap)); } catch (Exception ex) { string errorMessage = ErrorHandling.Class1.CreateErrorMessage(ex); ErrorHandling.Class1.LogFileWrite(errorMessage); return(-1); } }