Example #1
0
        public bool EditSubCategory(SubCategoryViewModel model)
        {
            pub_SubCategoryEntity entity = AutoMapHelper.ToEntity <SubCategoryViewModel, pub_SubCategoryEntity>(model);

            if (entity.Id == 0)
            {
                entity.SubCategoryId = IDHelper.Create("S");
                categoryRepository.InsertSubCategory(entity);
            }
            else
            {
                categoryRepository.UpdateSubCategory(entity);
            }
            return(true);
        }
Example #2
0
 public int UpdateSubCategory(pub_SubCategoryEntity entity)
 {
     return(EFHelper.Update <pub_SubCategoryEntity>(entity));
 }
Example #3
0
 public int InsertSubCategory(pub_SubCategoryEntity entity)
 {
     return(EFHelper.Insert <pub_SubCategoryEntity>(entity));
 }