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); }
public int UpdateSubCategory(pub_SubCategoryEntity entity) { return(EFHelper.Update <pub_SubCategoryEntity>(entity)); }
public int InsertSubCategory(pub_SubCategoryEntity entity) { return(EFHelper.Insert <pub_SubCategoryEntity>(entity)); }