コード例 #1
0
        public string SaveCategory(Category category)
        {
            bool hasRow = aCategoryGateway.CheckCategory(category);

            if (!hasRow)
            {
                int rowAffected = aCategoryGateway.SaveCategory(category);

                if (rowAffected > 0)
                {
                    return("Category saved");
                }
                else
                {
                    return("Category save failed");
                }
            }
            return("Category with the same name already exists");
        }