Ejemplo n.º 1
0
        internal static String Save(DB.ITM_DIS_Discount entry, DataContext dataContext)
        {
            try
            {
                if (dataContext.EntityInventoryContext.GetEntityState(entry) == EntityState.Detached)
                {
                    dataContext.EntityInventoryContext.ITM_DIS_Discount.Add(entry);
                }

                Validation.ValidateEntity(dataContext.EntityInventoryContext, entry);
            }
            catch (Validation.EntityValidationException ex)
            {
                return(dataContext.PackageValidationException());
            }

            return("Success");
        }
Ejemplo n.º 2
0
 public static DB.ITM_DIS_Discount GetPreviousItem(DB.ITM_DIS_Discount itm_dis_discount, DataContext dataContext)
 {
     return(dataContext.EntityInventoryContext.ITM_DIS_Discount.OrderByDescending(o => o.Id).Where(n => n.Id < itm_dis_discount.Id && n.Id != itm_dis_discount.Id).FirstOrDefault());
 }