public FrmViewResult(MetaData Meta, string cmd, string table, string listtype, string edittype) { // // Required for Windows Form Designer support // InitializeComponent(); this.table = table; this.listtype = listtype.Trim(); this.edittype = edittype; this.Meta = Meta; T = Meta.Conn.SQLRunner(cmd, false); if (T == null) { return; } DataSet DD = new DataSet("temp"); ClearDataSet.RemoveConstraints(DD); DD.Tables.Add(T); //HelpForm.SetDataGrid(dgrid, T); dgrid.SetDataBinding(DD, T.TableName); formatgrids fg = new formatgrids(dgrid); fg.AutosizeColumnWidth(); }
public void MetaData_AfterLink() { Meta = MetaData.GetMetaData(this); QHC = new CQueryHelper(); QHS = Meta.Conn.GetQueryHelper(); Text = "Esportazione Dati Patrimonio"; ClearDataSet.RemoveConstraints(dsEsporta); GetData.CacheTable(DS.inventoryagency, null, "description", true); dsEsporta.DataSetName = "dsEsporta"; }
public frmSpesaAutomatismi( MetaData Parent, string filterspesa, string filterentrata, string filtervarspesa) { InitializeComponent(); this.Meta = Parent; string filteresercizio = "(esercizio='" + Meta.GetSys("esercizio") + "')"; ClearDataSet.RemoveConstraints(DS); if (filterspesa != null) { filterspesa = GetData.MergeFilters("(" + filterspesa + ")", filteresercizio); DataAccess.RUN_SELECT_INTO_TABLE(Meta.Conn, DS.expenseview, null, filterspesa, null, true); } if (filterentrata != null) { filterentrata = GetData.MergeFilters("(" + filterentrata + ")", filteresercizio); DataAccess.RUN_SELECT_INTO_TABLE(Meta.Conn, DS.incomeview, null, filterentrata, null, true); } if (filtervarspesa != null) { DataAccess.RUN_SELECT_INTO_TABLE(Meta.Conn, DS.expensevarview, null, filtervarspesa, null, true); } MetaData MSpesaView = Meta.Dispatcher.Get("spesaview"); MSpesaView.DescribeColumns(DS.expenseview, "autospesa"); HelpForm.SetDataGrid(gridSpesa, DS.expenseview); formatgrids FGSpesa = new formatgrids(gridSpesa); FGSpesa.AutosizeColumnWidth(); MetaData MEntrataView = Meta.Dispatcher.Get("entrataview"); MEntrataView.DescribeColumns(DS.incomeview, "autospesa"); HelpForm.SetDataGrid(gridEntrata, DS.incomeview); formatgrids FGEntrata = new formatgrids(gridEntrata); FGEntrata.AutosizeColumnWidth(); MetaData MVarSpesaView = Meta.Dispatcher.Get("variazionespesaview"); MVarSpesaView.DescribeColumns(DS.expensevarview, "autospesa"); HelpForm.SetDataGrid(gridVarSpesa, DS.expensevarview); formatgrids FGVarSpesa = new formatgrids(gridVarSpesa); FGVarSpesa.AutosizeColumnWidth(); HideEmpties(); }
private bool FillExportVista(string ProcedureName, DataAccess DA) { ClearDataSet.RemoveConstraints(ExportVista); GetData MyGetData = new GetData(); MyGetData.InitClass(ExportVista, DA, "exportfunction"); DataRow DR = ExportVista.Tables["exportfunction"].NewRow(); ExportName = HelpForm.GetField(ProcedureName, 0); // title.reportname //DR["procedurename"] = ProcedureName; DR["procedurename"] = ExportName; MyGetData.SEARCH_BY_KEY(DR); MyGetData.DO_GET(false, null); MyGetData.DO_GET_TABLE(ExportVista.customselection, null, null, false, null); ExportDescription = ExportVista.Tables["exportfunction"].Rows[0]["description"].ToString(); return(true); }
public void MetaData_AfterLink() { Meta = MetaData.GetMetaData(this); QHC = new CQueryHelper(); QHS = Meta.Conn.GetQueryHelper(); inizializzaVar(); visualizzaEtichetta(); DisplayTabs(0); Meta.CanInsert = false; Meta.CanSave = false; Meta.SearchEnabled = false; ClearDataSet.RemoveConstraints(DS2); filterBilancio = QHS.AppAnd(QHS.CmpEq("ayear", Meta.GetSys("esercizio")), QHS.BitSet("flag", 0)); //finpart=S GetData.SetStaticFilter(DS.fin, filterBilancio); GetData.SetStaticFilter(DS.finview, filterBilancio); string filtersercizio = QHS.CmpEq("ayear", Meta.GetSys("esercizio")); DataAccess.RUN_SELECT_INTO_TABLE(Meta.Conn, DS2.sortingkind, null, null, null, true); DataAccess.RUN_SELECT_INTO_TABLE(Meta.Conn, DS2.config, null, filtersercizio, null, true); }
public Frm_expense_automatismi( MetaData Parent, string filterspesa, string filterentrata, string filtervarspesa, string filtervarentrata) { InitializeComponent(); this.Meta = Parent; MetaData.SetColor(this); ExcelMenu = new ContextMenu(); ExcelMenu.MenuItems.Add("Excel", new EventHandler(Excel_Click)); QHS = Meta.Conn.GetQueryHelper(); QHC = new CQueryHelper(); string filteresercizio = QHS.CmpEq("ayear", Meta.GetSys("esercizio")); ClearDataSet.RemoveConstraints(DS); if (filterspesa != null) { filterspesa = QHS.AppAnd("(" + filterspesa + ")", filteresercizio); DataAccess.RUN_SELECT_INTO_TABLE(Meta.Conn, DS.expenseview, "autokind asc, autocode asc, amount asc, idfin asc, nphase asc", filterspesa, null, true); } if (filterentrata != null) { filterentrata = QHS.AppAnd("(" + filterentrata + ")", filteresercizio); DataAccess.RUN_SELECT_INTO_TABLE(Meta.Conn, DS.incomeview, "autokind asc, autocode asc, amount asc,idfin asc, nphase asc", filterentrata, null, true); } if (filtervarspesa != null) { DataAccess.RUN_SELECT_INTO_TABLE(Meta.Conn, DS.expensevarview, "nvar asc", filtervarspesa, null, true); } if (filtervarentrata != null) { DataAccess.RUN_SELECT_INTO_TABLE(Meta.Conn, DS.incomevarview, "nvar asc", filtervarentrata, null, true); } MetaData MSpesaView = Meta.Dispatcher.Get("expenseview"); MSpesaView.DescribeColumns(DS.expenseview, "autospesa"); HelpForm.SetDataGrid(gridSpesa, DS.expenseview); gridSpesa.ContextMenu = ExcelMenu; formatgrids FGSpesa = new formatgrids(gridSpesa); FGSpesa.AutosizeColumnWidth(); MetaData MEntrataView = Meta.Dispatcher.Get("incomeview"); MEntrataView.DescribeColumns(DS.incomeview, "autospesa"); HelpForm.SetDataGrid(gridEntrata, DS.incomeview); gridEntrata.ContextMenu = ExcelMenu; formatgrids FGEntrata = new formatgrids(gridEntrata); FGEntrata.AutosizeColumnWidth(); MetaData MVarSpesaView = Meta.Dispatcher.Get("expensevarview"); MVarSpesaView.DescribeColumns(DS.expensevarview, "autospesa"); HelpForm.SetDataGrid(gridVarSpesa, DS.expensevarview); gridVarSpesa.ContextMenu = ExcelMenu; formatgrids FGVarSpesa = new formatgrids(gridVarSpesa); FGVarSpesa.AutosizeColumnWidth(); MetaData MVarEntrataView = Meta.Dispatcher.Get("incomevarview"); MVarEntrataView.DescribeColumns(DS.incomevarview, "autoentrata"); HelpForm.SetDataGrid(gridVarEntrata, DS.incomevarview); gridVarEntrata.ContextMenu = ExcelMenu; formatgrids FGVarEntrata = new formatgrids(gridVarEntrata); FGVarEntrata.AutosizeColumnWidth(); HideEmpties(); }
private void btnCopyAll_Click(object sender, System.EventArgs e) { if (meta.IsEmpty) { return; } meta.DoMainCommand("mainsave"); DataRow CurrVar = HelpForm.GetLastSelected(DS.userenvironment); if (CurrVar == null) { return; } bool Restricted = false; if (MessageBox.Show("Si vuole limitare la copia ai soli utenti facenti parte " + "degli stessi gruppi dell'utente corrente?", "Opzioni", MessageBoxButtons.YesNo) == DialogResult.Yes) { Restricted = true; } string filterusers = null; vistaForm DS2 = new vistaForm(); ClearDataSet.RemoveConstraints(DS2); if (Restricted) { string grouplist = QueryCreator.ColumnValues(DS.customusergroup, null, "idcustomgroup", true); if (grouplist == "") { filterusers = "(idcustomuser is null)"; } else { filterusers = "(idcustomuser in (SELECT idcustomuser FROM customusergroup WHERE (idcustomgroup in (" + grouplist + "))))"; } } string filtervar = GetData.MergeFilters(filterusers, "(variablename=" + QueryCreator.quotedstrvalue(CurrVar["variablename"], true) + ")"); DataAccess.RUN_SELECT_INTO_TABLE(meta.Conn, DS2.customuser, null, filterusers, null, true); DataAccess.RUN_SELECT_INTO_TABLE(meta.Conn, DS2.userenvironment, null, filtervar, null, true); foreach (DataRow User in DS2.customuser.Rows) { DataRow[] UserVar = User.GetChildRows("customuseruserenvironment"); DataRow ThisVar; if ((UserVar == null) || (UserVar.Length == 0)) { ThisVar = DS2.userenvironment.NewRow(); ThisVar["idcustomuser"] = User["idcustomuser"]; ThisVar["variablename"] = CurrVar["variablename"]; DS2.userenvironment.Rows.Add(ThisVar); } else { ThisVar = UserVar[0]; } foreach (string fieldname in new string[] { "value", "flagadmin", "kind" }) { ThisVar[fieldname] = CurrVar[fieldname]; } } PostData PP = meta.Get_PostData(); PP.InitClass(DS2, meta.Conn); PP.DO_POST(); }