Пример #1
0
        public int CreateRole(RolesBLL role)
        {
            int ProposedReturnValue = -1;

            ProposedReturnValue = _context.CreateRole(role.RoleName);
            return(ProposedReturnValue);
        }
Пример #2
0
        public RolesBLL FindRoleByID(int RoleID)
        {
            RolesBLL ProposedReturnValue = null;
            RolesDAL DataLayerObject     = _context.FindRoleByID(RoleID);

            if (null != DataLayerObject)
            {
                ProposedReturnValue = new RolesBLL(DataLayerObject);
            }
            return(ProposedReturnValue);
        }
Пример #3
0
        public List <RolesBLL> GetRoles(int skip, int take)
        {
            List <RolesBLL> ProposedReturnValue    = new List <RolesBLL>();
            List <RolesDAL> ListOfDataLayerObjects = _context.GetRoles(skip, take);

            foreach (RolesDAL role in ListOfDataLayerObjects)
            {
                RolesBLL BusinessObject = new RolesBLL(role);
                ProposedReturnValue.Add(BusinessObject);
            }
            return(ProposedReturnValue);
        }
        public ActionResult Create(RavenBLL.RolesBLL collection)
        {
            if (!ModelState.IsValid)
            {
                return(View(collection));
            }
            try
            {
                // TODO: Add insert logic here
                using (ContextBLL ctx = new ContextBLL())
                {
                    ctx.CreateRole(collection);
                }

                return(RedirectToAction("Index"));
            }
            catch (Exception Ex)
            {
                ViewBag.Exception = Ex;
                return(View("Error"));
            }
        }
        public ActionResult Delete(int id, RavenBLL.RolesBLL collection)
        {
            try
            {
                //if (!ModelState.IsValid)
                //{
                //    return View(collection);
                //}
                // TODO: Add insert logic here
                using (ContextBLL ctx = new ContextBLL())
                {
                    ctx.DeleteRole(id);
                }

                return(RedirectToAction("Index"));
            }
            catch (Exception Ex)
            {
                ViewBag.Exception = Ex;
                return(View("Error"));
            }
        }
Пример #6
0
 public void DeleteRole(RolesBLL Role)
 {
     _context.DeleteRole(Role.RoleID);
 }
Пример #7
0
 public void JustUpdateRole(RolesBLL Role)
 {
     _context.JustUpdateRole(Role.RoleID, Role.RoleName);
 }