internal static String Save(DB.RPT_Report entry, DataContext dataContext) { try { if (dataContext.EntityReportContext.GetEntityState(entry) == EntityState.Detached) { dataContext.EntityReportContext.RPT_Report.Add(entry); } Validation.ValidateEntity(dataContext.EntityReportContext, entry); } catch (Validation.EntityValidationException ex) { return(dataContext.PackageValidationException()); } return("Success"); }
public static DB.RPT_Report GetPreviousItem(DB.RPT_Report rpt_analytic, DataContext dataContext) { return(dataContext.EntityReportContext.RPT_Report.OrderByDescending(o => o.Name).Where(n => n.Name.CompareTo(rpt_analytic.Name) < 0 && n.Name.CompareTo(rpt_analytic.Name) != 0).FirstOrDefault()); }