Beispiel #1
0
        public ActionResult AddStaff()
        {
            AddStaffModel Model = new AddStaffModel()
            {
                CreateAccount = true
            };

            return(View(Model));
        }
Beispiel #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));
 }
Beispiel #3
0
        public int AddStaff(AddStaffModel body)
        {
            var model = _mapper.Map <AddStaffModel, Staff>(body);

            return(_staffService.Insert(model));
        }