Esempio n. 1
0
        public bool AddSmartOfficerNews(SmartOfficerNewsDTO news)
        {
            try
            {
                if (news == null)
                {
                    return(false);
                }

                var officerNews = new SmartOfficerNew
                {
                    OfficerNewsText      = news.OfficerNewsText,
                    OfficerNewsImage     = news.OfficerNewsImage,
                    OfficerNewsCreatedBy = news.OfficerNewsCreatedBy,
                    OfficerNewsDate      = news.OfficerNewsDate,
                    IsNoticed            = false
                };

                officerNews = operationalDataContext.SmartOfficerNews.Add(officerNews);

                return(operationalDataContext.SaveChanges() > 0);
            }
            catch (Exception ex)
            {
                Utility.WriteLog(ex);

                return(false);
            }
        }
 public bool AddSmartOfficerNews(SmartOfficerNewsDTO news)
 {
     try
     {
         return(new SmartOfficerNewsDAL().AddSmartOfficerNews(news));
     }
     catch (Exception ex)
     {
         Utility.WriteErrorLog(ex);
         return(false);
     }
 }