コード例 #1
0
        public ActionResult UpdateUser(ResponseAdminUserList item1, RequestAdminUser item2, ResponseAdminUserDetail item3, ResponseAdminUser item4)
        {
            if (ModelState.IsValid)
            {
                LogicAdminUser    adm      = new LogicAdminUser();
                ResponseAdminUser response = new ResponseAdminUser();

                item2.flag         = 'M';
                item2.dateUpdate   = DateTime.Now;
                item2.userUpdate   = Session["user"].ToString();
                item2.userRegister = "";
                response           = adm.setUser(item2);

                if (response.code == 50000)
                {
                    Session.Add("msgOk", response.message);
                }
                else
                {
                    Session.Add("msgEr", response.message);
                }
            }

            return(RedirectToAction("User"));
        }
コード例 #2
0
        public ActionResult addUser(ResponseAdminUserList item1, RequestAdminUser item2, ResponseAdminUserDetail item3, ResponseAdminUser item4)
        {
            // Método para agregar Rol
            if (ModelState.IsValid)
            {
                LogicAdminUser adm = new LogicAdminUser();

                item2.id           = 0;
                item2.stateRecord  = true;
                item2.flag         = 'N';
                item2.dateRegister = DateTime.Now;
                item2.userRegister = Session["user"].ToString();
                item2.dateUpdate   = DateTime.Now;
                item2.userUpdate   = Session["user"].ToString();
                item2.profession   = 9; // Profesión genérica
                item4 = adm.setUser(item2);

                if (item4.code == 50000)
                {
                    Session.Add("msgOk", item4.message);
                }
                else
                {
                    Session.Add("msgEr", item4.message);
                }
            }

            Tuple <ResponseAdminUserList, RequestAdminUser, ResponseAdminUserDetail, ResponseAdminUser> response =
                new Tuple <ResponseAdminUserList, RequestAdminUser, ResponseAdminUserDetail, ResponseAdminUser>(item1, item2, item3, item4);

            return(RedirectToAction("User"));
        }