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

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

            return("Success");
        }
Ejemplo n.º 2
0
        //public static DB.GLX_Recon GetNextItem(DB.GLX_Recon glx_recon, DataContext dataContext)
        //{
        //    return dataContext.EntitySystemContext.SYS_Recon.OrderBy(o => o.StartDate).Where(n => n.StartDate > glx_recon.StartDate && n.StartDate != glx_recon.StartDate).FirstOrDefault();
        //}

        //public static DB.GLX_Recon GetPreviousItem(DB.GLX_Recon glx_recon, DataContext dataContext)
        //{
        //    return dataContext.EntitySystemContext.SYS_Recon.OrderByDescending(o => o.StartDate).Where(n => n.StartDate > glx_recon.StartDate && n.StartDate != glx_recon.StartDate).FirstOrDefault();
        //}

        public static void RejectRecon(DB.GLX_Recon glx_recon, DataContext dataContext)
        {
            glx_recon.StatusId = (byte)SYS.SYS_Status.Rejected;
            dataContext.EntityAccountingContext.ExecuteSqlCommand(string.Format("UPDATE [CDS_GLX].[GLX_Line] set ReconId = null WHERE ReconId = {0}", glx_recon.Id));
        }