Beispiel #1
0
        public bool InsertUsers(UserMaster user)
        {
            try
            {
                if (user == null)
                {
                    throw new ArgumentNullException(nameof(user));
                }


                DbSet.Add(user);
                int result = context.SaveChanges();
                if (result > 0)
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            catch (System.Exception ex)
            {
                throw ex;
            }
        }
Beispiel #2
0
        public bool AssignRole(RoleRightsMaster usersInRoles)
        {
            context.Add(usersInRoles);
            var result = context.SaveChanges();

            if (result > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
        public void DeleteCategory(int id)
        {
            try
            {
                CategoryMaster category = GetCategoryById(id);

                if (category != null)
                {
                    context.Remove(category);
                    context.SaveChanges();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
 public void InsertRole(RoleMaster role)
 {
     context.Roles.Add(role);
     context.SaveChanges();
 }