示例#1
0
        public int UpdateDarabandi(DarbandiDTO data)
        {
            Darbandi darb     = DarbandiRequestFormatter.ConvertRespondentInfoFromDTO(data);
            var      response = _unitOfWork.DarbandiRepository.Update(darb);

            _unitOfWork.Save();
            return(response);
        }
示例#2
0
        public DarbandiDTO InsertDarabandi(DarbandiDTO data)
        {
            Darbandi darbandi = DarbandiRequestFormatter.ConvertRespondentInfoFromDTO(data);

            _darbandi.DarbandiDate     = darbandi.DarbandiDate;
            _darbandi.DarbandiDesgId   = darbandi.DarbandiDesgId;
            _darbandi.DarbandiId       = darbandi.DarbandiId;
            _darbandi.DarbandiNumber   = darbandi.DarbandiNumber;
            _darbandi.DarbandiOfficeId = darbandi.DarbandiOfficeId;
            _darbandi.DarbandiRemarks  = darbandi.DarbandiRemarks;
            _darbandi.DarbandiType     = darbandi.DarbandiType;
            return(DarbandiRequestFormatter.ConvertRespondentInfoToDTO(_unitOfWork.DarbandiRepository.Create(darbandi)));
        }
示例#3
0
 public static DarbandiDTO ConvertRespondentInfoToDTO(Darbandi darbandi)
 {
     Mapper.CreateMap <Darbandi, DarbandiDTO>().ConvertUsing(
         m =>
     {
         return(new DarbandiDTO
         {
             DarbandiDate = m.DarbandiDate,
             DarbandiDesgId = m.DarbandiDesgId,
             DarbandiId = m.DarbandiId,
             DarbandiNumber = m.DarbandiNumber,
             DarbandiOfficeId = m.DarbandiOfficeId,
             DarbandiRemarks = m.DarbandiRemarks,
             DarbandiType = m.DarbandiType
         });
     });
     return(Mapper.Map <Darbandi, DarbandiDTO>(darbandi));
 }
示例#4
0
 public DarbandiService(IUnitOfWork unitOfWork = null)
 {
     _unitOfWork = unitOfWork ?? new UnitOfWork();
     _darbandi   = new Darbandi();
 }