public UCriteriaGeneric(CCriteriaBase cr, String cption) { caption = cption; criteria = cr; criteria.ParentControl = this; criteria.ItemAddedEvent = itemAdded_Handler; DataContext = criteria.Model; InitializeComponent(); renderCriteriaEntries(); renderTopCriteriaEntries(); renderAddButton(); cmdDelete.IsEnabled = criteria.IsDeleteEnable(); }
private void mnuSearch_Click(object sender, RoutedEventArgs e) { CComboConfig cfg = (CComboConfig)comboTypeConfigs[ComboLoadType]; CCriteriaBase cr = (CCriteriaBase)Activator.CreateInstance(Type.GetType(cfg.ScreenCriteriaClassName)); cr.SetActionEnable(false); criteriaInitFunc(cr); WinLookupSearch2 w = new WinLookupSearch2(cr, Caption); w.ShowDialog(); if (w.IsOK) { this.selectedObject = w.ReturnedObj; updateGui(this); } }
private void mnuSearch_Click(object sender, RoutedEventArgs e) { CLookupConfig cfg = (CLookupConfig)lookupTypeConfigs[Lookup]; CCriteriaBase cr = (CCriteriaBase)Activator.CreateInstance(Type.GetType(cfg.ScreenCriteriaClassName)); cr.SetActionEnable(false); criteriaInitFunc(cr); String caption = Caption; if (Caption.Equals("")) { caption = lookupTypeToCaption(Lookup); } WinLookupSearch2 w = new WinLookupSearch2(cr, caption); w.ShowDialog(); if (w.IsOK) { SelectedObject = w.ReturnedObj; } }
private CCriteriaBase getMenuCriteria(String mnuName) { MMenuItem m = (MMenuItem)menuItemConfigs[mnuName]; if (m == null) { return(null); } if (m.ClassName.Equals("")) { return(null); } CUtil.EnableForm(false, this); CCriteriaBase cr = null; if (mnuName.Equals("mnuCashIn")) { cr = FactoryCriteria.GetObject(m.ClassName, new MCashDocIn(new CTable(""))); } else if (mnuName.Equals("mnuCashOut")) { cr = FactoryCriteria.GetObject(m.ClassName, new MCashDocOut(new CTable(""))); } else { cr = FactoryCriteria.GetObject(m.ClassName); } criteriaInitFunc(mnuName, cr); CUtil.EnableForm(true, this); return(cr); }
public WinScreenConfig(CCriteriaBase cr, String configName) { criteria = cr; caption = configName; InitializeComponent(); }
public WinTestPageRender(CCriteriaBase cr, String configName) { criteria = cr; caption = configName; InitializeComponent(); }
private void criteriaInitFunc(String menu, CCriteriaBase cb) { cb.Initialize(menu); cb.LoadScreenConfig(); }
private void mnuModule_Click(object sender, RoutedEventArgs e) { MenuItem mnu = (MenuItem)sender; String name = mnu.Name; UControlTupple ua; UControlTupple old; UserControl uleft; UserControl uright; String header = (String)mnu.Header; this.Title = (String)mnu.Header; if (name.Equals("mnuLoginSession") || name.Equals("mnuInventoryReport") || name.Equals("mnuSaleReport") || name.Equals("mnuStandardPackage") || name.Equals("mnuCashReport") || name.Equals("mnuCompanyCommissionProfile") || name.Equals("mnuHr") || name.Equals("mnuCommissionReport") || name.Equals("mnuPurchaseReport") || name.Equals("mnuGeneralReport")) { ColLeftWidth = hideLength; } else { ColLeftWidth = showLength; } if (menuItemConfigs.ContainsKey(name)) { if (!name.Equals("mnuMasterRef") && !name.Equals("mnuItemByCategory")) { ColLeftWidth = hideLength; } } if (currentUserControlSelected.Equals(name)) { //Do nothing, same menu selected return; } old = (UControlTupple)ucontrolHash[currentUserControlSelected]; if (ucontrolHash.ContainsKey(name)) { ua = (UControlTupple)ucontrolHash[name]; currentUserControlSelected = name; } else { CCriteriaBase cr = getMenuCriteria(name); if (cr != null) { CUtil.EnableForm(false, this); uleft = new UBlank(); Grid.SetRow(uleft, 0); Grid.SetColumn(uleft, 0); grdMain.Children.Add(uleft); uright = new UCriteriaGeneric(cr, header); Grid.SetRow(uright, 0); Grid.SetColumn(uright, 1); grdMain.Children.Add(uright); CUtil.EnableForm(true, this); (uright as UCriteriaGeneric).SetFirstFocus(); } else if (name.Equals("mnuMasterRef")) { if (!CHelper.VerifyAccessRight("GENERAL_MASTER_MENU")) { return; } CUtil.EnableForm(false, this); uleft = new UMasterRefSearch(); Grid.SetRow(uleft, 0); Grid.SetColumn(uleft, 0); grdMain.Children.Add(uleft); uright = new UMasterRef(); Grid.SetRow(uright, 0); Grid.SetColumn(uright, 1); grdMain.Children.Add(uright); (uright as UMasterRef).InitUserControl(); (uleft as UMasterRefSearch).SetProvider(uright); (uleft as UMasterRefSearch).LoadData(); CUtil.EnableForm(true, this); } else if (name.Equals("mnuItemByCategory")) { if (!CHelper.VerifyAccessRight("INVENTORY_ITEM_MENU")) { return; } CUtil.EnableForm(false, this); uleft = new UInventoryItemByCategorySearch(); Grid.SetRow(uleft, 0); Grid.SetColumn(uleft, 0); grdMain.Children.Add(uleft); uright = new UInventoryItem(2); Grid.SetRow(uright, 0); Grid.SetColumn(uright, 1); grdMain.Children.Add(uright); (uright as UInventoryItem).InitUserControl(); (uleft as UInventoryItemByCategorySearch).SetProvider(uright); (uleft as UInventoryItemByCategorySearch).LoadData(); CUtil.EnableForm(true, this); } else if (name.Equals("mnuOrganizeChart")) { if (!CHelper.VerifyAccessRight("HR_ORGCHART_MENU")) { return; } CUtil.EnableForm(false, this); uleft = new UBlank(); Grid.SetRow(uleft, 0); Grid.SetColumn(uleft, 0); grdMain.Children.Add(uleft); uright = new UI.HumanResource.OrgChart.UCompanyOrgChart(); Grid.SetRow(uright, 0); Grid.SetColumn(uright, 1); grdMain.Children.Add(uright); (uright as UI.HumanResource.OrgChart.UCompanyOrgChart).InitUserControl(); CUtil.EnableForm(true, this); } else if (name.Equals("mnuStandardPackage")) { if (!CHelper.VerifyAccessRight("SALE_STDPACKAGE_MENU")) { return; } CUtil.EnableForm(false, this); uleft = new UBlank(); Grid.SetRow(uleft, 0); Grid.SetColumn(uleft, 0); grdMain.Children.Add(uleft); uright = new UStandardPackage(); Grid.SetRow(uright, 0); Grid.SetColumn(uright, 1); grdMain.Children.Add(uright); (uright as UStandardPackage).InitUserControl(); CUtil.EnableForm(true, this); } else if (name.Equals("mnuInventoryReport")) { if (!CHelper.VerifyAccessRight("INVENTORY_REPORT_MENU")) { return; } CUtil.EnableForm(false, this); uleft = new UBlank(); Grid.SetRow(uleft, 0); Grid.SetColumn(uleft, 0); grdMain.Children.Add(uleft); uright = new UReportView(); Grid.SetRow(uright, 0); Grid.SetColumn(uright, 1); grdMain.Children.Add(uright); (uright as UReportView).ReportType = ReportType.ReportInv; (uright as UReportView).typeReport = this.Title; (uright as UReportView).LoadData(); CUtil.EnableForm(true, this); } else if (name.Equals("mnuSaleReport")) { if (!CHelper.VerifyAccessRight("SALE_REPORT_MENU")) { return; } CUtil.EnableForm(false, this); uleft = new UBlank(); Grid.SetRow(uleft, 0); Grid.SetColumn(uleft, 0); grdMain.Children.Add(uleft); uright = new UReportView(); Grid.SetRow(uright, 0); Grid.SetColumn(uright, 1); grdMain.Children.Add(uright); (uright as UReportView).ReportType = ReportType.ReportSale; (uright as UReportView).typeReport = this.Title; (uright as UReportView).LoadData(); CUtil.EnableForm(true, this); } else if (name.Equals("mnuGeneralReport")) { if (!CHelper.VerifyAccessRight("GENERAL_REPORT_MENU")) { return; } CUtil.EnableForm(false, this); uleft = new UBlank(); Grid.SetRow(uleft, 0); Grid.SetColumn(uleft, 0); grdMain.Children.Add(uleft); uright = new UReportView(); Grid.SetRow(uright, 0); Grid.SetColumn(uright, 1); grdMain.Children.Add(uright); (uright as UReportView).ReportType = ReportType.ReportGeneral; (uright as UReportView).typeReport = this.Title; (uright as UReportView).LoadData(); CUtil.EnableForm(true, this); } else if (name.Equals("mnuPurchaseReport")) { if (!CHelper.VerifyAccessRight("PURCHASE_REPORT_MENU")) { return; } CUtil.EnableForm(false, this); uleft = new UBlank(); Grid.SetRow(uleft, 0); Grid.SetColumn(uleft, 0); grdMain.Children.Add(uleft); uright = new UReportView(); Grid.SetRow(uright, 0); Grid.SetColumn(uright, 1); grdMain.Children.Add(uright); (uright as UReportView).ReportType = ReportType.ReportPurchase; (uright as UReportView).typeReport = this.Title; (uright as UReportView).LoadData(); CUtil.EnableForm(true, this); } else if (name.Equals("mnuCashReport")) { if (!CHelper.VerifyAccessRight("CASH_REPORT_MENU")) { return; } CUtil.EnableForm(false, this); uleft = new UBlank(); Grid.SetRow(uleft, 0); Grid.SetColumn(uleft, 0); grdMain.Children.Add(uleft); uright = new UReportView(); Grid.SetRow(uright, 0); Grid.SetColumn(uright, 1); grdMain.Children.Add(uright); (uright as UReportView).ReportType = ReportType.ReportCash; (uright as UReportView).typeReport = this.Title; (uright as UReportView).LoadData(); CUtil.EnableForm(true, this); } else if (name.Equals("mnuHr")) { if (!CHelper.VerifyAccessRight("HR_PAYROLL_REPORT")) { return; } CUtil.EnableForm(false, this); uleft = new UBlank(); Grid.SetRow(uleft, 0); Grid.SetColumn(uleft, 0); grdMain.Children.Add(uleft); uright = new UReportView(); Grid.SetRow(uright, 0); Grid.SetColumn(uright, 1); grdMain.Children.Add(uright); (uright as UReportView).ReportType = ReportType.ReportHr; (uright as UReportView).typeReport = this.Title; (uright as UReportView).LoadData(); CUtil.EnableForm(true, this); } else { uleft = new UBlank(); uright = null; Grid.SetRow(uleft, 0); Grid.SetColumn(uleft, 1); grdMain.Children.Add(uleft); } currentUserControlSelected = name; ua = new UControlTupple(); ua.uleft = uleft; ua.uright = uright; ucontrolHash.Add(name, ua); } if (old != null) { old.uleft.Visibility = Visibility.Hidden; if (old.uright != null) { old.uright.Visibility = Visibility.Hidden; } } ua.uleft.Visibility = Visibility.Visible; if (ua.uright != null) { ua.uright.Visibility = Visibility.Visible; } }