public void AppLogManager(string source, string type, string errMsg) { WatchListLog log = new WatchListLog(); log.Source = source.ToString(); log.Type = type; log.Description = errMsg.ToString(); log.CreatedDate = DateTime.Now; DbContext.WatchListLogs.Add(log); DbContext.SaveChanges(); }
public int AddWatchListRule(int watchListId, WatchListRule watchListRule) { WatchlistRule newRule = new WatchlistRule() { WatchlistId = watchListId, ColumnId = watchListRule.PropertyId, OperatorId = watchListRule.ComparatorsId, RuleValue = watchListRule.value, PipelineDuns = watchListRule.PipelineDuns, LocationIdentifier = watchListRule.LocationIdentifier, IsCriticalNotice = watchListRule.IsCriticalNotice, AlertSent = watchListRule.AlertSent, AlertFrequency = watchListRule.AlertFrequency, UpperRuleValue = watchListRule.UpperValue }; DbContext.WatchlistRules.Add(newRule); DbContext.SaveChanges(); return(newRule.Id); }
public bool UpdateEngineStatus(String ShipperDuns, bool EngineStatus) { string conString = GetConStringByShipperDuns(ShipperDuns); try { using (UPRDEntities db = new UPRDEntities(conString)) { var settingResult = db.Setting.Where(s => s.Name.ToLower() == "iiteston").FirstOrDefault(); settingResult.Value = EngineStatus.ToString(); db.Entry(settingResult).State = EntityState.Modified; db.SaveChanges(); } return(true); } catch (Exception ex) { } return(false); }