예제 #1
0
 public void InsertCategories(int id, string name)
 {
     if (string.IsNullOrWhiteSpace(name))
     {
         throw new Exception("Have null or White Space on text name!");
     }
     else
     {
         CategoriesDTO dto = new CategoriesDTO();
         dto.cateName = name;
         dto.cateId   = id;
         if (categoriesDAO.Add(dto))
         {
             //do not thing
         }
         else
         {
             throw new Exception("Insert Fail!");
         }
     }
 }