/// <summary> /// Metodo che restituisce il filtro che interrogherà la tabella di classificazione associata alla tabella tName /// </summary> /// <param name="tName">Nome della tabella principale</param> /// <param name="rSource">DataRow del foglio Excel</param> /// <returns></returns> private string costruisciFiltro(System.Data.DataTable tSortingKind, string tName, System.Data.DataRow rSource, out string sortField) { sortField = ""; // Dati del tipo di Classificazione impostata in WAGEIMPORTSETUP per la tabella tName if ((tSortingKind == null) || (tSortingKind.Rows.Count == 0)) { return(null); } DataRow rSorKind = tSortingKind.Rows[0]; // Costruzione del filtro // Attenzione: Nella tabella SORTINGKIND possono essere valorizzati i campi da labels1 a labels5 // Per ogni labels valorizzata il filtro sarà costruito sull'uguaglianza altrimenti sul NULL // Nella classificazione SPLITCONTR sono valorizzati i campi labels1..labels4 // Il primo campo indica il codice della ritenuta e quindi viene saltato dal ciclo // Gli altri 3 campi (labels2..labels4) contengono le coordinate presenti sul foglio Excel int MAXLABEL = 4; string fS = ""; for (int i = 2; i <= MAXLABEL; i++) { if (rSource.Table.Columns.Contains(rSorKind["labels" + i].ToString())) { sortField += "defaults" + i + ","; string colName = rSorKind["labels" + i].ToString(); if (colName != "") { fS = QHS.AppAnd(fS, QHS.NullOrEq("defaults" + i, rSource[colName])); } else { fS = QHS.AppAnd(QHS.IsNull("defaults" + i)); } } } if (sortField != "") { sortField = sortField.Substring(0, sortField.Length - 1); } // Il filtro prodotto sarà del tipo // (IDSORKIND = 'TIPOCLASSIFICAZIONE') AND ((DEFAULTS2 = 'AAA') OR (DEFAULTS2 IS NULL)) // AND ((DEFAULTS3 = 'BBB') OR (DEFAULTS3 IS NULL)) AND (DEFAULTS4 IS NULL) etc. return(fS); }
private void btnListino_Click(object sender, EventArgs e) { string filter = ""; MetaData Mlistino = MetaData.GetMetaData(this, "listview"); Mlistino.FilterLocked = true; Mlistino.DS = DS.Clone(); if (chkListDescription.Checked) { FrmAskDescr FR = new FrmAskDescr(Meta.Dispatcher); DialogResult D = FR.ShowDialog(this); if (D != DialogResult.OK) { return; } if (FR.Selected != null) { object idlistclass = FR.Selected["idlistclass"]; filter = QHC.AppAnd(filter, QHC.CmpEq("idlistclass", FR.Selected["idlistclass"])); } if (FR.txtDescrizione.Text != "") { string Description = FR.txtDescrizione.Text; if (!Description.EndsWith("%")) { Description += "%"; } if (!Description.StartsWith("%")) { Description = "%" + Description; } filter = QHC.AppAnd(filter, QHC.Like("description", Description)); } } filter = QHS.AppAnd(filter, QHS.NullOrEq("active", "S")); filter = QHS.AppAnd(filter, QHS.BitSet("flagvisiblekind", 1)); //bit 1: visibile nei c. passivi. BitSet confronta con <> 0 DataRow Choosen = Mlistino.SelectOne("default", filter, "listview", null); if (Choosen == null) { return; } riempiOggetti(Choosen); return; }
private void btnBilancio_Click(object sender, EventArgs e) { string filter; MetaData Meta = Disp.Get("finview"); int esercizio = (int)Meta.GetSys("esercizio"); string filterPart = QHS.BitClear("flag", 0); string filteridfin = QHS.AppAnd(QHS.CmpEq("ayear", esercizio), filterPart); //Il filtro sull'UPB c'è sempre if (cmbUpb.SelectedIndex > 0) { filter = QHS.CmpEq("idupb", cmbUpb.SelectedValue); } else { filter = QHS.CmpEq("idupb", "0001"); } filter = QHS.AppAnd(filteridfin, filter); //Aggiunge eventualmente il filtro sul disponibile if (chkFilterAvailable.Checked) { decimal currval = importo; filter = GetData.MergeFilters(filter, QHS.CmpGe("availableprevision", currval)); } string filteroperativo = "(idfin in (SELECT idfin from finusable where " + QHS.CmpEq("ayear", Meta.GetSys("esercizio")) + "))"; if (chkListTitle.Checked) { FrmAskDescr FR = new FrmAskDescr(0); DialogResult D = FR.ShowDialog(this); if (D != DialogResult.OK) { return; } filter = GetData.MergeFilters(filter, QHS.Like("title", "%" + FR.txtDescrizione.Text + "%")); Meta.FilterLocked = true; filter = GetData.MergeFilters(filter, filteroperativo); Selected = Meta.SelectOne("default", filter, "finview", null); riempiTextBox(Selected); return; } chiamaFormBilancio(filter); }
string GetFilterForLinking(QueryHelper QH) { int esercizio = (int)Meta.GetSys("esercizio"); return(QH.AppAnd(QH.IsNull("idf24ep"), QH.IsNotNull("fiscaltaxcode"), QH.Between("ytaxpay", esercizio - 1, esercizio))); }
private bool doVerify() { string filter = QHS.AppAnd(QHS.FieldIn("identrykind", new object [] { 5, 14, 15 }), // Risconto integrazione QHS.CmpEq("Year(adate)", Meta.GetSys("esercizio"))); int nrows = Meta.Conn.RUN_SELECT_COUNT("entry", filter, false); if (nrows > 0) { if (MessageBox.Show("Le scritture di Integrazione relative all''esercizio corrente risultano già generate. Si desidera proseguire comunque?", "Avviso", MessageBoxButtons.YesNo, MessageBoxIcon.Question) != DialogResult.Yes) { return(false); } } return(true); }
public void MetaData_BeforeFill() { if (DS.payrolltax.Rows.Count == 0) { return; } DataRow Curr = DS.payrolltax.Rows[0]; DataRow parentRowCedolino = Curr.GetParentRow("payrollpayrolltax"); if (parentRowCedolino == null) { return; } DataRow parentRow = DS.payrolltax.Rows[0].GetParentRow("taxpayrolltax"); if ((parentRow != null) && (parentRowCedolino != null)) { string natura = parentRowCedolino["flagbalance"].ToString().ToUpper() == "S" ? "C" : "R"; int tiporitenuta = CfgFn.GetNoNullInt32(parentRow["taxkind"]); grpConguaglio.Visible = (natura == "C") && (tiporitenuta == 1); string filterImponibile = QHS.AppAnd(QHS.CmpEq("taxablecode", parentRow["taxablecode"]), QHS.CmpEq("ayear", meta.GetSys("esercizio"))); object imponibile = meta.Conn.DO_READ_VALUE("taxablekind", filterImponibile, "description"); if (imponibile != null) { txtTipoImponibile.Text = imponibile.ToString(); } string geoAppliance = parentRow["geoappliance"].ToString().ToUpper(); object idCity = Curr["idcity"]; object idFiscalTaxRegion = Curr["idfiscaltaxregion"]; string nome = ""; if (idCity != DBNull.Value) { nome = meta.Conn.DO_READ_VALUE("geo_city", QHS.CmpEq("idcity", idCity), "title").ToString(); txtEnte.Text = nome; } else { if (idFiscalTaxRegion != DBNull.Value) { nome = meta.Conn.DO_READ_VALUE("fiscaltaxregion", QHS.CmpEq("idfiscaltaxregion", idFiscalTaxRegion), "title").ToString(); txtEnte.Text = nome; } else { lblEnte.Visible = false; txtEnte.Visible = false; } } } }
private void calcolaConsolidato() { DataRow Curr = DS.finyearview.Rows[0]; object idBilancio = Curr["idfin"]; string idupb = Curr["idupb"].ToString(); string filtro = QHS.DoPar(QHS.AppOr(QHS.CmpEq("idupb", idupb), "(paridupb LIKE '" + idupb + "%')")); filtro = QHS.AppAnd(filtro, QHS.CmpEq("idfin", idBilancio)); string expr = ""; foreach (string field in new string[] { "prevision", "secondaryprev", "previousprevision", "previoussecondaryprev", "currentarrears", "previousarrears", "prevision2", "prevision3", "prevision4", "prevision5" }) { if (expr != "") { expr += ","; } expr += "SUM(" + field + ") as " + field; } DataTable Tfinyearview = Meta.Conn.SQLRunner("SELECT " + expr + " FROM finyearview WHERE " + filtro, false); decimal previsioneCorr = 0; decimal previsioneSecCorr = 0; decimal previsionePrec = 0; decimal previsioneSecPrec = 0; decimal residuiCorr = 0; decimal residuiPrec = 0; decimal previsioneAnno2 = 0; decimal previsioneAnno3 = 0; decimal previsioneAnno4 = 0; decimal previsioneAnno5 = 0; foreach (DataRow rFinYear in Tfinyearview.Select()) { previsioneCorr += (decimal)isNull(rFinYear["prevision"], 0m); previsioneSecCorr += (decimal)isNull(rFinYear["secondaryprev"], 0m); previsionePrec += (decimal)isNull(rFinYear["previousprevision"], 0m); previsioneSecPrec += (decimal)isNull(rFinYear["previoussecondaryprev"], 0m); residuiCorr += (decimal)isNull(rFinYear["currentarrears"], 0m); residuiPrec += (decimal)isNull(rFinYear["previousarrears"], 0m); previsioneAnno2 += (decimal)isNull(rFinYear["prevision2"], 0m); previsioneAnno3 += (decimal)isNull(rFinYear["prevision3"], 0m); previsioneAnno4 += (decimal)isNull(rFinYear["prevision4"], 0m); previsioneAnno5 += (decimal)isNull(rFinYear["prevision5"], 0m); } txtPrevisionePrincipaleCorrConsolidato.Text = previsioneCorr.ToString("c"); txtPrevisioneSecondariaCorrConsolidato.Text = previsioneSecCorr.ToString("c"); txtPrevisionePrincipalePrecConsolidato.Text = previsionePrec.ToString("c"); txtPrevisioneSecondariaPrecConsolidato.Text = previsioneSecPrec.ToString("c"); txtResiduiCorrConsolidato.Text = residuiCorr.ToString("c"); txtResiduiPrecConsolidato.Text = residuiPrec.ToString("c"); txtPrevisione2Consolidato.Text = previsioneAnno2.ToString("c"); txtPrevisione3Consolidato.Text = previsioneAnno3.ToString("c"); txtPrevisione4Consolidato.Text = previsioneAnno4.ToString("c"); txtPrevisione5Consolidato.Text = previsioneAnno5.ToString("c"); }
public FrmAskBilancio(object upbParent, object finParent, decimal importoLiquidazione, MetaDataDispatcher Disp, DataAccess Conn) { InitializeComponent(); QHC = new CQueryHelper(); QHS = Conn.GetQueryHelper(); this.upbParent = upbParent; this.finParent = finParent; this.Disp = Disp; this.Conn = Conn; this.importo = importoLiquidazione; MetaUpb = Disp.Get("upb"); Meta = Disp.Get("finview"); finview = DataAccess.CreateTableByName(Conn, "finview", "*"); upb = DataAccess.CreateTableByName(Conn, "upb", "*"); GetData.MarkToAddBlankRow(upb); GetData.Add_Blank_Row(upb); DataAccess.RUN_SELECT_INTO_TABLE(Conn, upb, null, null, null, true); cmbUpb.DataSource = upb; cmbUpb.ValueMember = "idupb"; cmbUpb.DisplayMember = "codeupb"; if (upbParent != DBNull.Value) { string filterUpb = QHC.CmpEq("idupb", upbParent); DataRow UPBRow = upb.Select(filterUpb)[0]; txtDescrizioneUpb.Text = UPBRow["title"].ToString(); HelpForm.SetComboBoxValue(cmbUpb, upbParent); if (finParent != DBNull.Value) { string filterFinView = QHS.AppAnd(QHS.CmpEq("idfin", finParent), QHS.CmpEq("idupb", upbParent)); DataAccess.RUN_SELECT_INTO_TABLE(Conn, finview, null, filterFinView, null, true); if (finview.Rows.Count > 0) { DataRow finRow = finview.Rows[0]; txtCodiceBilancio.Text = finRow["codefin"].ToString(); txtDenominazioneBilancio.Text = finRow["title"].ToString(); } } } responsabile = DataAccess.CreateTableByName(Meta.Conn, "manager", "*"); GetData.MarkToAddBlankRow(responsabile); GetData.Add_Blank_Row(responsabile); DataAccess.RUN_SELECT_INTO_TABLE(Conn, responsabile, null, null, null, true); cmbResponsabile.DataSource = responsabile; cmbResponsabile.ValueMember = "idman"; cmbResponsabile.DisplayMember = "title"; Selected = null; }
public void MetaData_AfterRowSelect(DataTable T, DataRow R) { if (T.TableName == "fin") { if (R != null) { DataRow Curr = DS.finyearview.Rows[0]; Curr["codefin"] = R["codefin"]; Curr["finance"] = R["title"]; Curr["paridfin"] = R["paridfin"]; Curr["flag"] = R["flag"]; Curr["nlevel"] = R["nlevel"]; int flag = CfgFn.GetNoNullInt32(R["flag"]); object finpart = DBNull.Value; if ((flag & 1) == 1) { finpart = "S"; } else { finpart = "E"; } Curr["finpart"] = finpart; string filterfinlevel = QHS.AppAnd(QHS.CmpEq("ayear", Meta.Conn.GetSys("esercizio")), QHS.CmpEq("nlevel", R["nlevel"])); object leveldescr = Meta.Conn.DO_READ_VALUE("finlevel", filterfinlevel, "description"); Curr["leveldescr"] = leveldescr; } } }
private object ricavaDescrizioneCassiere(object sottoconto) { if (sottoconto.ToString().Trim() == "") { return(DBNull.Value); } if (sottoconto.ToString() == "0") { return(DBNull.Value); } object treasurer = Conn.DO_READ_VALUE("treasurer", QHS.AppAnd(QHS.CmpEq("trasmcode", sottoconto), QHS.BitClear("flag", 0)), "description"); if (treasurer == null) { treasurer = DBNull.Value; } return(treasurer); }
private void btnFase1_Click(object sender, System.EventArgs e) { int esercizio = CfgFn.GetNoNullInt32(Meta.GetSys("esercizio")); int Nvar = Meta.Conn.RUN_SELECT_COUNT("assetvar", QHS.AppAnd(QHS.BitClear("flag", 0), QHS.CmpEq("yvar", esercizio + 1)), false); if (Nvar > 0) { MessageBox.Show("Esiste già una variazione iniziale nell'anno successivo. Operazione vietata."); return; } string filtro = QHS.AppAnd( QHS.CmpEq("year(adate)", Meta.GetSys("esercizio")), QHS.BitSet("flag", 0), QHS.IsNull("idassetunload")); //DataTable t = Meta.Conn.RUN_SELECT("assetamortization", null, null, filtro, null, true); //if (t.Rows.Count > 0) { // string messaggio = "La procedura potrebbe effettuare ammortamenti anche ove il valore, sommato agli ammortamenti non inclusi in buoni di scarico, diventi minore di zero, causando incongruenze." // + "\nSi intende procedere ugualmente?"; // DialogResult dr = MessageBox.Show(this, messaggio, "Avviso", MessageBoxButtons.YesNoCancel); // if (dr != DialogResult.Yes) return; //} string includi = "N"; if (MessageBox.Show(this, "Si vogliono marcare gli ammortamenti come da 'Includere in buono di scarico'?", "Richiesta informazioni", MessageBoxButtons.YesNo) == DialogResult.Yes) { includi = "S"; } DataSet app = Meta.Conn.CallSP("closeyear_asset_ammortization", new object[] { esercizio, includi }, false, 600); if (!(app == null)) { MessageBox.Show("Ammortamento dei Cespiti Eseguita Con Successo!"); } else { MessageBox.Show("Errori nell'ammortamento"); } }
private bool CheckComune(string comune, string sigla, string codice, out string errori, out object cod_catastale) { comune = comune.ToUpper(); int count = 0; cod_catastale = DBNull.Value; string filter = ""; if (codice != "") { filter = QHS.AppAnd(QHS.CmpEq("codename", "fiscale"), QHS.CmpEq("value", codice), QHS.IsNull("stop"), QHS.IsNull("newcity")); count = Conn.RUN_SELECT_COUNT("geo_city_agencyview", filter, false); } // la provincia non deve essere obbligatoria if (count != 1) { filter = QHS.AppAnd(QHS.CmpEq("codename", "fiscale"), QHS.CmpEq("title", comune), QHS.IsNull("stop")); count = Conn.RUN_SELECT_COUNT("geo_city_agencyview", filter, false); if ((count != 1) && (sigla != "")) { filter = QHS.AppAnd(filter, QHS.CmpEq("provincecode", sigla)); count = Conn.RUN_SELECT_COUNT("geo_city_agencyview", filter, false); } } errori = ""; if (count == 1) { cod_catastale = Conn.DO_READ_VALUE("geo_city_agencyview", filter, "value"); return(true); } if (count == 0) { errori = "Comune non trovato"; } if (count > 1) { errori = "Trovato più di un comune"; } return(false); }
string GetFasePrecFilter(bool FiltraNumMovimento) { string ffase = ""; string MyFilter = QHS.AppAnd(ffase, QHS.CmpEq("ayear", Meta.GetSys("esercizio"))); if (txtEsercizioMovimento.Text.Trim() != "") { MyFilter = QHS.AppAnd(MyFilter, QHS.CmpEq("ymov", txtEsercizioMovimento.Text.Trim())); } if ((FiltraNumMovimento) && (txtNumeroMovimento.Text.Trim() != "")) { MyFilter = QHS.AppAnd(MyFilter, QHS.CmpEq("nmov", txtNumeroMovimento.Text.Trim())); } MyFilter = QHS.AppAnd(MyFilter, "(NOT EXISTS(SELECT * FROM authpaymentexpense " + " WHERE authpaymentexpense.idexp = expenseview.idexp))"); return(MyFilter); }
public string BuildFilter() { DataAccess sys = GetSystemDB(); QueryHelper QHS = sys.GetQueryHelper(); string filter = ""; string login = Request.Form["txtlogin"].ToString(); string cognome = Request.Form["txtCognome"].ToString(); string nome = Request.Form["txtNome"].ToString(); string cf = Request.Form["txtCf"].ToString(); string coddip = Request.Form["txtcoddip"].ToString(); string custuser = Request.Form["txtcustuser"].ToString(); string userkind = Request.Form["userkind"].ToString(); string email = Request.Form["txtEmail"].ToString(); if (login != "") { filter = QHS.Like("username", "%" + login + "%"); } if (cognome != "") { filter = QHS.AppAnd(filter, QHS.Like("surname", "%" + cognome + "%")); } if (nome != "") { filter = QHS.AppAnd(filter, QHS.Like("forename", "%" + nome + "%")); } if (email != "") { filter = QHS.AppAnd(filter, QHS.CmpEq("email", email)); } if (cf != "") { filter = QHS.AppAnd(filter, QHS.Like("cf", "%" + cf + "%")); } if (coddip != "") { filter = QHS.AppAnd(filter, QHS.CmpEq("codicedipartimento", coddip)); } if (custuser != "") { filter = QHS.AppAnd(filter, QHS.CmpEq("sys_user", custuser)); } if (userkind != "") { filter = QHS.AppAnd(filter, QHS.CmpEq("userkind", userkind)); } return(filter); }
private void rdbEntrata_CheckedChanged(object sender, EventArgs e) { if (rdbEntrata.Checked) { string filter = QHS.AppAnd(QHS.CmpEq("idupb", "0001"), QHS.CmpEq("finpart", "E")); DS.finview.ExtendedProperties[MetaData.ExtraParams] = filter; btnBilancio.Tag = "manage.finview.treeeupb." + filter; gboxBilancio.Tag = "AutoManage.txtCodiceBilancio.treealle." + filter; Meta.SetAutoMode(gboxBilancio); } if (!Meta.DrawStateIsDone) { return; } DS.finview.Clear(); if (Meta.IsEmpty) { return; } }
void calcolaSearchCondition() { string filter = null; if (cmbModuli.SelectedIndex > 0) { filter = QHS.AppAnd(filter, QHS.CmpEq("modulename", cmbModuli.SelectedItem)); } Meta.additional_search_condition = filter; }
public void MetaData_AfterLink() { Meta = MetaData.GetMetaData(this); Conn = Meta.Conn; QHC = new CQueryHelper(); QHS = Meta.Conn.GetQueryHelper(); GetData.CacheTable(DS.expensephase, QHS.AppAnd(QHS.CmpNe("nphase", Meta.GetSys("maxexpensephase")), QHS.CmpGe("nphase", Meta.GetSys("expensefinphase"))), "nphase", true); HelpForm.SetDenyNull(DS.csa_contracttaxexpense.Columns["idexp"], true); }
public void MetaData_AfterLink() { Meta = MetaData.GetMetaData(this); QHC = new CQueryHelper(); QHS = Meta.Conn.GetQueryHelper(); esercizio = (int)Meta.GetSys("esercizio"); string filterEsercizio = QHS.CmpEq("ayear", esercizio); string filterPay = QHS.CmpEq("ypay", esercizio); string filterPro = QHS.CmpGe("ypro", esercizio); string filtroSpesa = QHS.AppAnd(QHS.CmpEq("nphase", Meta.GetSys("maxexpensephase")), QHS.IsNotNull("idpay")); filtroSpesa = GetData.MergeFilters(filterEsercizio, filtroSpesa); GetData.SetStaticFilter(DS.expenseview, filtroSpesa); GetData.SetStaticFilter(DS.payment, filterPay); GetData.SetStaticFilter(DS.proceeds, filterPro); GetData.SetStaticFilter(DS.sortingview, filterEsercizio); object nomeFaseS = Meta.Conn.DO_READ_VALUE("expensephase", QHS.CmpEq("nphase", Meta.GetSys("maxexpensephase")), "description"); string faseS = (nomeFaseS != null) ? nomeFaseS.ToString() : ""; grpSpesa.Text = faseS; btnSpesa.Text = faseS; standardTagBtnMandato = HelpForm.GetStandardTag(btnMandato.Tag); standardTagBtnSpesa = HelpForm.GetStandardTag(btnSpesa.Tag); string filtroEntrata = QHS.AppAnd(QHS.CmpEq("nphase", Meta.GetSys("maxincomephase")), QHS.IsNotNull("idpro")); filtroEntrata = GetData.MergeFilters(filterEsercizio, filtroEntrata); GetData.SetStaticFilter(DS.incomeview, filtroEntrata); object nomeFaseE = Meta.Conn.DO_READ_VALUE("incomephase", QHS.CmpEq("nphase", Meta.GetSys("maxincomephase")), "description"); string faseE = (nomeFaseE != null) ? nomeFaseE.ToString() : ""; grpEntrata.Text = faseE; btnEntrata.Text = faseE; standardTagBtnReversale = HelpForm.GetStandardTag(btnReversale.Tag); standardTagBtnEntrata = HelpForm.GetStandardTag(btnEntrata.Tag); btnCollegaBankImport.Tag = btnCollegaBankImport.Tag + "." + QHS.DoPar(QHS.CmpEq("ayear", Meta.GetSys("esercizio"))); }
public void MetaData_AfterLink() { Meta = MetaData.GetMetaData(this); QHC = new CQueryHelper(); QHS = Meta.Conn.GetQueryHelper(); GetData.SetSorting(DS.payrollview, "idcon, fiscalyear, npayroll"); GetData.SetStaticFilter(DS.payrollview, QHS.AppAnd(QHS.CmpEq("flagcomputed", 'N'), QHS.CmpEq("fiscalyear", Meta.GetSys("esercizio")), QHS.CmpLe("start", Meta.GetSys("datacontabile")), QHS.CmpEq("year(stop)", Meta.GetSys("esercizio")), QHS.CmpEq("flagbalance", 'N'))); HelpForm.SetAllowMultiSelection(DS.payrollview, true); }
public static string GetEmaiAddressForRegistry(DataAccess Conn, object idreg) { QueryHelper QHS = Conn.GetQueryHelper(); object email = Conn.DO_READ_VALUE("registryreference", QHS.AppAnd(QHS.CmpEq("idreg", idreg), QHS.CmpEq("flagdefault", "S")), "email"); if (email == null) { return(""); } return(email.ToString()); }
void AggiornaElencoDipartimenti() { if (Conn == null) { return; } int userkind = 5; string NomeUtente = txtNomeUtente.Text; QueryHelper QHS = Conn.GetQueryHelper(); /* * this.SetFocus(txtPassword); * txtPassword.Attributes.Add("value", txtPassword.Text); */ /* * ldapauth lauth = new ldapauth(Conn); * if (!lauth.getconfig()) return; */ //Deve riempire il combo dei dipartimenti in base al nome dell'utente filtrando anche userkind=4 string filter = QHS.AppAnd( //QHS.CmpEq("email", NomeUtente), QHS.CmpEq("username", NomeUtente), QHS.CmpEq("userkind", userkind) ); // prelevare l'idflowchart e poi fare la connecttodepartment DataTable virtualuser = Conn.RUN_SELECT("virtualuser", "*", null, filter, null, false); if (virtualuser == null || virtualuser.Rows.Count == 0) { cmbDipartimento.DataSource = null; cmbDipartimento.Items.Clear(); return; } string filterdip = QHS.FieldIn("CodiceDipartimento", virtualuser.Select(), "codicedipartimento"); DataTable Dip = Conn.RUN_SELECT("CodiciDipartimenti", "*", null, filterdip, null, true); cmbDipartimento.DataSource = Dip; cmbDipartimento.DataTextField = "Dipartimento"; cmbDipartimento.DataValueField = "CodiceDipartimento"; cmbDipartimento.DataBind(); if (virtualuser.Rows.Count == 1) { cmbDipartimento.SelectedIndex = 0; } }
string CalculateFilterForLinking(bool SQL) { QueryHelper qh = SQL ? QHS : QHC; string MyFilter = ""; object idreg = DS.ddt_in.Rows[0]["idreg"]; object idstore = DS.ddt_in.Rows[0]["idstore"]; //MyFilter = qh.AppAnd(qh.IsNull("idddt_in"), qh.IsNotNull("idlist")) ; MyFilter = qh.IsNotNull("idlist"); if (idreg != DBNull.Value) { MyFilter = qh.AppAnd(MyFilter, qh.CmpEq("idreg", idreg)); } if (idstore != DBNull.Value) { MyFilter = qh.AppAnd(MyFilter, qh.CmpEq("idstore", idstore)); } MyFilter = qh.AppAnd(MyFilter, qh.NullOrEq("isrequest", "N")); return(MyFilter); }
void ImpostaFiltrobtnSelezBene(DataRow AssetPiece, bool filtraIdPiece) { string filtro = (AssetPiece == null) ? "" : "." + QHS.CmpMulti(AssetPiece, "idinventory"); btnSelezBene.Tag = "choose.assetpieceview.default" + filtro; if (AssetPiece != null && filtraIdPiece) { filtro = QHS.AppAnd(filtro, QHS.CmpMulti(AssetPiece, "idpiece")); btnSelezBene.Tag = "choose.assetpieceview.default" + filtro; if (MyAutoInfo != null) { MyAutoInfo.startfilter = QHS.AppAnd(QHS.IsNull("idassetunload"), QHS.CmpMulti(AssetPiece, "idpiece")); } } else { if (MyAutoInfo != null) { MyAutoInfo.startfilter = QHS.IsNull("idassetunload"); } } }
void riempiGrid() { //DS2.Clear(); // CONTROLLARE CHE IL Clear() DI QUESTE TABELLE SIA CORRETTO !!!! (Sara) DS2.expense.Clear(); DS2.expenseyear.Clear(); DS2.expensetotal.Clear(); DS2.expensesorted.Clear(); DS2.expenseview.Clear(); DS2.lessexpenseview.Clear(); // Filtro tutti i mov. di spesa che hanno una variazione // con tipoautomatismo ECONO e che non sono presenti in alcun idparent string filterRiporti = QHS.AppAnd(QHS.CmpEq("ayear", oldYear), QHS.IsNull("idchild")); DataAccess.RUN_SELECT_INTO_TABLE(Meta.Conn, DS2.lessexpenseview, null, filterRiporti, null, true); DataAccess.RUN_SELECT_INTO_TABLE(Meta.Conn, DS2.expensephase, null, null, null, true); foreach (DataColumn C in DS2.lessexpenseview.Columns) { C.Caption = ""; } DS2.lessexpenseview.Columns["phase"].Caption = "Fase"; DS2.lessexpenseview.Columns["nmov"].Caption = "Num. Mov."; DS2.lessexpenseview.Columns["ymov"].Caption = "Eserc. Mov."; DS2.lessexpenseview.Columns["codefin"].Caption = "Bilancio Eserc. Prec."; DS2.lessexpenseview.Columns["upb"].Caption = "UPB"; DS2.lessexpenseview.Columns["underwriting"].Caption = "Finanziamento"; DS2.lessexpenseview.Columns["registry"].Caption = "Creditore"; DS2.lessexpenseview.Columns["amount"].Caption = "Importo"; DS2.lessexpenseview.Columns["variationamount"].Caption = "Importo Variato"; DS2.lessexpenseview.Columns["curramount"].Caption = "Importo Corrente"; DS2.lessexpenseview.Columns["available"].Caption = "Disponibile"; if (dgMovSpesa.DataSource == null) { HelpForm.SetDataGrid(dgMovSpesa, DS2.lessexpenseview); new formatgrids(dgMovSpesa).AutosizeColumnWidth(); } }
private bool LeggiFlagEsenteBancaPredefinita() { DataTable tTreasurer = Meta.Conn.RUN_SELECT("treasurer", "*", null, QHS.AppAnd(QHS.CmpEq("flagdefault", "S"), QHS.BitSet("flag", 1)), null, false); if (tTreasurer.Rows.Count == 0) { return(false); } else { return(true); } }
protected void btndel_Click(object sender, EventArgs e) { if (((SystemDBIsConnected() == false) || Session["DBUserConn"] == null)) { return; } DataAccess sys = GetSystemDB(); QueryHelper QHS = sys.GetQueryHelper(); DataSet DS = new vistaForm_virtualuser(); DataTable T = DS.Tables["virtualuser"]; string login = Request.Form["txtlogin"].ToString(); string cognome = Request.Form["txtCognome"].ToString(); string nome = Request.Form["txtNome"].ToString(); string cf = Request.Form["txtCf"].ToString(); string coddip = Request.Form["txtcoddip"].ToString(); string custuser = Request.Form["txtcustuser"].ToString(); string userkind = Request.Form["userkind"].ToString(); string filter = QHS.AppAnd(QHS.CmpEq("userkind", userkind), QHS.CmpEq("codicedipartimento", coddip), QHS.CmpEq("username", login)); sys.RUN_SELECT_INTO_TABLE(T, null, filter, null, false); if (T == null || T.Rows.Count == 0) { lblError.Text = "Record inesistente"; return; } DataRow DR = T.Rows[0]; DR.Delete(); PostData PD = new PostData(); PD.InitClass(DS, sys); ProcedureMessageCollection MCOLL = PD.DO_POST_SERVICE(); if (!MCOLL.CanIgnore) { lblError.Text = "Delle regole di sicurezza hanno impedito l'update del db di sistema!!"; return; } PD.DO_POST_SERVICE(); lblError.Text = "<p style=\"color: blue;\">Utente '" + login + "' Eliminato.</p>"; EmptyForm(false); }
public void MetaData_AfterLink() { Meta = MetaData.GetMetaData(this); QHS = Meta.Conn.GetQueryHelper(); string filterCT = QHS.CmpEq("tablename", "mandate"); GetData.CacheTable(DS.sortingapplicabilityview, filterCT, null, true); string filterActive = QHS.DoPar(QHS.AppOr(QHS.NullOrEq("active", 'S'), QHS.CmpEq("active", ""))); string filterI = QHS.DoPar(QHS.AppOr(QHS.DoPar(QHS.AppAnd(QHS.NullOrLe("start", Meta.GetSys("esercizio")), QHS.NullOrGe("stop", Meta.GetSys("esercizio")), filterActive, filterCT)), QHS.CmpEq("idsorkind", 0))); QueryCreator.SetFilterForInsert(DS.sortingapplicabilityview, filterI); }
string CalculateFilterForLinking(bool SQL, DataAccess Conn, object idstore) { CQueryHelper QHC = new CQueryHelper(); QueryHelper QHS = Conn.GetQueryHelper(); QueryHelper qh = SQL ? QHS : QHC; string MyFilter = ""; if (idstore != DBNull.Value) { MyFilter = qh.AppAnd(MyFilter, qh.CmpEq("idstore", idstore)); } return(MyFilter); }
string CalculateFilterForLinking(bool SQL) { QueryHelper qh = SQL ? QHS : QHC; string MyFilter = ""; object idstore = DS.storeunload.Rows[0]["idstore"]; if (idstore != DBNull.Value) { MyFilter = qh.AppAnd(MyFilter, qh.CmpEq("idstore", idstore)); } return(MyFilter); }
private void assegnaClass(DataRow r, int nSor) { if ((tExpenseSetup == null) || (tExpenseSetup.Rows.Count == 0)) { return; } DataRow rExp = tExpenseSetup.Rows[0]; string filterC = QHC.AppAnd(QHC.CmpEq("idsorkind", rExp["idsorkind" + nSor]), QHC.CmpEq("idsor", r["idsor" + nSor])); string filterSQL = QHS.AppAnd(QHS.CmpEq("idsorkind", rExp["idsorkind" + nSor]), QHS.CmpEq("idsor", r["idsor" + nSor])); fill(r, filterC, filterSQL, tSorting, "!class" + nSor, "sortcode"); }