Exemplo n.º 1
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="model"></param>
 /// <returns></returns>
 public static bool UTCPostMessage(UTCMessageVM model)
 {
     using (LinksMediaContext _dbContext = new LinksMediaContext())
     {
         StringBuilder traceLog = null;
         try
         {
             traceLog = new StringBuilder();
             traceLog.AppendLine("Start: UTCPostMessage");
             tblUTCPostMessage objUTCPostMessage = new tblUTCPostMessage
             {
                 PostMessage  = model.Message,
                 PostDateTime = model.PostedDate
             };
             _dbContext.UTCPostMessage.Add(objUTCPostMessage);
             _dbContext.SaveChanges();
             return(true);
         }
         finally
         {
             traceLog.AppendLine("End: UTCPostMessage --- " + DateTime.Now.ToLongDateString());
             LogManager.LogManagerInstance.WriteTraceLog(traceLog);
         }
     }
 }
Exemplo n.º 2
0
        /// <summary>
        /// Post UTC Message
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        /// /// <devdoc>
        /// Developer Name - Arvind Kumar
        /// Date - 02/26/2015
        /// </devdoc>
        public IHttpActionResult SaveUTCMessage(UTCMessageVM model)
        {
            StringBuilder          traceLog           = null;
            ServiceResponse <bool> UTCMEssageResponse = null;

            try
            {
                traceLog = new StringBuilder();
                traceLog.AppendLine("Start: ChangePassword");
                bool isPosted = CommonWebApiBL.UTCPostMessage(model);
                UTCMEssageResponse              = new ServiceResponse <bool>();
                UTCMEssageResponse.jsonData     = isPosted;
                UTCMEssageResponse.IsResultTrue = true;
                return(Ok(UTCMEssageResponse));
            }
            catch (Exception ex)
            {
                LogManager.LogManagerInstance.WriteErrorLog(ex);
                UTCMEssageResponse.IsResultTrue = false;
                UTCMEssageResponse.ErrorMessage = Message.ServerError;
                return(Ok(UTCMEssageResponse));
            }
            finally
            {
                traceLog.AppendLine("End :GetMainSearchBarList --- " + DateTime.Now.ToLongDateString());
                LogManager.LogManagerInstance.WriteTraceLog(traceLog);
                traceLog = null;
            }
        }