Exemplo n.º 1
0
        public static VENDOR addVendor()
        {
            DataClasses1DataContext db = new DataClasses1DataContext();

            Console.WriteLine("\nEnter the vendor code:");
            int code = Convert.ToInt32(Console.ReadLine());

            Console.WriteLine("Enter the vendor name:");
            String name = Console.ReadLine();

            Console.WriteLine("Enter the vendor contact:");
            String contact = Console.ReadLine();

            Console.WriteLine("Enter the vendor area code:");
            String area = Console.ReadLine();

            Console.WriteLine("Enter the vendor phone number:");
            String phone = Console.ReadLine();

            Console.WriteLine("Enter the vendor state:");
            String state = Console.ReadLine();

            Console.WriteLine("Enter y or n for the vendor order:");
            string order = Console.ReadLine();

            Console.WriteLine();
            VENDOR v = new VENDOR()
            {
                V_CODE     = code,
                V_NAME     = name,
                V_CONTACT  = contact,
                V_AREACODE = area,
                V_PHONE    = phone,
                V_STATE    = state,
                V_ORDER    = order[0]
            };

            db.VENDORs.InsertOnSubmit(v);
            db.SubmitChanges();
            return(v);
        }
 partial void UpdateVENDOR(VENDOR instance);
 partial void DeleteVENDOR(VENDOR instance);
 partial void InsertVENDOR(VENDOR instance);