Exemple #1
0
 public string Save(Category category)
 {
     if (categoryGateway.IsCategoryNameExists(category.CategoryName))
     {
         return("Category Name already exists");
     }
     else
     {
         int rowEffected = categoryGateway.SaveCategory(category);
         if (rowEffected > 0)
         {
             return("Successfully Inserted ");
         }
         else
         {
             return(" Insert failed ! ");
         }
     }
 }
Exemple #2
0
        public string SaveCategory(Category category)
        {
            if (_category.IsCategoryNameExists(category))
            {
                return("Category Name Already Exists.");
            }
            if (_category.SaveCategory(category) > 0)
            {
                return("Category Name Saved Successfully");
            }

            return("Category Name Save Faild");
        }
Exemple #3
0
        // for save category
        public string Save(Category category)
        {
            //first check categoryName alreary exists or not
            if (categoryGateway.IsCategoryNameExists(category.CategoryName))
            {
                return("Category Name already exists");
            }
            else
            {
                // save category
                int rowAffected = categoryGateway.Save(category);

                if (rowAffected > 0)
                {
                    return("Save Successful");
                }
                else
                {
                    return("Save Failed");
                }
            }
        }