public IHttpActionResult UpdateSubCategory(SubCategoriesByCategoryID SubCategory) { try { if (SubCategory.ImageID == 0) { SubCategory.ImageID = null; } dahEntity.DAH_SP_UpdateSubCategory(SubCategory.ID, SubCategory.SubCategory, SubCategory.CategoryID, SubCategory.Description, SubCategory.ImageID, SubCategory.SubCategoryImage); return(Ok()); } catch (Exception) { return(InternalServerError()); } }
private List <SubCategoriesByCategoryID> ConvertToAppSubCategoriesByCategories(List <DAH_SP_GetSubCategoryByCategory_Result> dALSubcategoriesList) { List <SubCategoriesByCategoryID> SubCategoriesByCategoryList = new List <SubCategoriesByCategoryID>(); foreach (DAH_SP_GetSubCategoryByCategory_Result SubCategory in dALSubcategoriesList) { SubCategoriesByCategoryID AppSubCategory = new SubCategoriesByCategoryID(); AppSubCategory.SubCategory = SubCategory.SubCategory; AppSubCategory.Category = SubCategory.Category; AppSubCategory.Description = SubCategory.Description; AppSubCategory.CategoryID = SubCategory.CategoryID; AppSubCategory.ID = SubCategory.ID; AppSubCategory.ImageID = SubCategory.ImageID; AppSubCategory.SubCategoryImage = SubCategory.Image; SubCategoriesByCategoryList.Add(AppSubCategory); } return(SubCategoriesByCategoryList); }