Пример #1
0
 public static BusinessGroup ConvertRespondentInfoFromDTO(BusinessGroupDTO bgDTO)
 {
     Mapper.CreateMap <BusinessGroupDTO, BusinessGroup>().ConvertUsing(
         m =>
     {
         return(new BusinessGroup
         {
             BgId = m.BgId,
             BgName = m.BgName
         });
     });
     return(Mapper.Map <BusinessGroupDTO, BusinessGroup>(bgDTO));
 }
 public ActionResult BusinessGroupCreate(BusinessGroupDTO data)
 {
     try
     {
         BusinessGroupDTO resbgDTO = new BusinessGroupDTO();
         resbgDTO        = _bgService.InsertDepartment(data);
         ViewBag.success = String.Format("The Business Group with name {0} has been inserted.", resbgDTO.BgName);
         ModelState.Clear();
         return(View());
     }
     catch (Exception Ex)
     {
         ViewBag.error = Ex.Message;
         return(View());
     }
 }
        public RedirectResult BusinessGroupEdit(BusinessGroupDTO data)
        {
            int businessgroup = _bgService.UpdateBusinessGroup(data);

            return(Redirect("/businessgroup/edit/" + data.BgId));
        }
        public ActionResult BusinessGroupEdit(int bgID)
        {
            BusinessGroupDTO businessgroup = _bgService.GetBusinessGroupById(bgID);

            return(View(businessgroup));
        }
Пример #5
0
        public BusinessGroupDTO InsertDepartment(BusinessGroupDTO data)
        {
            BusinessGroup businessGroup = BusinessGroupRequestFormatter.ConvertRespondentInfoFromDTO(data);

            return(BusinessGroupRequestFormatter.ConvertRespondentInfoToDTO(_unitOfWork.BusinessGroupRepository.Create(businessGroup)));
        }