Beispiel #1
0
        public ActionResult UserCar(VIEW_FW_USER user)
        {
            var currUser = VIEW_FW_USER.ToEntity(user);

            bool status = false;

            try
            {
                //UserInfoManager.Add(currUser);
                status = true;
            }
            catch (Exception e)
            {
                return(this.JsonFormat(status, status, SysOperate.Add));
            }
            return(this.JsonFormat(status, status, SysOperate.Add));
        }
Beispiel #2
0
        public ActionResult Detail(string id)
        {
            ViewDetailPage page = new ViewDetailPage(HttpContext);

            ViewBag.TreeNodeID = UserInfoManager.Get(u => u.USER_ID == OperateContext.Current.UsrId).TREENODE_ID;
            ViewBag.IsView     = page.IsView;
            ViewBag.CurrentID  = id;
            ViewBag.TYPE       = "Update";
            ViewBag.ReturnUrl  = Request["returnurl"];
            var model = UserInfoManager.Get(u => u.USER_ID == id);

            if (model == null)
            {
                ViewBag.TYPE = "Add";
                return(View(new VIEW_FW_USER()
                {
                    TREENODE_ID = ViewBag.TreeNodeID
                }));
            }
            return(View(VIEW_FW_USER.ToViewModel(model)));
        }
Beispiel #3
0
        public ActionResult Add(VIEW_FW_USER user)
        {
            var currUser = VIEW_FW_USER.ToEntity(user);

            bool status = false;

            try
            {
                currUser.CREATE_BY = OperateContext.Current.UsrId;
                currUser.CREATE_DT = DateTime.Now;
                currUser.PASSWD    = Common.MD5Provider.Hash(user.PASSWD);
                currUser.ACTIVE    = "Y";
                UserInfoManager.Add(currUser);
                status = true;
            }
            catch (Exception e)
            {
                return(this.JsonFormat(status, status, SysOperate.Add));
            }
            return(this.JsonFormat("/Admin/User/UserInfo", status, SysOperate.Add.ToMessage(status), status));
        }
Beispiel #4
0
        public ActionResult Update(VIEW_FW_USER user)
        {
            var  model  = VIEW_FW_USER.ToEntity(user);
            bool status = false;

            if (!ModelState.IsValid)
            {
                return(this.JsonFormat(ModelState, status, "ERROR"));
            }
            try
            {
                model.PASSWD          = Common.MD5Provider.Hash(user.PASSWD);
                model.LAST_UPDATED_DT = DateTime.Now;
                model.MODIFY_DT       = DateTime.Now;
                model.MODIFY_BY       = OperateContext.Current.UsrId;
                UserInfoManager.Modify(model, "USER_NAME", "EMAIL", "ENG_NAME", "PHONE", "LAST_UPDATED_DT", "MODIFY_BY", "MODIFY_DT", "PASSWD");
                status = true;
            }
            catch (Exception e)
            {
                return(this.JsonFormat(status, status, SysOperate.Update));
            }
            return(this.JsonFormat("/Admin/User/UserInfo", status, SysOperate.Update.ToMessage(status), status));
        }