コード例 #1
0
        public ActionResult AddStaff()
        {
            AddStaffModel Model = new AddStaffModel()
            {
                CreateAccount = true
            };

            return(View(Model));
        }
コード例 #2
0
 public ActionResult AddStaff(AddStaffModel Model)
 {
     if (ModelState.IsValid)
     {
         Staff staff = new Staff()
         {
             Fullname = Model.Name, Email = Model.Email, Phone = Model.Phone, IsActive = true
         };
         if (Model.CreateAccount)
         {
             staff.User = AccBO.CreateUser(staff.Fullname);
         }
         StaffBO.Insert(staff);
         return(RedirectToAction("StaffAccountList"));
     }
     return(View(Model));
 }
コード例 #3
0
ファイル: StaffController.cs プロジェクト: yuyu2you/proj
        public int AddStaff(AddStaffModel body)
        {
            var model = _mapper.Map <AddStaffModel, Staff>(body);

            return(_staffService.Insert(model));
        }