public int deleteScreenById(int pScreenId) { try { string pquery = "delete from tblScreens where id = @id"; List <SqlParameter> screenParams = new List <SqlParameter>(); screenParams.Add(new SqlParameter("@id", pScreenId)); DALDBHelper.DALDBHelper dBHelper = new DALDBHelper.DALDBHelper(); dBHelper.executeNonQuery(pquery, screenParams); return(1); } catch (Exception ex) { ExceptionsWriter.saveExceptionToLogFile(ex); return(0); } }
public int deleteScreenById(int pScreenId) { try { string pquery = "delete from tblScreens where id = @id"; List <SqlParameter> screenParams = new List <SqlParameter>(); screenParams.Add(new SqlParameter("@id", pScreenId)); DALDBHelper.DALDBHelper dBHelper = new DALDBHelper.DALDBHelper(); dBHelper.executeNonQuery(pquery, screenParams); return(1); } catch (Exception ex) { ExceptionsWriter.saveEventsAndExceptions(ex, "Exceptions not handled", EventLogEntryType.Error); return(0); } }
public BusinessObjects.Models.IssueTicketButton updateIssueTicketButton(BusinessObjects.Models.IssueTicketButton pButton) { try { string pquery = "update tblIssueTicketButton set enName = @enName,ARName = @arName,serviceId = @serviceId where id = @id"; List <SqlParameter> screenParams = new List <SqlParameter>(); screenParams.Add(new SqlParameter("@id", pButton.id)); screenParams.Add(new SqlParameter("@enName", pButton.enName)); screenParams.Add(new SqlParameter("@arName", pButton.arName)); screenParams.Add(new SqlParameter("@serviceId", pButton.serviceId)); DALDBHelper.DALDBHelper dBHelper = new DALDBHelper.DALDBHelper(); dBHelper.executeNonQuery(pquery, screenParams); return(pButton); } catch (Exception ex) { ExceptionsWriter.saveEventsAndExceptions(ex, "Exceptions not handled", EventLogEntryType.Error); return(null); } }
public BusinessObjects.Models.ShowMessageButton updateShowMessageButton(BusinessObjects.Models.ShowMessageButton pButton) { try { string pquery = "update tblShowMessageButton set enName = @enName,arName = @arName,messageAR = @messageAR,messageEN = @messageEN where id = @id"; List <SqlParameter> screenParams = new List <SqlParameter>(); screenParams.Add(new SqlParameter("@id", pButton.id)); screenParams.Add(new SqlParameter("@enName", pButton.enName)); screenParams.Add(new SqlParameter("@arName", pButton.arName)); screenParams.Add(new SqlParameter("@messageEN", pButton.messageEN)); screenParams.Add(new SqlParameter("@messageAR", pButton.messageAR)); DALDBHelper.DALDBHelper dBHelper = new DALDBHelper.DALDBHelper(); dBHelper.executeNonQuery(pquery, screenParams); return(pButton); } catch (Exception ex) { ExceptionsWriter.saveEventsAndExceptions(ex, "Exceptions not handled", EventLogEntryType.Error); return(null); } }
/// <summary> /// This function delete all button from the two tables for the screen by Id /// </summary> /// <param name="pScreenId"></param> /// <returns></returns> public int deleteAllButtonByScreenId(int pScreenId) { try { string pquery = "delete from tblShowMessageButton where screenId = @screenId"; List <SqlParameter> screenParams = new List <SqlParameter>(); screenParams.Add(new SqlParameter("@screenId", pScreenId)); DALDBHelper.DALDBHelper dBHelper = new DALDBHelper.DALDBHelper(); dBHelper.executeNonQuery(pquery, screenParams); pquery = "delete from tblIssueTicketButton where screenId = @screenId"; screenParams = new List <SqlParameter>(); screenParams.Add(new SqlParameter("@screenId", pScreenId)); dBHelper = new DALDBHelper.DALDBHelper(); dBHelper.executeNonQuery(pquery, screenParams); return(1); } catch (Exception ex) { ExceptionsWriter.saveEventsAndExceptions(ex, "Exceptions not handled", EventLogEntryType.Error); return(0); } }
public BusinessObjects.Models.Screen updateScreen(BusinessObjects.Models.Screen pScreen) { try { string pquery = "update tblScreens set name = @name,isActive = @isActive where id = @id"; List <SqlParameter> screenParams = new List <SqlParameter>(); screenParams.Add(new SqlParameter("@name", pScreen.name)); screenParams.Add(new SqlParameter("@isActive", pScreen.isActive)); screenParams.Add(new SqlParameter("@id", pScreen.id)); DALDBHelper.DALDBHelper dBHelper = new DALDBHelper.DALDBHelper(); dBHelper.executeNonQuery(pquery, screenParams); if (pScreen.isActive) { updateActiveScreen(pScreen.id); } return(pScreen); } catch (Exception ex) { ExceptionsWriter.saveExceptionToLogFile(ex); return(null); } }
public int deleteButtonsConditional(IDictionary <int, string> pButtonsIds, string ConditionColumn) { try { foreach (var item in pButtonsIds) { if (Convert.ToInt32(item.Key) != 0) { string pquery = string.Empty; pquery = "delete from tbl" + item.Value.ToString() + "Button where " + ConditionColumn + " = @id"; List <SqlParameter> screenParams = new List <SqlParameter>(); screenParams.Add(new SqlParameter("@id", item.Key)); DALDBHelper.DALDBHelper dBHelper = new DALDBHelper.DALDBHelper(); dBHelper.executeNonQuery(pquery, screenParams); } } return(1); } catch (Exception ex) { ExceptionsWriter.saveEventsAndExceptions(ex, "Exceptions not handled", EventLogEntryType.Error); return(0); } }