예제 #1
0
        public List <UsersBLL> GetUsers(int skip, int take)
        {
            List <UsersBLL> ProposedReturnValue    = new List <UsersBLL>();
            List <UsersDAL> ListOfDataLayerObjects = _context.GetUsers(skip, take);

            //This is looping over all of the DAL objects
            foreach (UsersDAL Users in ListOfDataLayerObjects)
            {
                UsersBLL BusinessObject = new UsersBLL(Users);
                ProposedReturnValue.Add(BusinessObject);
                //Converting them one at a time into BLL objects and adding them
                //To the BLL List
            }
            return(ProposedReturnValue);
        }
 public ActionResult Edit(int id, RavenBLL.UsersBLL collection)
 {
     try
     {
         if (!ModelState.IsValid)
         {
             ViewBag.Roles = GetRoleItems();
             return(View(collection));
         }
         using (ContextBLL ctx = new ContextBLL())
         {
             ctx.JustUpdateUser(collection);
         }
         return(RedirectToAction("Index"));
     }
     catch (Exception Ex)
     {
         ViewBag.Exception = Ex;
         return(View("Error"));
     }
 }
        public ActionResult Delete(int id, RavenBLL.UsersBLL collection)
        {
            try
            {
                //if(!ModelState.IsValid)
                //{
                //    return View(collection);
                //}

                using (ContextBLL ctx = new ContextBLL())
                {
                    ctx.DeleteUser(id);
                }

                return(RedirectToAction("Index"));
            }
            catch (Exception Ex)
            {
                ViewBag.Exception = Ex;
                return(View("Error"));
            }
        }
예제 #4
0
 public void DeleteUser(UsersBLL Users)
 {
     _context.DeleteUser(Users.UserID);
 }
예제 #5
0
 public void JustUpdateUser(UsersBLL Users)
 {
     _context.JustUpdateUser(Users.UserID, Users.Email, Users.UserName, Users.Hash, Users.Salt, Users.RoleID);
 }