Exemplo n.º 1
0
 public override void Insert(SdServiceCategoryDto entityDto)
 {
     try
     {
         base.Insert(entityDto);
         if (entityDto.Filter != null)
         {
             FilterCategoryTDataAccess filterda = new FilterCategoryTDataAccess();
             entityDto.Filter.Servicecaegoryid = entityDto.ServiceCatId;
             filterda.Insert(entityDto.Filter);
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Exemplo n.º 2
0
 public override void Update(SdServiceCategoryDto entityDto)
 {
     base.Update(entityDto);
     if (entityDto.Filter != null && entityDto.Filter.State == Framework.Common.CommonBase.DtoObjectState.Updated)
     {
         FilterCategoryTDataAccess filterda = new FilterCategoryTDataAccess();
         var oldFilter = filterda.GetAll(it => it.Servicecaegoryid == entityDto.ServiceCatId);
         if (oldFilter != null && oldFilter.Count > 0)
         {
             filterda.Delete(oldFilter.ToList());
         }
         entityDto.Filter.Servicecaegoryid = entityDto.ServiceCatId;
         filterda.Insert(entityDto.Filter);
     }
     if (entityDto.Filter != null && entityDto.Filter.State == Framework.Common.CommonBase.DtoObjectState.Deleted)
     {
         FilterCategoryTDataAccess filterda = new FilterCategoryTDataAccess();
         var oldFilter = filterda.GetAll(it => it.Servicecaegoryid == entityDto.ServiceCatId);
         if (oldFilter != null && oldFilter.Count > 0)
         {
             filterda.Delete(oldFilter.ToList());
         }
     }
 }