예제 #1
0
        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");
        }
예제 #2
0
 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());
 }