示例#1
0
        public bool SaveError(ErrItemPoco eo)
        {
            try
            {
                var dbItem = ConvertPocoToDb(eo);

                var repo = new ErrorItemsRepo(new WutNuContext());
                if (eo.Id > 0)
                {
                    repo.UpdateErrorItem(dbItem);
                }
                else
                {
                    repo.InsertErrorItem(dbItem);
                }
                return(true);
            }
            catch (Exception ex)
            {
                Logging.WriteToAppLog("Error saving SiteError object to DB: " + ex.Message, EventLogEntryType.Error);
                return(false);
            }
        }
示例#2
0
 public bool SaveError(ErrItemPoco eo)
 {
     return(_mgr.SaveError(eo));
 }
示例#3
0
 private ErrorLog ConvertPocoToDb(ErrItemPoco item)
 {
     return(JsonConvert.DeserializeObject <ErrorLog>(JsonConvert.SerializeObject(item)));
 }