Beispiel #1
0
        public ActionResult Create(UserDTOComposite userDTOComposite)
        {
            var user = userDTOComposite.UserDTO;

            if (ModelState.IsValid)
            {
                var userDetail = new UserDetailDTO
                {
                    Logo         = "",
                    Name         = user.UserDetail.Name,
                    CreatedBy    = this.User.Id,
                    ModifiedBy   = this.User.Id,
                    CreatedDate  = DateTime.Now,
                    ModifiedDate = DateTime.Now,
                    IsActive     = true,
                    Version      = 1
                };
                //userDetail = this._IUserDetailService.Create(userDetail);
                user.UserDetail = userDetail;
                //user.UserDetailId = userDetail.Id;
                user.Status    = UserStatusEnum.Available;
                user.Password  = Ingenious.Infrastructure.GlobalMessage.DefaultPasswordFormat.ToMD5String();
                user.CreatedBy = user.ModifiedBy = this.User.Id;

                user = this._IUserService.Create(user);

                return(RedirectToAction("Index"));
            }
            this.DataBind();
            var model = new UserDTOComposite();

            model.DepartmentDTOList = this._IDepartmentService.GetAll();
            model.UserDTO           = user;
            return(View(model));
        }
Beispiel #2
0
        public ActionResult Edit(Guid id)
        {
            var model = new UserDTOComposite();

            model.DepartmentDTOList = this._IDepartmentService.GetAll();
            model.UserDTO           = this._IUserService.GetByKey(id);
            return(View(model));
        }
Beispiel #3
0
        public ActionResult Create()
        {
            var model = new UserDTOComposite();

            model.DepartmentDTOList = this._IDepartmentService.GetAll();

            return(View(model));
        }
Beispiel #4
0
        public ActionResult Edit(UserDTOComposite userDTOComposite)
        {
            var user = userDTOComposite.UserDTO;

            if (ModelState.IsValid)
            {
                this._IUserService.Update(new UserDTOList {
                    user
                });

                return(RedirectToAction("Index"));
            }
            this.DataBind();
            var model = new UserDTOComposite();

            model.DepartmentDTOList = this._IDepartmentService.GetAll();
            model.UserDTO           = user;
            return(View(model));
        }