private void MenuListSaleBill_Click(object sender, RoutedEventArgs e) { //If found tab was ListSaleBill, selected for Tabcontrol var index = TabControlManagement.GetIndexByTitle(MainTabControl, UsecaseStringContants.listSaleBill); if (index >= 0) { MainTabControl.SelectedIndex = index; } //If not found tab was ListSaleBill, add and selected else { ListSaleBillUserControl listSaleBillUserControl = new ListSaleBillUserControl(); listSaleBillUserControl.SetUpForAdmin(); CustomTabItem customTabItem = new CustomTabItem() { Title = UsecaseStringContants.listSaleBill, Content = listSaleBillUserControl }; MainTabControl.Items.Add(customTabItem); MainTabControl.SelectedItem = customTabItem; } CurrenTabTitle.Content = UsecaseStringContants.listSaleBill; this.Title = UsecaseStringContants.listSaleBill; }
private void MenuEndOfShift_Click(object sender, RoutedEventArgs e) { //If found tab was EndOfShift, selected for Tabcontrol var index = TabControlManagement.GetIndexByTitle(MainTabControl, UsecaseStringContants.listEndOfShift); if (index >= 0) { MainTabControl.SelectedIndex = index; } //If not found tab was EndOfShift, add and selected else { ListEndOfShiftUserControl listEndOfShiftUserControl = new ListEndOfShiftUserControl() { CanAprrove = true }; listEndOfShiftUserControl.SetupButton(); CustomTabItem customTabItem = new CustomTabItem() { Title = UsecaseStringContants.listEndOfShift, Content = listEndOfShiftUserControl }; MainTabControl.Items.Add(customTabItem); MainTabControl.SelectedItem = customTabItem; } CurrenTabTitle.Content = UsecaseStringContants.listEndOfShift; this.Title = UsecaseStringContants.listEndOfShift; }
// method to test, need remove when done this project private void MenuEditSupplier_Click(object sender, RoutedEventArgs e) { //If found a ListSuplier, selected for Tabcontrol var index = TabControlManagement.GetIndexByTitle(MainTabControl, UsecaseStringContants.editSupplier); if (index >= 0) { MainTabControl.SelectedIndex = index; } //If not found tab was ListSuplier, add and selected else { SupplierBusiness supplierBusiness = new SupplierBusiness(); var supplier = supplierBusiness.GetAll()[0]; SupplierViewModel supplierViewModel = new SupplierViewModel() { SupplierId = supplier.SupplierId, SupplierName = supplier.SupplierName, Description = supplier.Description }; EditSupplierUserControl editSupplierUserControl = new EditSupplierUserControl(supplierViewModel); CustomTabItem customTabItem = new CustomTabItem() { Title = UsecaseStringContants.editSupplier, Content = editSupplierUserControl }; MainTabControl.Items.Add(customTabItem); MainTabControl.SelectedItem = customTabItem; } CurrenTabTitle.Content = UsecaseStringContants.editSupplier; this.Title = UsecaseStringContants.editSupplier; }
private void MenuStatistics_Click(object sender, RoutedEventArgs e) { //If found tab was Statistics, selected for Tabcontrol var index = TabControlManagement.GetIndexByTitle(MainTabControl, UsecaseStringContants.statistics); if (index >= 0) { MainTabControl.SelectedIndex = index; } //If not found tab was Statistics, add and selected else { StatisticsUserControl statisticsUserControl = new StatisticsUserControl(); CustomTabItem customTabItem = new CustomTabItem() { Title = UsecaseStringContants.statistics, Content = statisticsUserControl }; MainTabControl.Items.Add(customTabItem); MainTabControl.SelectedItem = customTabItem; } CurrenTabTitle.Content = UsecaseStringContants.statistics; this.Title = UsecaseStringContants.statistics; }
private void MenuAddPurchaseBill(object sender, RoutedEventArgs e) { //If found a AddPurchaseBill tabitem, selected for Tabcontrol var index = TabControlManagement.GetIndexByTitle(MainTabControl, UsecaseStringContants.addPurchaseBill); if (index >= 0) { MainTabControl.SelectedIndex = index; } //If not found tab was AddPurchaseBill tabitem, add and selected else { AddPurchaseBillUserControl addPurchaseBillUserControl = new AddPurchaseBillUserControl(); CustomTabItem customTabItem = new CustomTabItem() { Title = UsecaseStringContants.addPurchaseBill, Content = addPurchaseBillUserControl }; MainTabControl.Items.Add(customTabItem); MainTabControl.SelectedItem = customTabItem; } CurrenTabTitle.Content = UsecaseStringContants.addPurchaseBill; this.Title = UsecaseStringContants.addPurchaseBill; }
private void MenuManageSuplier(object sender, RoutedEventArgs e) { //If found a ListSuplier, selected for Tabcontrol var index = TabControlManagement.GetIndexByTitle(MainTabControl, UsecaseStringContants.listSupplier); if (index >= 0) { MainTabControl.SelectedIndex = index; } //If not found tab was ListSuplier, add and selected else { ManageSupplierUserControl manageSupplierUserControl = new ManageSupplierUserControl(); CustomTabItem customTabItem = new CustomTabItem() { Title = UsecaseStringContants.listSupplier, Content = manageSupplierUserControl }; MainTabControl.Items.Add(customTabItem); MainTabControl.SelectedItem = customTabItem; } CurrenTabTitle.Content = UsecaseStringContants.listSupplier; this.Title = UsecaseStringContants.listSupplier; }