/// <summary> /// IF (screenName != null && screenName.Length > 0) Function to get the list of all SystemMessages ELSE Function to get the list of all SystemMessages /// </summary> /// <param name="screenName"></param> /// <returns></returns> public Response <disMessages> Get(string screenName = "") { try { if (screenName != null && screenName.Length > 0) { return new Response <disMessages> { Status = true, DataList = BAL_SysMessages.GetSysMessagesTemplates(screenName) ?? new List <disMessages>() } } ; else { return new Response <disMessages> { Status = true, DataList = BAL_SysMessages.GetAllSystemMessages((HttpContext.Current.Session[SessionNames.UserID] != null && Convert.ToInt32(HttpContext.Current.Session[SessionNames.UserID]) > 0) ? Convert.ToInt32(HttpContext.Current.Session[SessionNames.UserID]) : 0) ?? new List <disMessages>() } }; } catch (Exception ex) { return(new Response <disMessages> { Status = false, MessageType = MessageTypes.Exception, Message = ex.Message, SystemMessages = lstMsgs[0] }); } }
List <disMessages> GetMessages() { if (lstMsgs == null || lstMsgs.Count() == 0) { return(BAL_SysMessages.GetSysMessagesTemplates("SystemMessages")); } else { return(lstMsgs); } }
public Response <ChooseColumns> Post(ChooseColumns value) { try { value.ColUserId = (HttpContext.Current.Session[SessionNames.UserID] != null && Convert.ToInt32(HttpContext.Current.Session[SessionNames.UserID]) > 0) ? Convert.ToInt32(HttpContext.Current.Session[SessionNames.UserID]) : 0; var res = BAL_ChooseColumns.SaveChoosedColumns(value); List <disMessages> objmsg = BAL_SysMessages.GetSysMessagesTemplates(value.ColPageName); if (res > 0) { return new Response <ChooseColumns> { Status = true, MessageType = MessageTypes.Success, Message = DisplayMessages.SaveChooseColumns_Success, SystemMessages = objmsg[1] } } ; else { return new Response <ChooseColumns> { Status = false, MessageType = MessageTypes.Failure, Message = DisplayMessages.SaveChooseColumns_Failure, SystemMessages = objmsg[0] } }; } catch (SqlException ex) { if (ex.Errors.Count > 0) { switch (ex.Errors[0].Number) { case 2601: // Primary key violation return(new Response <ChooseColumns> { Status = false, MessageType = MessageTypes.Duplicate, Message = DisplayMessages.SaveChooseColumns_Duplicate }); default: return(new Response <ChooseColumns> { Status = false, MessageType = MessageTypes.Exception, Message = ex.Message }); } } else { return new Response <ChooseColumns> { Status = false, MessageType = MessageTypes.Exception, Message = ex.Message } }; } catch (Exception ex) { return(new Response <ChooseColumns> { Status = false, MessageType = MessageTypes.Exception, Message = ex.Message }); } }