Esempio n. 1
0
        public ActionResult <AttentionStaffViewModel> Post(AttentionStaffInputModel staffModel)
        {
            UserAttentionStaff attentionStaff = MapAttentionStaff(staffModel);
            var response = _staffService.Save(attentionStaff);

            if (response.Error)
            {
                return(BadRequest(response.Message));
            }
            return(Ok(response.Object));
        }
Esempio n. 2
0
        private UserAttentionStaff MapAttentionStaff(AttentionStaffInputModel staffModel)
        {
            UserAttentionStaff attentionStaff = new UserAttentionStaff();

            attentionStaff.UserAttentionStaffId = staffModel.AttentionId;
            attentionStaff.Name          = staffModel.Name;
            attentionStaff.LastName      = staffModel.LastName;
            attentionStaff.Type          = staffModel.Type;
            attentionStaff.Photo         = staffModel.Photo;
            attentionStaff.ServiceStatus = staffModel.ServiceStatus;
            attentionStaff.User          = MapUser(staffModel.User);

            return(attentionStaff);
        }
Esempio n. 3
0
        public ActionResult <AttentionStaffViewModel> Modify(AttentionStaffInputModel staffModel)
        {
            UserAttentionStaff attentionStaff = MapAttentionStaff(staffModel);

            var response = _staffService.Update(attentionStaff);

            if (response.Error == false)
            {
                return(Ok(response.Object));
            }
            else
            {
                return(BadRequest(response.Message));
            }
        }