private void AddOrEdit_Click(String mode) { TabItem ti = (TabItem)tabMain.SelectedItem; String name = (String)ti.Tag; String gid = getPackageGroupByTag(name); CCriteriaPromotion cr = new CCriteriaPromotion(); cr.SetActionEnable(false); cr.Init(gid); WinLookupSearch2 w = new WinLookupSearch2(cr, CLanguage.getValue(name)); w.ShowDialog(); MCompanyPackage v = new MCompanyPackage(new CTable("")); if (vw != null) { vw.PackageGroup = gid; v.SetDbObject(vw.GetDbObject().Clone()); } if (w.IsOK) { vw.Addtems(name, (MCompanyPackage)v, (MPackage)w.ReturnedObj); vw.IsModified = true; } }
private MAccountDoc createInvoiceFromSaleOrder() { MAccountDoc md = null; CCriteriaAccountDocSale cr = new CCriteriaAccountDocSale(); cr.SetActionEnable(false); cr.SetDefaultData(new MAccountDoc(new CTable(""))); cr.SetDocumentType(AccountDocumentType.AcctDocSaleOrder); cr.Init(""); cr.PopulateExtraFields(); WinLookupSearch2 w = new WinLookupSearch2(cr, CLanguage.getValue("sale_order")); w.ShowDialog(); if (w.IsOK) { CUtil.EnableForm(false, ParentControl); md = constructInvoiceFromSaleOrder((MAccountDoc)w.ReturnedObj); CUtil.EnableForm(true, ParentControl); } return(md); }
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 cmdSearch_Click(object sender, RoutedEventArgs e) { CCriteriaBillSimulate cr = new CCriteriaBillSimulate(); cr.SetActionEnable(false); cr.Init(""); WinLookupSearch2 w = new WinLookupSearch2(cr, Caption); w.ShowDialog(); if (w.IsOK) { MBillSimulate bs = (MBillSimulate)w.ReturnedObj; CConfig.AddParam("LAST_BILL_SIMULATE_ID", bs.BillSimulateID); loadLastBill(); billSim.IsModified = false; } }
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 MAccountDoc createSaleOrderFromQuotation() { MAccountDoc md = null; CCriteriaAuxilaryDocSale cr = new CCriteriaAuxilaryDocSale(); cr.SetActionEnable(false); cr.SetDefaultData(new MAuxilaryDoc(new CTable(""))); cr.Init(((int)AuxilaryDocumentType.AuxDocQuotation).ToString()); cr.PopulateExtraFields(); WinLookupSearch2 w = new WinLookupSearch2(cr, CLanguage.getValue("quotation")); w.ShowDialog(); if (w.IsOK) { CUtil.EnableForm(false, ParentControl); md = constructSaleOrderFromQuotation((MAuxilaryDoc)w.ReturnedObj); CUtil.EnableForm(true, ParentControl); } return(md); }