private CategoryDM Map(CategorySM category) { CategoryDM video = new CategoryDM(); video.CtgyId = category.CtgyId.ToString(); video.Category = category.Category; return(video); }
private CategorySM Map(CategoryDM category) { CategorySM video = new CategorySM(); video.CtgyId = Convert.ToInt32(category.CtgyId); video.Category = category.Category; return(video); }
public void EditCategoryById(CategorySM category) { try { categoryData.EditCategoryById(Map(category)); logs.LogError("Event ", "User was able to update Category", "Class:CategoryLogic, Method:UpdateCategoryById"); } catch (Exception e) { logs.LogError("Error ", "User was unable to update Category", "Class:CategoryLogic, Method:UpdateCategoryById"); } }
public void CreateCategory(CategorySM category) { try { categoryData.CreateCategory(Map(category)); logs.LogError("Event ", "User was able to create new item ", "Class:CategoryLogic, Method:CreateCategory"); } catch (Exception P) { logs.LogError("Error ", "User was unable to create a new item ", "Class:UserLogic, Method:CreateCategory"); } }
public string GetCategory(int id) { CategorySM category = Map(categoryData.GetCategoryById(id)); return(category.Category); }