void Edit(int n, object item) { switch (n) { //case 0: // BillWindow bw = new BillWindow(db, (Bill)item); // bw.ShowDialog(); // break; //case 1: // EntryWindow ew = new EntryWindow(db, (Entry)item); // ew.ShowDialog(); // break; case 2: ProductWindow pw = new ProductWindow(db, (Product)item); pw.ShowDialog(); break; case 3: ServiceWindow sw = new ServiceWindow(db, (Service)item); sw.ShowDialog(); break; case 4: ClientWindow cw = new ClientWindow(db, (Client)item); cw.ShowDialog(); break; case 5: CarWashWindow cww = new CarWashWindow(db, (CarWash)item); cww.ShowDialog(); break; } Refresh(n); }
void Create(int n) { bool flag = false; switch (n) { case 0: BillWindow bw = new BillWindow(db); flag = bw.ShowDialog(); break; case 1: EntryWindow ew = new EntryWindow(db); flag = ew.ShowDialog(); break; case 2: ProductWindow pw = new ProductWindow(db); flag = pw.ShowDialog(); break; case 3: ServiceWindow sw = new ServiceWindow(db); flag = sw.ShowDialog(); break; case 4: ClientWindow cw = new ClientWindow(db); flag = cw.ShowDialog(); break; case 5: CarWashWindow cww = new CarWashWindow(db); flag = cww.ShowDialog(); break; } if (flag) { Refresh(n); } }