public void RemoveBg(string roleId, string bgID)
        {
            int RoleId = Convert.ToInt16(roleId);
            int BgId   = Convert.ToInt16(bgID);
            RolesBusinessGroupAccess dataTodelete = _unitOfWork.RolesBusinessGroupAccessRepository.Get().Where(c => c.RoleId == RoleId && c.BusinssGroupId == BgId).First();

            _unitOfWork.RolesBusinessGroupAccessRepository.Delete(dataTodelete);
            _unitOfWork.Save();
        }
Beispiel #2
0
 public static RolesBusinessGroupAccessDTO ConvertRespondentInfoToDTO(RolesBusinessGroupAccess rolesBusinessGroupAccess)
 {
     Mapper.CreateMap <RolesBusinessGroupAccess, RolesBusinessGroupAccessDTO>().ConvertUsing(
         m =>
     {
         return(new RolesBusinessGroupAccessDTO
         {
             BusinssGroupId = m.BusinssGroupId,
             BgAccessId = m.BgAccessId,
             RoleId = m.RoleId
         });
     });
     return(Mapper.Map <RolesBusinessGroupAccess, RolesBusinessGroupAccessDTO>(rolesBusinessGroupAccess));
 }
        public RolesBusinessGroupAccessDTO Insert(RolesBusinessGroupAccessDTO dataForBg)
        {
            RolesBusinessGroupAccess dataToInsert = RolesBusinessGroupAccessRequestFormatter.ConvertRespondentInfoFromDTO(dataForBg);

            return(RolesBusinessGroupAccessRequestFormatter.ConvertRespondentInfoToDTO(_unitOfWork.RolesBusinessGroupAccessRepository.Create(dataToInsert)));
        }