private void Delete() { if (!base.ValidateIfCommandAllowed(Request.Url.AbsoluteUri, ENums.PageCommand.Delete)) { return; } if (ValidateValues() == false) { return; } bool bActionCompleted = false; int Id = 0; int.TryParse(hfId.Value, out Id); if (Id == 0) { lblStatus.Text = "Please click on edit button again."; return; } TransportDTO oTransportData = new TransportDTO(); oTransportData.TransportId = Id; TransportMaster oTransportMaster = new TransportMaster(); /* * ADDED BY VIJAY * CHECK IF THE Transport WHICH IS TO BE DELETED HAS ANY ASSOCIATED RECORDS...IF YES, MOVE OUT OF THE FUNCTION ELSE PROCEED * IF THE OUTPUT OF sMessage IS "", THEN RECORD CAN BE DELETED, ELSE NOT * */ string sMessage = ""; GF.HasRecords(Convert.ToString(Id), "Transport", out sMessage); if (sMessage != "") { base.DisplayAlert(sMessage); btnDelete.Enabled = true; } else { bActionCompleted = oTransportMaster.Delete(oTransportData); if (bActionCompleted == true) { sMessage = "The record has been deleted successfully"; base.DisplayAlert(sMessage); txtTransport.Text = ""; //lblStatus.Text = "Deleted"; RefreshGrid(); } else { sMessage = "Error Occured while deletion: Please refer to the error log."; base.DisplayAlert(sMessage); } } oTransportData = null; oTransportMaster = null; }
private void Delete() { if (!base.ValidateIfCommandAllowed(Request.Url.AbsoluteUri, ENums.PageCommand.Delete)) { return; } if (ValidateValues() == false) { return; } bool bActionCompleted = false; int Id = 0; int.TryParse(hfId.Value, out Id); if (Id == 0) { lblStatus.Text = "Please click on edit button again."; return; } RoomTypeDTO oRoomTypeData = new RoomTypeDTO(); //oRoomTypeData.RoomTypeId = Convert.ToInt32(SessionHandler"RoomTypeId"]); oRoomTypeData.RoomTypeId = Id; RoomTypeMaster oRoomTypeMaster = new RoomTypeMaster(); /* * ADDED BY VIJAY * CHECK IF THE ROOM TYPE WHICH IS TO BE DELETED HAS ANY ASSOCIATED RECORDS...IF YES, MOVE OUT OF THE FUNCTION ELSE PROCEED * IF THE OUTPUT OF sMessage IS "", THEN RECORD CAN BE DELETED, ELSE NOT * */ string sMessage = ""; GF.HasRecords(Convert.ToString(Id), "roomtype", out sMessage); if (sMessage != "") { base.DisplayAlert(sMessage); btnDelete.Enabled = true; } else { bActionCompleted = oRoomTypeMaster.Delete(oRoomTypeData); if (bActionCompleted == true) { base.DisplayAlert("The record has been deleted successfully."); txtRoomType.Text = ""; ddlDefaultNoOfBeds.SelectedIndex = 0; lblStatus.Text = "Deleted"; RefreshGrid(); } else { base.DisplayAlert("Error Occured while deletion: Please refer to the error log."); } } oRoomTypeData = null; oRoomTypeMaster = null; }
private void Delete() { if (ValidateValues() == false) { return; } if (!base.ValidateIfCommandAllowed(Request.Url.AbsoluteUri, ENums.PageCommand.Delete)) { return; } bool bActionCompleted = false; string id = string.Empty; id = hfId.Value; if (string.IsNullOrEmpty(id)) { lblStatus.Text = "Please click on edit button again."; return; } UserMaster oUserMaster = new UserMaster(); UserDTO oUserData = new UserDTO(); oUserData.UserId = id; /* * * CHECK IF THE User WHICH IS TO BE DELETED HAS ANY ASSOCIATED RECORDS...IF YES, MOVE OUT OF THE FUNCTION ELSE PROCEED * IF THE OUTPUT OF sMessage IS "", THEN RECORD CAN BE DELETED, ELSE NOT * */ string sMessage = ""; GF.HasRecords(Convert.ToString(id), "User", out sMessage); if (sMessage != "") { base.DisplayAlert(sMessage); btnDelete.Enabled = true; } else { bActionCompleted = oUserMaster.Delete(oUserData); if (bActionCompleted == true) { base.DisplayAlert("The record has been deleted successfully"); ClearControls(); hfId.Value = string.Empty; } else { base.DisplayAlert("Error Occured while deletion: Please refer to the error log."); } //lblStatus.Text = "Error Occured while deletion: Please refer to the error log."; } RefreshGrid(); oUserData = null; oUserMaster = null; }
private void Delete() { int Id = 0; bool bActionCompleted; if (!base.ValidateIfCommandAllowed(Request.Url.AbsoluteUri, ENums.PageCommand.Delete)) { return; } int.TryParse(hfId.Value, out Id); if (Id == 0) { lblStatus.Text = "Please click on edit again."; return; } if (txtSMTPServer.Text.Trim() == "") { lblStatus.Text = "Please enter the SMTP server."; return; } SMTPMaster oSMTPMaster = new SMTPMaster(); SMTPDTO oSMTPData = MapControlsToObject(); /* * * CHECK IF THE MailDetails WHICH IS TO BE DELETED HAS ANY ASSOCIATED RECORDS...IF YES, MOVE OUT OF THE FUNCTION ELSE PROCEED * IF THE OUTPUT OF sMessage IS "", THEN RECORD CAN BE DELETED, ELSE NOT * */ string sMessage = ""; GF.HasRecords(Convert.ToString(Id), "MailDetails", out sMessage); if (sMessage != "") { base.DisplayAlert(sMessage); btnDelete.Enabled = true; } else { bActionCompleted = oSMTPMaster.Delete(oSMTPData); if (bActionCompleted == true) { ClearPageControls(); RefreshGrid(); oSMTPData = null; oSMTPMaster = null; //lblStatus.Text = "Deleted"; base.DisplayAlert("The record has been deleted successfully."); } else { base.DisplayAlert("Error Occured while deletion: Please refer to the error log."); } //lblStatus.Text = "Error Occured while deletion: Please refer to the error log."; } }
private void Delete() { if (!base.ValidateIfCommandAllowed(Request.Url.AbsoluteUri, ENums.PageCommand.Delete)) { return; } int Id = 0; int.TryParse(hfId.Value, out Id); if (Id == 0) { lblStatus.Text = "Please click on edit again."; return; } if (txtAccomType.Text.Trim() == "") { lblStatus.Text = "Please enter the Accomodation Type."; return; } AccomTypeDTO oAccomTypeData = MapControlsToObject(); AccomodationTypeMaster oAccomTypeMaster = new AccomodationTypeMaster(); /* * * CHECK IF THE ACCOMODATION TYPE WHICH IS TO BE DELETED HAS ANY ASSOCIATED RECORDS...IF YES, MOVE OUT OF THE FUNCTION ELSE PROCEED * IF THE OUTPUT OF sMessage IS "", THEN RECORD CAN BE DELETED, ELSE NOT * */ string sMessage = ""; GF.HasRecords(Convert.ToString(Id), "accomodationtype", out sMessage); if (sMessage != "") { base.DisplayAlert(sMessage); btnDelete.Enabled = true; } else { bool bActionCompleted = oAccomTypeMaster.Delete(oAccomTypeData); if (bActionCompleted == true) { base.DisplayAlert("The record has been deleted successfully"); txtAccomType.Text = ""; //lblStatus.Text = "Deleted"; } else { base.DisplayAlert("Error Occured while deletion: Please refer to the error log."); } } oAccomTypeData = null; oAccomTypeMaster = null; }
private void Delete() { if (!base.ValidateIfCommandAllowed(Request.Url.AbsoluteUri, ENums.PageCommand.Delete)) { return; } bool bActionCompleted; string sMessage = ""; AccomodationSeasonDTO accomodationSeason = MapControlsToObject(); AccomodationMaster oAccomMaster = new AccomodationMaster(); int Id = 0; int.TryParse(hfId.Value, out Id); if (Id == 0) { lblStatus.Text = "Please click on edit again."; return; } GF.HasRecords(Convert.ToString(Id), "accomodation", out sMessage); if (sMessage != "") { base.DisplayAlert(sMessage); btnDelete.Enabled = true; } else { bActionCompleted = oAccomMaster.DeleteAccomodationSeason(accomodationSeason); if (bActionCompleted == true) { base.DisplayAlert("The record has been deleted successfully."); ClearControls(); } else { base.DisplayAlert("Error Occured while deletion: Please refer to the error log."); } } oAccomMaster = null; accomodationSeason = null; }