Ejemplo n.º 1
0
        public OfficeTypeDTO InsertOfficeType(OfficeTypeDTO data)
        {
            OfficeType dataToInsert = new OfficeType();

            dataToInsert = OfficeTypeRequestFormatter.ConvertRespondentInfoFromDTO(data);
            return(OfficeTypeRequestFormatter.ConvertRespondentInfoToDTO(_unitOfWork.OfficeTypeRepository.Create(dataToInsert)));
        }
Ejemplo n.º 2
0
        public int UpdateOfficeType(OfficeTypeDTO data)
        {
            OfficeType dataToUpdate = new OfficeType();

            dataToUpdate = OfficeTypeRequestFormatter.ConvertRespondentInfoFromDTO(data);
            var response = _unitOfWork.OfficeTypeRepository.Update(dataToUpdate);

            return(response);
        }
Ejemplo n.º 3
0
 public ActionResult OfficeCreateClose(OfficeTypeDTO data)
 {
     try
     {
         if (!ModelState.IsValid)
         {
             return(RedirectToAction("OfficeTypes"));
         }
         OfficeTypeDTO res = new OfficeTypeDTO();
         res             = _officeTypeService.InsertOfficeType(data);
         ViewBag.Success = "New Office Type created successfully";
         return(RedirectToAction("OfficeTypes"));
     }
     catch (Exception ex)
     {
         ViewBag.Error = ex.Message;
         return(RedirectToAction("OfficeTypes"));
     }
 }
 public static OfficeType ConvertRespondentInfoFromDTO(OfficeTypeDTO officeTypeDTO)
 {
     Mapper.CreateMap <OfficeTypeDTO, OfficeType>();
     return(Mapper.Map <OfficeTypeDTO, OfficeType>(officeTypeDTO));
 }
Ejemplo n.º 5
0
        public ActionResult OfficeTypeEdit(OfficeTypeDTO data)
        {
            int res = _officeTypeService.UpdateOfficeType(data);

            return(RedirectToAction("OfficeTypeEdit", data.OfficeTypeId));
        }
Ejemplo n.º 6
0
        public ActionResult OfficeTypeEdit(int id)
        {
            OfficeTypeDTO res = _officeTypeService.GetOfficeTypeById(id);

            return(View(res));
        }