public UnionController(RandData rand) { this.rand = rand; carHandle = new CarController(rand); custHandle = new CustController(rand); sellHandle = new SellController(rand); }
//생성자 오버로딩 public UnionController(RandData rand) { this.rand = rand; carHandle = new CarController(rand); custHandle = new CustController(rand); sellHandle = new SellController(rand); listItem = new List <object>(); listUn = listItem.Cast <Deal <Car, Customer, Seller> >().ToList(); }
static void Main(string[] args) { RandData rand = new RandData(); Customer[] cs = new Customer[10]; for (int i = 0; i < cs.Length; i++) { cs[i] = new Customer(rand.getName(), rand.getTel(), rand.getAddress(), rand.getModel(), rand.getColor(), rand.getYear(), rand.getCompany()); cs[i].printCustomerInfo(); //Console.WriteLine(cs[i].ToString()); } }
static void Main(string[] args) { RandData rand = new RandData(); Student[] st = new Student[10]; for (int i = 0; i < st.Length; i++) { st[i] = new Student(rand.getName(), rand.getAge(), rand.getGender(), rand.getAddress()); Console.WriteLine(st[i].ToString()); } for (int i = 0; i < st.Length; i++) { st[9] = new Student("전우치", 24, '남', "조선 한양인근 두메산골"); Console.WriteLine(st[i].ToString()); } }
static void Main(string[] args) { /* Console.WriteLine(new Car().ToString()); * new Customer("고길동", 100, "010-1111-1111", "서울 턱별시", '남').CustomerInfo(); * Console.WriteLine(); * * Console.WriteLine("영업소 : " + Seller.CENTER); * new Seller("김준석", 28, "사장").sellerinfo();*/ RandData rand = new RandData(); Menu menu = new Menu(); while (true) { switch (menu.mainMenu()) { case Menu.MENU_MAIN_RAND: carCon.insRandData(menu.getRandSize()); break; case Menu.MENU_MAIN_DEL_ALL: break; case Menu.MENU_MAIN_VIEW: break; case Menu.MENU_MAIN_ADD: break; case Menu.MENU_MAIN_DEL: break; case Menu.MENU_MAIN_UPDATE: break; case Menu.MENU_MAIN_EXIT: Environment.Exit(0); break; } } }
RandData rand; //인스턴트 변수 public CustController(RandData rand) // CustController 객체 생성되어질때 외부에서 RandData rand 가져옴 { this.rand = rand; }
public CarController(RandData rand) { this.rand = rand; }
static void Main(string[] args) { RandData rand = new RandData(); Menu menu = new Menu(); CarController carCon = new CarController(rand); CustController custCon = new CustController(rand); SellController sellCon = new SellController(rand); while (true) { switch (menu.mainMenu()) { case Menu.MENU_MAIN_RAND: carCon.insRandData(menu.getRandSize()); custCon.insRandData(menu.getRandSize()); sellCon.insRandData(menu.getRandSize()); break; case Menu.MENU_MAIN_DEL_ALL: carCon.removeAll(); custCon.removeAll(); sellCon.removeAll(); break; case Menu.MENU_MAIN_VIEW: carCon.carView(); custCon.custView(); sellCon.sellView(); break; case Menu.MENU_MAIN_ADD: switch (menu.subAddMenu()) { case Menu.MENU_SUB_ADD_CAR: carCon.addCarItem( menu.addCarMenu2()); break; case Menu.MENU_SUB_ADD_CUST: custCon.addCustItem( menu.addCustMenu()); break; case Menu.MENU_SUB_ADD_SELL: sellCon.addSellItem( menu.addSellMenu()); break; case Menu.MENU_SUB_ADD_EXIT: break; } break; case Menu.MENU_MAIN_DEL: carCon.delCarItem(menu.delCarMenu()); custCon.delCustItem(menu.delCustMenu()); sellCon.delSellItem(menu.delSellMenu()); break; case Menu.MENU_MAIN_UPDATE: carCon.updateCarItem(menu.updateCarMenu()); custCon.updateCustItem(menu.updateCustMenu()); sellCon.updateSellItem(menu.updateSellMenu()); break; case Menu.MENU_MAIN_EXIT: Environment.Exit(0); break; } } }
RandData rand; //인스턴트 변수 public SellController(RandData rand) // CarController 객체 생성되어질때 외부에서 RandData rand 가져옴 { this.rand = rand; }
public SellController(RandData rand) { this.rand = rand; }
static void Main(string[] args) { RandData rand = new RandData(); Menu menu = new Menu(); // 객체생성 - instance 메소드를 불러오기 위함. CarContoller carCon = new CarContoller(rand); CustController custCon = new CustController(rand); SellController selCon = new SellController(rand); while (true) { switch (menu.mainMenu()) //class변수는 객체 생성 후 불러오기 { case Menu.MENU_MAIN_RAND: // instance 변수는 carCon.InsRandDate(menu.getRandSize()); custCon.InsRandDate_cus(menu.getRandSize()); selCon.InsRandDate_sell(menu.getRandSize()); break; case Menu.MENU_MAIN_DEL_ALL: carCon.removeAll(); custCon.removeAll(); selCon.removeAll(); break; case Menu.MENU_MAIN_VIEW: carCon.carView(); custCon.custView(); selCon.SellView(); break; case Menu.MENU_MAIN_ADD: switch (menu.subAddMenu()) { case Menu.MENU_SUB_ADD_CAR: carCon.addCarItem(menu.addCarMenu2()); break; case Menu.MENU_SUB_ADD_CUST: custCon.addCustItem(menu.addCustMenu()); break; case Menu.MENU_SUB_ADD_SELL: selCon.addSellItem(menu.addSellMenu()); break; case Menu.MENU_SUB_ADD_EXIT: break; } break; case Menu.MENU_MAIN_DEL: carCon.delCarItem(menu.delCarMenu()); custCon.delCustItem(menu.delCustMenu()); selCon.delSellItem(menu.delSellMenu()); break; case Menu.MENU_MAIN_UPDATE: carCon.updateCarItem(menu.updateCarMenu()); custCon.updateCarItem(menu.updateCustMenu()); selCon.updateSellItem(menu.updateSellMenu()); break; case Menu.MENU_MAIN_EXIT: Console.WriteLine("프로그램이 종료되었습니다."); Environment.Exit(0); break; default: break; } } }
public CarController(RandData rand) { listItem = new List <object>(); listCar = listItem.Cast <Car>().ToList(); this.rand = rand; }