Пример #1
0
 public void EditTimer(TimerSetting timerSetting)
 {
     try
     {
         timerSetting.CreatedOn       = DateTime.Now;
         timerSetting.ModifiedOn      = DateTime.Now;
         db.Entry(timerSetting).State = EntityState.Modified;
         db.SaveChanges();
     }
     catch (Exception ex)
     {
         MethodBase site = MethodBase.GetCurrentMethod();
         string     url  = HttpContext.Current.Request.Url.AbsoluteUri;// request.Url.AbsoluteUri;
         _ExceptionLogsRepositeryObject.InsertException(ex, url, site.Name);
     }
 }
Пример #2
0
        public TimerSetting GetTimerById(int?id)
        {
            TimerSetting timerSetting = new TimerSetting();

            try
            {
                timerSetting = db.TimerSetting.Find(id);
                db.SaveChanges();
            }
            catch (Exception ex)
            {
                MethodBase site = MethodBase.GetCurrentMethod();
                string     url  = HttpContext.Current.Request.Url.AbsoluteUri;// request.Url.AbsoluteUri;
                _ExceptionLogsRepositeryObject.InsertException(ex, url, site.Name);
            }
            return(timerSetting);
        }
Пример #3
0
 public void UpdateTimerSetting(TimerSetting timerSetting)
 {
     try
     {
         TimerSetting temp = new TimerSetting();
         temp           = db.TimerSetting.SingleOrDefault(x => x.Id == timerSetting.Id);
         temp.StartTime = timerSetting.StartTime;
         temp.EndTime   = timerSetting.EndTime;
         db.SaveChanges();
     }
     catch (Exception ex)
     {
         MethodBase site = MethodBase.GetCurrentMethod();
         string     url  = HttpContext.Current.Request.Url.AbsoluteUri;// request.Url.AbsoluteUri;
         _ExceptionLogsRepositeryObject.InsertException(ex, url, site.Name);
     }
 }