コード例 #1
0
        public void UpdateCategory(Category c)
        {
            CategoryC inter = new CategoryC();

            inter.DeleteCategory(c.id);
            inter.InsertCategory(c);
        }
コード例 #2
0
        public void CreateCategory(Category c)
        {
            if (c.name == "")
            {
                throw new Exception("The Category Name Is Empty");
            }
            if (c.mainC == "")
            {
                throw new Exception("The Main Category Is Empty");
            }

            CategoryC inter = new CategoryC();

            if (inter.searchIfEx(c.name, c.kind))
            {
                throw new Exception("This Category Already Exist");
            }
            inter.InsertCategory(c);
        }