Example #1
0
 public void Insert(ErrorLogs obj)
 {
     using (NuevoDBConnStr myContext = new NuevoDBConnStr())
     {
         myContext.Entry(obj).State = EntityState.Added;
         myContext.SaveChanges();
     }
 }
Example #2
0
 public void Update(UserLogin obj)
 {
     try
     {
         using (NuevoDBConnStr myContext = new NuevoDBConnStr())
         {
             myContext.Entry(obj).State = EntityState.Modified;
             myContext.SaveChanges();
         }
     }
     catch (Exception ex)
     {
     }
 }
Example #3
0
 public void Insert(EmailSettings obj)
 {
     try
     {
         using (NuevoDBConnStr myContext = new NuevoDBConnStr())
         {
             myContext.Entry(obj).State = EntityState.Added;
             myContext.SaveChanges();
         }
     }
     catch (Exception ex)
     {
     }
 }
Example #4
0
 public void DeleteByID(int ID)
 {
     try
     {
         UserLogin ul = new UserLogin {
             ID = ID
         };
         using (NuevoDBConnStr myContext = new NuevoDBConnStr())
         {
             myContext.Entry(ul).State = EntityState.Deleted;
             myContext.SaveChanges();
         }
     }
     catch (Exception ex)
     {
     }
 }
Example #5
0
        public UserLogin GetLogin(string UserName, string UserPassword)
        {
            UserLogin _UserLogin = new UserLogin();

            try
            {
                using (NuevoDBConnStr myContext = new NuevoDBConnStr())
                {
                    myContext.Configuration.ProxyCreationEnabled  = false;
                    myContext.Configuration.LazyLoadingEnabled    = false;
                    myContext.Configuration.ValidateOnSaveEnabled = false;
                    myContext.Database.CommandTimeout             = 360;
                    _UserLogin = myContext.UserLogin.Where(p => p.UserName == UserName && p.UserPassword == UserPassword).FirstOrDefault();
                }
            }
            catch (Exception ex)
            {
            }
            return(_UserLogin);
        }
Example #6
0
        public List <UserLogin> GetAll()
        {
            List <UserLogin> _UserLogin = new List <UserLogin>();

            try
            {
                using (NuevoDBConnStr myContext = new NuevoDBConnStr())
                {
                    myContext.Configuration.ProxyCreationEnabled  = false;
                    myContext.Configuration.LazyLoadingEnabled    = false;
                    myContext.Configuration.ValidateOnSaveEnabled = false;
                    myContext.Database.CommandTimeout             = 360;
                    _UserLogin = myContext.UserLogin.ToList();
                }
            }
            catch (Exception ex)
            {
            }
            return(_UserLogin);
        }
Example #7
0
        public List <EmailSettings> GetAll()
        {
            List <EmailSettings> _EmailSettings = new List <EmailSettings>();

            try
            {
                using (NuevoDBConnStr myContext = new NuevoDBConnStr())
                {
                    myContext.Configuration.ProxyCreationEnabled  = false;
                    myContext.Configuration.LazyLoadingEnabled    = false;
                    myContext.Configuration.ValidateOnSaveEnabled = false;
                    myContext.Database.CommandTimeout             = 360;
                    _EmailSettings = myContext.EmailSettings.ToList();
                }
            }
            catch (Exception ex)
            {
            }
            return(_EmailSettings);
        }