public bool UpdateRole(RoleMaster role)
        {
            try
            {
                context.Entry(role).Property(x => x.RoleName).IsModified        = true;
                context.Entry(role).Property(x => x.RoleDescription).IsModified = true;
                context.Entry(role).Property(x => x.IsActive).IsModified        = true;
                //context.Entry(role).Property(x => x.Status).IsModified = true;

                int result = context.SaveChanges();
                if (result > 0)
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Exemple #2
0
        public bool UpdateUsers(UserMaster user)
        {
            context.Entry(user).Property(x => x.Email).IsModified     = true;
            context.Entry(user).Property(x => x.MobileNo).IsModified  = true;
            context.Entry(user).Property(x => x.IsActive).IsModified  = true;
            context.Entry(user).Property(x => x.FirstName).IsModified = true;
            context.Entry(user).Property(x => x.LastName).IsModified  = true;
            context.Entry(user).Property(x => x.Password).IsModified  = true;
            context.Entry(user).Property(x => x.Gender).IsModified    = true;

            int result = context.SaveChanges();

            if (result > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }