Пример #1
0
        public void additem()
        {
            Console.WriteLine("enter num of products:");
            int    n   = int.Parse(Console.ReadLine());
            itembo ibo = new itembo();

            for (int i = 0; i < n; i++)
            {
                Console.WriteLine("Enter Category id:");
                int cid = int.Parse(Console.ReadLine());
                Console.WriteLine("Enter Category Name:");
                string cname = Console.ReadLine();
                Console.WriteLine("Enter Category Details:");
                string cdetails = Console.ReadLine();
                Console.WriteLine("Enter Sub Category id:");
                int subid = int.Parse(Console.ReadLine());
                Console.WriteLine("Enter SubCategory Name:");
                string sname = Console.ReadLine();
                Console.WriteLine("Enter SubCategory Details:");
                string sdetails = Console.ReadLine();
                Console.WriteLine("Enter Item id:");
                int id = int.Parse(Console.ReadLine());
                Console.WriteLine("Enter Item Name:");

                string itemname = Console.ReadLine();
                Console.WriteLine("Enter item price");
                int price = int.Parse(Console.ReadLine());

                subcatergory sc = new subcatergory(cid, cname, cdetails, subid, sname, sdetails);

                ibo.additem(cid, cname, cdetails, subid, sname, sdetails, id, price, itemname, sc);
            }
        }
Пример #2
0
        public void additem()
        {
            ItemBo bi = new ItemBo();

            Console.WriteLine("Enter Number OF Items TO Add: ");
            int num = int.Parse(Console.ReadLine());

            for (int i = 1; i <= num; i++)
            {
                Console.WriteLine("Enter Category id:");
                int cid = int.Parse(Console.ReadLine());
                Console.WriteLine("Enter Category Name:");
                string cname = Console.ReadLine();
                Console.WriteLine("Enter Category Details:");
                string cdetails = Console.ReadLine();
                Console.WriteLine("Enter Sub Category id:");
                int subid = int.Parse(Console.ReadLine());
                Console.WriteLine("Enter SubCategory Name:");
                string sname = Console.ReadLine();
                Console.WriteLine("Enter SubCategory Details:");
                string sdetails = Console.ReadLine();
                Console.WriteLine("Enter Item id:");
                int id = int.Parse(Console.ReadLine());
                Console.WriteLine("Enter Item Name:");
                string itemname = Console.ReadLine();
                Console.WriteLine("Enter item price");
                int          price = int.Parse(Console.ReadLine());
                subcatergory sc    = new subcatergory(cid, cname, cdetails, subid, sname, sdetails);
                ItemBo       bo    = new ItemBo();

                bo.additem(cid, cname, cdetails, subid, sname, sdetails, id, price, itemname, sc);
            }
        }
Пример #3
0
 public item(int id, int cid, int sid, int price, string itemname, subcatergory sb)
 {
     this.id       = id;
     this.cid      = cid;
     this.sid      = sid;
     this.price    = price;
     this.itemname = itemname;
     this.sb       = sb;
 }
Пример #4
0
        public void additem(int cid, string cname, string cdetails, int subid, string subname, string sdetails, int id, int price, string itemname, subcatergory sb)
        {
            subcatergory s = new subcatergory(cid, cname, cdetails, subid, subname, sdetails);

            slist.Add(s);
            ca.Add(s);
            // catergory c = new catergory(cid, cname, cdetails);
            item it = new item(id, cid, subid, price, itemname, s);

            llist.Add(it);
        }