protected override void AddQueryControls(VLayoutPanel vPanel) { vPanel.Add(CreateDefaultBillQueryControls((panel, config) => { panel.Add("Time", QueryCreator.DateRange(mDFInfo.Fields["Time"], mQueryContainer, "MinTime", "MaxTime")); panel.Add("AccountingUnit_ID", QueryCreator.DFChoiceBox(mDFInfo.Fields["AccountingUnit_ID"], DataKind.授权会计单位全部)); panel.Add("Department_ID", QueryCreator.DFChoiceBox(mDFInfo.Fields["Department_ID"], DataKind.授权部门全部)); panel.Add("Employee_ID", QueryCreator.DFChoiceBox(mDFInfo.Fields["Employee_ID"], DataKind.授权员工全部)); config.AddAfter("Time", "ID"); config.AddAfter("AccountingUnit_ID", "Time"); config.AddAfter("Department_ID", "AccountingUnit_ID"); config.AddAfter("Employee_ID", "Department_ID"); })); }
public void MetaData_AfterLink() { Meta = MetaData.GetMetaData(this); QHS = Meta.Conn.GetQueryHelper(); string filterCT = QHS.CmpEq("tablename", "inventorytree"); 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); }
private void btnAllega_Click(object sender, EventArgs e) { if (Meta.IsEmpty) { return; } DataRow Curr = DS.registrycvattachment.Rows[0]; opendlg.Title = "Seleziona l'allegato"; try { if (opendlg.ShowDialog(this) != DialogResult.OK) { return; } } catch (Exception E) { QueryCreator.ShowException(E); return; } FileStream FS; try { FS = new FileStream(opendlg.FileName, FileMode.Open, FileAccess.Read); } catch (Exception E) { QueryCreator.ShowException("Errore nell'apertura del file " + opendlg.FileName, E); return; } int n = (int)FS.Length; if (n == 0) { Curr["attachment"] = DBNull.Value; return; } byte[] ByteArray = new byte[n]; FS.Read(ByteArray, 0, n); if (FS.Length == 0) { Curr["attachment"] = DBNull.Value; } FS.Close(); Curr["attachment"] = ByteArray; string fname = Path.GetFileName(opendlg.FileName); labAutocertFileName.Text = fname; Curr["filename"] = fname; }
/// <summary> /// Aggiorna l'indice locale ad aggiornamento avvenuto, il file client se di tipo /// client, la tabella se di tipo server, entrambi se di tipo misto /// </summary> /// <param name="R">Riga che identifica l'aggiornamento</param> /// <returns>True se va abuon fine</returns> private bool AggiornaIndiceLocale(DataRow R) { string codice = R["code"].ToString(); string filter = "code=" + QueryCreator.quotedstrvalue(codice, false); string tipo = R["flagkind"].ToString(); DataRow[] Rfiles = DSremote.Tables["fileupdate"].Select(filter); string lista = ""; foreach (DataRow Rfile in Rfiles) { lista += Rfile["filename"].ToString() + "|"; } try { switch (tipo.ToUpper()) { case "C": if (!RowExists(DSclient.update, R["code"])) { ScriviRigaClient(R, lista); } break; case "S": if (!RowExists(DS.ondemand, R["code"])) { ScriviRigaServer(R, lista); } break; default: if (!RowExists(DSclient.update, R["code"])) { ScriviRigaClient(R, lista); } if (!RowExists(DS.ondemand, R["code"])) { ScriviRigaServer(R, lista); } break; } return(true); } catch (Exception E) { ShowMsg("Errore nell'aggiornamento indice locale relativo al codice " + codice, E.Message); return(false); } }
public void MetaData_AfterRowSelect(DataTable T, DataRow R) { if (T.TableName == "customobject") { if (R == null) { return; } string filtro = "(tablename=" + QueryCreator.quotedstrvalue(R["objectname"].ToString(), true) + ")"; SetListview(filtro); } if (T.TableName == "journaltablesetup") { if (R == null) { return; } string filtro = "(tablename=" + QueryCreator.quotedstrvalue(R["tablename"].ToString(), true) + ")"; SetListview(filtro); foreach (object LVIO in listViewLog.Items) { ListViewItem LVI = (ListViewItem)LVIO; LVI.Checked = false; } listViewLog.Refresh(); if (!Meta.IsEmpty) { string filter = "(tablename=" + QueryCreator.quotedstrvalue(R["tablename"].ToString() , true) + " AND opkind=" + QueryCreator.quotedstrvalue(R["opkind"].ToString(), true) + ")"; foreach (DataRow RT in DS.journalfieldsetup.Select(filter)) { foreach (object LVIO in listViewLog.Items) { ListViewItem LVI = (ListViewItem)LVIO; DataRow P2Row = (DataRow)LVI.Tag; if (P2Row["field"].ToString() == RT["dbfield"].ToString()) { LVI.Checked = true; } } listViewLog.Refresh(); } } } }
private void FrmViewReport_Load(object sender, System.EventArgs e) { try { ReportPages = 0; ReportPageRequestContext oPageContext = new ReportPageRequestContext(); ReportPages = ReportDoc.FormatEngine.GetLastPageNumber(oPageContext); AbilitaPageNavigator(ReportPages > 1); } catch (Exception E) { meta.LogError("Errore nel calcolo della stampa con i parametri:\r\n" + elencoparametri, E); QueryCreator.ShowException("Errore nel calcolo della stampa", E); AbilitaPageNavigator(false); errore = true; } isInited = true; }
private void btnControlli_Click(object sender, System.EventArgs e) { DataRow CurrBusiness = HelpForm.GetLastSelected(DS.audit); if (CurrBusiness == null) { return; } MetaData MetaRule = MetaData.GetMetaData(this, "auditcheck"); MetaRule.StartFilter = "(idaudit=" + QueryCreator.quotedstrvalue(CurrBusiness["idaudit"], true) + ")"; MetaRule.ExtraParameter = CurrBusiness["idaudit"]; MetaRule.Edit(this.ParentForm, "child", false); MetaRule.DoMainCommand("maindosearch.default"); }
public static StreamReader getStreamReader(long quoziente, string fname) { FileInfo fi = new FileInfo(fname); long dimensione = fi.Length; long modulo = fi.Length % quoziente; if (modulo > 0) { QueryCreator.ShowError(null, "La dimensione del file non è un multiplo di " + quoziente, "Errore di dimensione del file"); return(null); } else { return(new StreamReader(new BufferedStream(new FileStream(fname, FileMode.Open), 1048576), Encoding.Default)); } }
public long leggiLong(TextReader tr, int numCifre) { if (tr.Read(buffer, 0, numCifre) != numCifre) { QueryCreator.ShowError(form, "ERRORE DURANTE LA LETTURA DEL FILE", "Letti meno byte rispetto al previsto"); } string s = new string(buffer, 0, numCifre); try { return(long.Parse(s)); } catch (Exception e) { QueryCreator.ShowException(form, "ERRORE DURANTE LA LETTURA DI UN LONG DAL FILE\r\n" + s, e); } return(0); }
public void AddFillMethod(string className, DbTable table) { var name = NameProvider.ToParameterName(table.Name); _buffer.AppendLine(string.Format(@"public void Fill({0} {1})", GetDictionaryField(className), name)); this.BeginBlock(); _buffer.AppendLine(this.GetParameterCheck(name)); this.AddEmptyLine(); _buffer.AppendLine(string.Format(@"var query = @""{0}"";", QueryCreator.GetSelect(table).Statement)); this.AddEmptyLine(); _buffer.AppendLine(string.Format(@"QueryHelper.Fill({0}, query, this.Creator, this.Selector);", name)); this.EndBlock(); }
private string BuildNomeFile(char progressivo) { //ITDMSCSM79S19C975E_DF_20171.xml //IT80006510806_DF_20171.xml DataTable dtLicense = Conn.RUN_SELECT("license", "cf, p_iva", null, null, null, false); if (dtLicense == null || dtLicense.Rows.Count == 0) { QueryCreator.ShowError(this, "Errore del database nel reperire informazioni dalla licenza.", Conn.LastError); return(""); } var license = dtLicense.First(); var codiceFiscale = license.Field <string>("cf"); var partitaIVA = license.Field <string>("p_iva"); int esercizio = (int)HelpForm.GetObjectFromString(typeof(int), txtEsercizio.Text.ToString(), "x.y.year"); string esercizioStr = esercizio.ToString().Substring(2, 2); //object trimestre = cmbTrimestre.SelectedValue; object mese = cmbMese.SelectedValue; object periodo = DBNull.Value; //if(trimestre != DBNull.Value) periodo = trimestre; else periodo = mese; object kind_registry; if (rdbA.Checked) { kind_registry = 'F';//per gli Acquisti mettiamo la F a indicare che si tratta di Fornitore } else { kind_registry = 'C';//per le Vendite mettiamo la V a indicare che si tratta di Cliente } string NomeFile = ""; if (codiceFiscale != "") { NomeFile = "IT" + codiceFiscale + "_" + "DF_" + kind_registry + esercizioStr.ToString() + progressivo + periodo.ToString(); } else { NomeFile = "IT" + partitaIVA + "_" + "DF_" + kind_registry + esercizioStr.ToString() + progressivo + periodo.ToString(); } return(NomeFile); }
public void MetaData_AfterLink() { Meta = MetaData.GetMetaData(this); Conn = Meta.Conn; CQueryHelper QHC = new CQueryHelper(); QHS = Meta.Conn.GetQueryHelper(); string filterDepartment = QHS.CmpEq("iddbdepartment", Meta.GetSys("userdb")); DataTable tDBAccess = Meta.Conn.CreateTableByName("dbaccess", "*"); Meta.Conn.RUN_SELECT_INTO_TABLE(tDBAccess, null, filterDepartment, null, false); string loginNameList = QueryCreator.ColumnValues(tDBAccess, null, "login", true); string filterCustomUser = QHS.FieldInList("username", loginNameList); string Autochoose = "AutoChoose.txtUtente.default."; string Choose = "choose.customuser.default."; grpUser.Tag = Autochoose + filterCustomUser; btnUser.Tag = Choose + filterCustomUser; Meta.SetAutoMode(grpUser); DataAccess.SetTableForReading(DS.sorting01, "sorting"); DataAccess.SetTableForReading(DS.sorting02, "sorting"); DataAccess.SetTableForReading(DS.sorting03, "sorting"); DataAccess.SetTableForReading(DS.sorting04, "sorting"); DataAccess.SetTableForReading(DS.sorting05, "sorting"); DataTable tUniConfig = Conn.RUN_SELECT("uniconfig", "*", null, null, null, null, true); if ((tUniConfig != null) && (tUniConfig.Rows.Count > 0)) { DataRow r = tUniConfig.Rows[0]; object idsorkind1 = r["idsorkind01"]; object idsorkind2 = r["idsorkind02"]; object idsorkind3 = r["idsorkind03"]; object idsorkind4 = r["idsorkind04"]; object idsorkind5 = r["idsorkind05"]; CfgFn.SetGBoxClass0(this, 1, idsorkind1); CfgFn.SetGBoxClass0(this, 2, idsorkind2); CfgFn.SetGBoxClass0(this, 3, idsorkind3); CfgFn.SetGBoxClass0(this, 4, idsorkind4); CfgFn.SetGBoxClass0(this, 5, idsorkind5); } }
private void fillUserEnvironment(object idcustomuser, DataTable tSecurityVar, DataTable tUserEnvironment) { if (idcustomuser == null) { return; } if (tSecurityVar == null) { return; } if (tUserEnvironment == null) { return; } foreach (DataRow rSecurityVar in tSecurityVar.Rows) { string f = "(idcustomuser = "******") and (variablename = " + QueryCreator.quotedstrvalue(rSecurityVar["variablename"], true) + ")"; if (tUserEnvironment.Select(f).Length == 0) { DataAccess.RUN_SELECT_INTO_TABLE(Meta.Conn, tUserEnvironment, null, f, null, true); } DataRow rUserEnvironment = null; if (tUserEnvironment.Select(f).Length > 0) { rUserEnvironment = tUserEnvironment.Select(f)[0]; } else { rUserEnvironment = tUserEnvironment.NewRow(); } rUserEnvironment["idcustomuser"] = idcustomuser; rUserEnvironment["variablename"] = rSecurityVar["variablename"]; rUserEnvironment["value"] = rSecurityVar["value"]; rUserEnvironment["flagadmin"] = "N"; rUserEnvironment["kind"] = rSecurityVar["kind"]; rUserEnvironment["lt"] = DateTime.Now; rUserEnvironment["lu"] = "Software and More"; if (tUserEnvironment.Select(f).Length == 0) { tUserEnvironment.Rows.Add(rUserEnvironment); } } }
public void CreateCodiceDeduzioneRow() { if (Meta.IsEmpty) { return; } DataRow DRtipodeduzione = HelpForm.GetLastSelected(DS.deduction); DataRow[] R = DS.Tables["deductioncode"].Select("(iddeduction=" + QueryCreator.quotedstrvalue(DRtipodeduzione["iddeduction"], false) + ")"); if (R.Length == 0) { MetaData MetaCD = MetaData.GetMetaData(this, "deductioncode"); MetaCD.SetDefaults(DS.deductioncode); DataRow DR = MetaCD.Get_New_Row(DRtipodeduzione, DS.deductioncode); } }
public override bool IsValid(DataRow R, out string errmess, out string errfield) { if (!base.IsValid(R, out errmess, out errfield)) { return(false); } string filterkey = QueryCreator.WHERE_KEY_CLAUSE(R, DataRowVersion.Current, false); DataRow [] RR = R.Table.Select(filterkey); if (RR.Length > 1) { errmess = "Attenzione! L'operazione selezionata è stata già assegnata alla tabella scelta"; errfield = "opkind"; return(false); } return(true); }
protected override void AddQueryControls(VLayoutPanel vPanel) { var customPanel = new LayoutManager("Main", mainInfo, mQueryContainer); //查询条件包括::{会计单位}、{计划号}、{存货名称}、{存货编码} customPanel.Add("AccountingUnit_ID", QueryCreator.DFChoiceBoxEnableMultiSelection(mainInfo.Fields["AccountingUnit_ID"], mQueryContainer, "AccountingUnit_ID", DataKind.授权会计单位全部)); customPanel["AccountingUnit_ID"].NotAutoAddToContainer = true; customPanel.Add("PlanNumber_ID", QueryCreator.DFChoiceBoxEnableMultiSelection(mainInfo.Fields["PlanNumber_ID"], mQueryContainer, "PlanNumber_ID", B3ButcheryDataSource.计划号)); customPanel["PlanNumber_ID"].NotAutoAddToContainer = true; customPanel.Add("Goods_Name", new SimpleLabel("存货名称"), QueryCreator.DFTextBox(mainInfo.Fields["AccountingUnit_Name"])); customPanel.Add("Goods_Code", new SimpleLabel("存货编号"), QueryCreator.DFTextBox(mainInfo.Fields["Department_Name"])); customPanel.CreateDefaultConfig(2).Expand = false; vPanel.Add(customPanel.CreateLayout()); }
private void cmbDataInizioStruttura_SelectedIndexChanged(object sender, System.EventArgs e) { //if (!Meta.DrawStateIsDone) return; // bool MustSave=false; // if (!Meta.IsEmpty) // { // Meta.GetFormData(true); // if (!Meta.WarnUnsaved()) // { // MustSave=true; // } // } // if (MustSave) // { // MetaDataDetail.Focus(); // return; // } Meta.DoMainCommand("mainsetsearch"); if (!Meta.IsEmpty && DS.HasChanges()) { MetaDataDetail.Focus(); return; } if (cmbDataInizioStruttura.SelectedItem.ToString() == "") { cmbTipoRitenuta.SelectedItem = ""; Meta.FreshForm(); DisableToolbar(); return; } filterdatainiziostruttura = "(validitystart=" + QueryCreator.quotedstrvalue(cmbDataInizioStruttura.SelectedItem, true) + ")"; MetaData.SetDefault(DS.taxrate, "validitystart", Convert.ToDateTime(cmbDataInizioStruttura.SelectedItem)); DS.ratebracket.Clear(); // string filter = GetData.MergeFilters(filterritenuta, filterdatainiziostruttura); Meta.DoMainCommand("maindosearch.default." + filter); //Meta.FreshForm(); //if (DS.aliquotaritenuta.Rows.Count > 0) PopolaComboScaglione(filter); EnableToolbar(); }
/// <summary> /// Il comune selezionato viene eventualmente aggiornato con un comune successore. /// Se ce n'è più di uno di comuni successori l'utente deve sceglierne uno dall'elenco propostogli. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void buttonAggiornaComune_Click(object sender, System.EventArgs e) { if (Meta.IsEmpty) { return; } Meta.GetFormData(true); object idcomune = HelpForm.GetLastSelected(DS.cabview)["idcity"]; object[] list = new object[] { idcomune, "S" }; DataSet DSout = Meta.Conn.CallSP("compute_history_city", list, true, -1); if (DSout == null || DSout.Tables.Count == 0 || DS.Tables[0].Rows.Count == 0) { return; } DataTable T = DSout.Tables[0]; object idComune = null; if (T.Rows.Count == 1) { idComune = T.Rows[0]["idcity"]; } else { string filtro = QHS.FieldInList("idcity", QueryCreator.ColumnValues(T, null, "idcity", true)); MetaData metaComune = MetaData.GetMetaData(this, "geo_cityview"); metaComune.DS = DS.Copy(); metaComune.FilterLocked = true; DataRow r = metaComune.SelectOne("storia", filtro, null, null); if (r != null) { idComune = r["idcity"]; } else { idComune = HelpForm.GetLastSelected(DS.cabview)["idcity"]; } } HelpForm.GetLastSelected(DS.cabview)["idcity"] = idComune; Meta.FreshForm(true); aggiornaCap(idComune); }
public override void DescribeColumns(DataTable T, string ListingType) { base.DescribeColumns(T, ListingType); if (ListingType == "anagrafica") { foreach (DataColumn C in T.Columns) { DescribeAColumn(T, C.ColumnName, "", -1); } int nPos = 1; DescribeAColumn(T, "sortingkind", "Tipo", nPos++); DescribeAColumn(T, "registry", "Denominazione", nPos++); DescribeAColumn(T, "sortcode", "Codice", nPos++); DescribeAColumn(T, "sorting", "Descrizione", nPos++); DescribeAColumn(T, "quota", "Quota", nPos++); HelpForm.SetFormatForColumn(T.Columns["quota"], "p"); } if (ListingType.StartsWith("lista")) { string[] splittedlistingtype = ListingType.Split(".".ToCharArray()); string idsorkind = splittedlistingtype[1]; DataTable TipoClass = Conn.RUN_SELECT("sortingkind", "*", null, "(idsorkind=" + QueryCreator.quotedstrvalue(idsorkind, true) + ")", null, true); if (TipoClass.Rows.Count != 1) { return; } foreach (DataColumn C in T.Columns) { DescribeAColumn(T, C.ColumnName, "", -1); } int nPos = 1; DescribeAColumn(T, "sortingkind", "Tipo", nPos++); DescribeAColumn(T, "registry", "Denominazione", nPos++); DescribeAColumn(T, "idsor", "", nPos++); DescribeAColumn(T, "sortcode", "Codice", nPos++); DescribeAColumn(T, "sorting", "Descrizione", nPos++); DescribeAColumn(T, "codesorkind", "Tipo", nPos++); DescribeAColumn(T, "quota", "Quota", nPos++); HelpForm.SetFormatForColumn(T.Columns["quota"], "p"); } }
int NumberFromExcelColumn(string column) { try { int retVal = 0; string col = column.ToUpper(); for (int iChar = col.Length - 1; iChar >= 0; iChar--) { char colPiece = col[iChar]; int colNum = colPiece - 64; retVal = retVal + colNum * (int)Math.Pow(26, col.Length - (iChar + 1)); } return(retVal); } catch (Exception E) { QueryCreator.ShowException(this, "Errore convertendo numero un riferimento a colonna", E); return(20); } }
public void MetaData_AfterLink() { Meta = MetaData.GetMetaData(this); QHC = new CQueryHelper(); QHS = Meta.Conn.GetQueryHelper(); GetData.SetSorting(DS.registrysortingview, "idreg"); string filterCT = QHS.CmpEq("tablename", "registry"); 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); //DataAccess.SetTableForReading(DS.cdruolo_alias,"cdruolo"); //HelpForm.SetDenyNull(DS.cdposruolo.flagattivoColumn,true); }
bool leggiEF07RecordDiTesta(TextReader tr, DataRow r) { r["ISTTS"] = leggiNumerico(tr, 5); // Codice istituto r["CODEN"] = leggiNumerico(tr, 7); // Codice ente r["ESERC"] = leggiNumerico(tr, 4); // Anno esercizio string tiprec = leggiAlfanumerico(tr, 2); // Tipo record r["DESC"] = leggiAlfanumerico(tr, 50); // Descrizione ente r["NDG"] = leggiLong(tr, 11); // Codice anagrafico ente r["DTELAB"] = leggiDataGMA(tr, 8); // Data elaborazione (nel formato GGMMAAAA) r["FILLER"] = leggiAlfanumerico(tr, 413); // Campo a disposizione if (tiprec != "01") { QueryCreator.ShowError(null, "Mi aspettavo il record 01 invece ho ricevuto il record " + tiprec, ""); return(false); } return(vaiACapo(tr)); }
public void MetaData_AfterLink() { Meta = MetaData.GetMetaData(this); Conn = Meta.Conn; QHC = new CQueryHelper(); QHS = Conn.GetQueryHelper(); string filtereserc = QHS.CmpEq("ayear", Meta.GetSys("esercizio")); GetData.SetStaticFilter(DS.autoclawbacksorting, filtereserc); GetData.SetStaticFilter(DS.autoclawbacksortingview, filtereserc); string filterActive = QHS.DoPar(QHS.AppOr(QHS.NullOrEq("active", 'S'), QHS.CmpEq("active", ""))); string filterI_SK = QHS.DoPar(QHS.AppOr(QHS.DoPar(QHS.AppAnd(QHS.NullOrLe("start", Meta.GetSys("esercizio")), QHS.NullOrGe("stop", Meta.GetSys("esercizio")), filterActive)), QHS.CmpEq("idsorkind", 0))); QueryCreator.SetFilterForInsert(DS.sortingkind, filterI_SK); }
private void VisualizzaAllegato(string certification) { if (Meta.IsEmpty) { return; } string FilePath = AppDomain.CurrentDomain.BaseDirectory; string prefix = "SWMOREDURC"; string filenametodelete = FilePath + prefix + "*.*"; string[] existingreports = System.IO.Directory.GetFiles(FilePath, prefix + "*.*"); foreach (string filename in existingreports) { try{ System.IO.File.Delete(filename); } catch { } } //sw è il nome del file temporaneo che hai creato DateTime oggi_dt = DateTime.Now; string oggi = oggi_dt.Ticks.ToString(); DataRow Curr = DS.registrydurc.Rows[0]; byte[] ByteArray = (byte[])Curr[certification]; int offset = GetOffsetForData(ByteArray); string fname = GetFileName(ByteArray); string estensione = Path.GetExtension(fname).Trim();; string sw = Path.Combine(FilePath, prefix + oggi.ToString() + estensione); try { ScriviFile(sw, ByteArray, offset); System.Diagnostics.Process.Start(sw); } catch (Exception E) { QueryCreator.ShowException(E); } }
public static void RicalcolaSpese(DataAccess Conn, DataRow Missione, DataTable Spese, object idposition, object classnum ) { object iditinerationrefundrule = Conn.DO_READ_VALUE("itinerationrefundrule", "(start<=" + QueryCreator.quotedstrvalue( Missione[MissFun.CampoDataPerGruppoEstero], true) + ")", "max(iditinerationrefundrule)"); string filter = "(iditinerationrefundrule=" + QueryCreator.quotedstrvalue(iditinerationrefundrule, true) + ")AND (idposition=" + QueryCreator.quotedstrvalue(idposition, true) + ")AND(" + QueryCreator.quotedstrvalue(classnum, true) + " BETWEEN minincomeclass and maxincomeclass)"; DataTable TRefRule = Conn.RUN_SELECT("itinerationrefundruledetail", "*", null, filter, null, true); if (TRefRule.Rows.Count == 0) { MessageBox.Show("Configurazione anticipo spese non trovata"); return; } foreach (DataRow Spesa in Spese.Select()) { string flag_geo = Spesa["flag_geo"].ToString().ToUpper(); string filtergeo = "(flag_italy='S')"; if (flag_geo.ToString() == "U") { filtergeo = "(flag_eu='S')"; } if (flag_geo.ToString() == "E") { filtergeo = "(flag_extraeu='S')"; } DataRow[] RefRule = TRefRule.Select(filtergeo); if (RefRule.Length > 0) { Spesa["advancepercentage"] = CfgFn.GetNoNullDouble(RefRule[0]["advancepercentage"]); } else { MessageBox.Show("Configurazione anticipo spese non trovata (Spesa " + Spesa["description"].ToString() + ")"); } } }
private void fillUserInGroup(object idcustomuser, DataTable tCustomGroup, DataTable tCustomUserGroup) { if (idcustomuser == null) { return; } if (tCustomGroup == null) { return; } if (tCustomUserGroup == null) { return; } string fuser = "******" + QueryCreator.quotedstrvalue(idcustomuser, true) + ")"; foreach (DataRow rGroup in tCustomGroup.Rows) { string fgruppo = "(idcustomgroup = " + QueryCreator.quotedstrvalue(rGroup["idcustomgroup"], false) + ")"; string filter = GetData.MergeFilters(fuser, fgruppo); if (tCustomUserGroup.Select(filter).Length > 0) { return; } DataAccess.RUN_SELECT_INTO_TABLE(Meta.Conn, tCustomUserGroup, null, filter, null, true); if (tCustomUserGroup.Select(filter).Length > 0) { return; } DataRow rCustomUserGroup = tCustomUserGroup.NewRow(); rCustomUserGroup["idcustomuser"] = idcustomuser; rCustomUserGroup["idcustomgroup"] = rGroup["idcustomgroup"]; rCustomUserGroup["lastmodtimestamp"] = DateTime.Now; rCustomUserGroup["lastmoduser"] = "******"; rCustomUserGroup["ct"] = DateTime.Now; rCustomUserGroup["cu"] = "Software and More"; rCustomUserGroup["lt"] = DateTime.Now; rCustomUserGroup["lu"] = "Software and More"; tCustomUserGroup.Rows.Add(rCustomUserGroup); } }
public static string detectType(string fname) { FileInfo fi = new FileInfo(fname); long dimensione = fi.Length; //EF06 503 //Ef07 502 if (fi.Length % 502 == 0) { return("EF07"); } if (fi.Length % 503 == 0) { return("EF06"); } QueryCreator.ShowError(null, "La dimensione del file non è un multiplo di 502 o 503.", "Errore di dimensione del file"); return(null); }
public object leggiDataAMG(TextReader tr, int numCifre) { if (tr.Read(buffer, 0, numCifre) != numCifre) { QueryCreator.ShowError(form, "ERRORE DURANTE LA LETTURA DEL FILE", "Letti meno byte rispetto al previsto"); } string s = new string(buffer, 0, numCifre); try { return((object)DateTime.ParseExact(s, "yyyyMMdd", DateTimeFormatInfo.CurrentInfo)); } catch (Exception e) { if (new string(buffer, 0, numCifre) != "".PadRight(numCifre, '0')) { QueryCreator.ShowException(form, "ERRORE DURANTE LA LETTURA DEL FILE: DATA AMG\r\n" + s, e); } return(DBNull.Value); } }
protected virtual void AddQueryControl(AutoLayoutConfig config, LayoutManager layoutManager) { layoutManager.Add("GoodsProperty_ID", QueryCreator.DFChoiceBoxEnableMultiSelection(mDFInfo.Fields["GoodsProperty_ID"], mQueryContainer, "GoodsProperty_ID", B3UnitedInfosConsts.DataSources.存货属性全部)); layoutManager["GoodsProperty_ID"].NotAutoAddToContainer = true; layoutManager.Add("GoodsPropertyCatalog_ID", new SimpleLabel("属性分类"), QueryCreator.DFChoiceBoxEnableMultiSelection(mDFInfo.Fields["GoodsProperty_ID"], mQueryContainer, "GoodsPropertyCatalog_ID", B3UnitedInfosConsts.DataSources.存货属性分类)); layoutManager["GoodsPropertyCatalog_ID"].NotAutoAddToContainer = true; config.Add("Name"); config.Add("Code"); config.Add("GoodsProperty_ID"); config.Add("GoodsPropertyCatalog_ID"); }
string ExcelColumnFromNumber(int column) { try { string columnString = ""; int columnNumber = column; while (columnNumber > 0) { int currentLetterNumber = (columnNumber - 1) % 26; char currentLetter = (char)(currentLetterNumber + 65); columnString = currentLetter + columnString; columnNumber = (columnNumber - (currentLetterNumber + 1)) / 26; } return(columnString); } catch (Exception E) { QueryCreator.ShowException(this, "Errore convertendo in riferimento a colonna un numero", E); return("Z"); } }
/// <summary> /// Add a query to the app and run it. /// </summary> /// <param name="shortName">The short name the query should take. This method will throw an ArgumentException if this already exists.</param> /// <param name="description">A description of the query.</param> /// <param name="creator">A QueryCreator that the AppManager can use to build the query.</param> public void RunQuery(string shortName, string description, QueryCreator creator) { Util.Log("AppManager (" + this.App.ShortName + ")", "Adding query: " + shortName); if (this.App.Queries.Keys.Contains(shortName)) { throw new ArgumentException("Query already exists."); } Query q = creator(this.App, shortName, description); q.Start(); }
public CustomField(string fieldName, QueryCreator creator) : base(fieldName) { this.creator = creator; }