private void UIElement_OnLostFocus(object sender, RoutedEventArgs e) { var txt = sender as TextBox; if (ScopePerRow == null) { ScopePerRow = new GenericTable(); } bool tempPre = false; if (PreventPerRow != null) { tempPre = PreventPerRow.Iserial > 0; } if (ScopePerRow == null) { ScopePerRow = new GenericTable(); } if (!string.IsNullOrEmpty(txt.Text)) { Glclient.FindEntityByCodeAsync(JournalAccountType.Iserial, txt.Text, ScopePerRow.Iserial, LoggedUserInfo.DatabasEname, tempPre); } //Glclient.GetEntityAsync(0, 1, SearchPerRow.TblJournalAccountType, SearchPerRow.scope, "it.Iserial", Filter, // ValuesObjects, LoggedUserInfo.DatabasEname); }
public object updateRecord(UpdateGenericFormModel form) { DateTime today = DateTime.Today; try { using (DemoEntities db = new DemoEntities()) { // Read the form data. GenericTable updateRecordForm = db.GenericTables.Find(form.Id); updateRecordForm.Text = form.Text; updateRecordForm.Number = int.Parse(form.Number); updateRecordForm.Boolean = Boolean.Parse(form.Boolean); updateRecordForm.JSDate = DateTime.Parse(form.JSDate); updateRecordForm.JSDateTime = today; db.SaveChanges(); return(new { status = StatusCodes.OK.code, msg = "Successfully Updated Record" }); } } catch (System.Exception e) { return(new { status = StatusCodes.NotFound.code, msg = e.InnerException, data = 0 }); } }
public object addRecord(GenericFormModel form) { DateTime today = DateTime.Today; try { using (DemoEntities db = new DemoEntities()) { // Read the form data. GenericTable addRecordForm = new GenericTable(); addRecordForm.Text = form.Text; addRecordForm.Number = int.Parse(form.Number); addRecordForm.Boolean = Boolean.Parse(form.Boolean); addRecordForm.JSDate = DateTime.Parse(form.JSDate); //addRecordForm.JSDateTime = DateTime.Parse(form.JSDateTime); db.GenericTables.Add(addRecordForm); db.SaveChanges(); return(new { status = StatusCodes.OK.code, msg = "Successfully Added Record To Database" }); } } catch (System.Exception e) { return(new { status = StatusCodes.NotFound.code, msg = e.InnerException, data = 0 }); } }
/// <summary> /// Reads the specified stream. /// </summary> /// <param name="stream">The stream.</param> /// <returns>The file</returns> public override ITable Read(Stream stream) { var ReturnValue = new GenericTable(); if (stream is null) { return(ReturnValue); } string FileContent = GetContent(stream); var Delimiter = ""; if (string.IsNullOrEmpty(FileContent)) { return(ReturnValue); } var TempSplitter = new Regex("[^\"\r\n]*(\r\n|\n|$)|(([^\"\r\n]*)(\"[^\"]*\")([^\"\r\n]*))*(\r\n|\n|$)"); var Matches = TempSplitter.Matches(FileContent); if (string.IsNullOrEmpty(Delimiter) && Matches != null) { Delimiter = CheckDelimiters((Matches.Where(x => !string.IsNullOrEmpty(x.Value)).FirstOrDefault()?.Value) ?? ","); } foreach (var TempRowData in Matches.Where(x => !string.IsNullOrEmpty(x.Value))) { ReturnValue.Rows.Add(ReadRow(TempRowData.Value, Delimiter)); } if (ReturnValue.Rows.Count > 0) { SetupColumnHeaders(ReturnValue); } return(ReturnValue); }
public static ArchivedData ReadColumns(string TablePath, GenericTable rec) { //to avoid infinite loop - we alway return null for request for the archiove tables themselevs TablePath = TablePath.ToLower(); if (TablePath.IndexOf("archivecon") > 0) return null; ArchiveConfig cfg = ArchiveConfig.Get(TablePath); if (cfg == null) return null; string Column = cfg.AgeDeterminingColumn; if (Column == null) return null; ArchiveControl a = ArchiveControl.Get(TablePath, (DateTime)rec.DataRow[Column]); if (a == null) return null; ArchivedData ad = new ArchivedData(a, rec.ID); if (ad.mData == null) return null; return ad; }
public void LoadDataSource(string ID, string IDCliente, string IDSessione, string titolo) { id = int.Parse(ID.ToString()); cBusinessObjects.idcliente = int.Parse(IDCliente.ToString()); cBusinessObjects.idsessione = int.Parse(IDSessione.ToString()); txtTitolo.Text = titolo; ArrayList Al = new ArrayList(); dati = cBusinessObjects.GetData(id, typeof(Excel_ISQC_TempiLavoro)); foreach (DataRow dtrow in dati.Rows) { if (!Al.Contains(dtrow["Header"].ToString())) { Al.Add(dtrow["Header"].ToString()); } } if (Al.Count == 0) { Al.Add("ISQC"); } foreach (string item in Al) { TabItem ti = new TabItem(); ti.Header = item; tabControl.Items.Add(ti); } TabItem tiout = new TabItem(); tiout.Header = App.NewTabHeaderText; tabControl.Items.Add(tiout); gtCOGE = new GenericTable(tblISQC, _ReadOnly); gtCOGE.ColumnsAlias = new string[] { "Data", "Descrizione Attività", "Ore Previste", "Ore Effettive", "Scostamento", "%" }; gtCOGE.ColumnsValues = new string[] { "data", "esecutore", "previste", "effettive", "scostamento", "percentuale" }; gtCOGE.ColumnsWidth = new double[] { 2.0, 10.0, 2.0, 2.0, 2.0, 1.0 }; gtCOGE.ColumnsMinWidth = new double[] { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; gtCOGE.ColumnsTypes = new string[] { "string", "string", "int", "int", "int", "percent" }; gtCOGE.ColumnsAlignment = new string[] { "left", "left", "right", "right", "right", "right" }; gtCOGE.ColumnsReadOnly = new bool[] { false, false, false, false, true, true }; gtCOGE.ConditionalReadonly = new bool[] { false, false, false, false, false, false }; gtCOGE.ConditionalAttribute = "new"; gtCOGE.ColumnsHasTotal = new bool[] { false, false, true, true, true, false }; gtCOGE.AliasTotale = "Totale"; gtCOGE.ColumnAliasTotale = 1; gtCOGE.xml = false; gtCOGE.dati = dati; gtCOGE.TotalToBeCalculated += GtCOGE_TotalToBeCalculated; }
public void LoadDataSource(string ID, string IDCliente, string IDSessione) { id = int.Parse(ID.ToString()); cBusinessObjects.idcliente = int.Parse(IDCliente.ToString()); cBusinessObjects.idsessione = int.Parse(IDSessione.ToString()); _ID = ID; ArrayList Al = new ArrayList(); dati = cBusinessObjects.GetData(id, typeof(Excel_CassaContanteAltreValute)); foreach (DataRow dtrow in dati.Rows) { if (!Al.Contains(dtrow["CreditoEsistente"].ToString())) { Al.Add(dtrow["CreditoEsistente"].ToString()); } } if (Al.Count == 0) { Al.Add("Divise"); } foreach (string item in Al) { TabItem ti = new TabItem(); ti.Header = item; tabControl.Items.Add(ti); } TabItem tiout = new TabItem(); tiout.Header = App.NewTabHeaderText; tabControl.Items.Add(tiout); gtCassaContante = new GenericTable(tblCassaContante, _ReadOnly); gtCassaContante.ColumnsAlias = new string[] { "N° Pezzi", "Unitario", "Importo" }; gtCassaContante.ColumnsValues = new string[] { "numeropezzi", "unitario", "valuta" }; gtCassaContante.ColumnsWidth = new double[] { 1.0, 1.0, 1.0 }; gtCassaContante.ColumnsMinWidth = new double[] { 0.0, 0.0, 0.0 }; gtCassaContante.ColumnsTypes = new string[] { "string", "money", "money" }; gtCassaContante.ColumnsAlignment = new string[] { "right", "right", "right" }; gtCassaContante.ConditionalReadonly = new bool[] { false, false, true }; gtCassaContante.ConditionalAttribute = ""; gtCassaContante.ColumnsHasTotal = new bool[] { false, false, true }; gtCassaContante.AliasTotale = "Totale"; gtCassaContante.ColumnAliasTotale = 1; gtCassaContante.xml = false; gtCassaContante.dati = dati; gtCassaContante.TotalToBeCalculated += GtCassaContante_TotalToBeCalculated; }
/// <summary> /// Setups the column headers. /// </summary> /// <param name="returnValue">The return value.</param> private void SetupColumnHeaders(GenericTable returnValue) { var FirstRow = returnValue.Rows[0]; returnValue.Rows.Remove(FirstRow); foreach (var Cell in FirstRow.Cells) { returnValue.Columns.Add(Cell.Content); } }
public void LoadDataSource(string ID, string IDCliente, string IDSessione) { id = int.Parse(ID.ToString()); cBusinessObjects.idcliente = int.Parse(IDCliente.ToString()); cBusinessObjects.idsessione = int.Parse(IDSessione.ToString()); ArrayList Al = new ArrayList(); dati = cBusinessObjects.GetData(id, typeof(Excel_Riconciliazioni)); foreach (DataRow dtrow in dati.Rows) { if (!Al.Contains(dtrow["CreditoEsistente"].ToString())) { Al.Add(dtrow["CreditoEsistente"].ToString()); } } if (Al.Count == 0) { Al.Add("Conti Ordinari"); } foreach (string item in Al) { TabItem ti = new TabItem(); ti.Header = item; tabControl.Items.Add(ti); } TabItem tiout = new TabItem(); tiout.Header = App.NewTabHeaderText; tabControl.Items.Add(tiout); gtRiconciliazioni = new GenericTable(tblRiconciliazioni, _ReadOnly); gtRiconciliazioni.ColumnsAlias = new string[] { "Banca", "c/c n°", "Saldo contabile", "Saldo e/c banca", "Differenza", "Riconciliato", "imp.non ric." }; gtRiconciliazioni.ColumnsValues = new string[] { "banca", "ccn", "saldocontabile", "saldoec", "differenza", "riconciliato", "importoconriconciliato" }; gtRiconciliazioni.ColumnsWidth = new double[] { 2.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 }; gtRiconciliazioni.ColumnsMinWidth = new double[] { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; gtRiconciliazioni.ColumnsTypes = new string[] { "string", "string", "money", "money", "money", "money", "money" }; gtRiconciliazioni.ColumnsAlignment = new string[] { "left", "left", "right", "right", "right", "right", "right" }; gtRiconciliazioni.ColumnsReadOnly = new bool[] { false, false, false, false, true, false, true }; gtRiconciliazioni.ConditionalReadonly = new bool[] { false, false, false, false, false, false, false }; gtRiconciliazioni.ConditionalAttribute = "new"; gtRiconciliazioni.ColumnsHasTotal = new bool[] { false, false, true, true, true, true, true }; gtRiconciliazioni.AliasTotale = "Totale"; gtRiconciliazioni.ColumnAliasTotale = 1; gtRiconciliazioni.xml = false; gtRiconciliazioni.dati = dati; gtRiconciliazioni.TotalToBeCalculated += GtCOGE_TotalToBeCalculated; }
public void LoadDataSource(string ID, string IDCliente, string IDSessione) { id = int.Parse(ID.ToString()); cBusinessObjects.idcliente = int.Parse(IDCliente.ToString()); cBusinessObjects.idsessione = int.Parse(IDSessione.ToString()); if (ID != "-1" && ID != "") { _ID = "=" + ID + ""; } dati = cBusinessObjects.GetData(id, typeof(CassaAssegni)); foreach (DataRow dtrow in dati.Rows) { if (String.IsNullOrEmpty(dtrow["PeriodoDiRiferimento"].ToString())) { txtPeriodoDiRiferimento.Text = ""; } else { txtPeriodoDiRiferimento.Text = dtrow["PeriodoDiRiferimento"].ToString(); } } gtCassaAssegni = new GenericTable(tblCassaAssegni, _ReadOnly); gtCassaAssegni.ColumnsAlias = new string[] { "Traente", "Banca", "Piazza", "Importo" }; gtCassaAssegni.ColumnsValues = new string[] { "name", "codice", "importoPagato", "importoCompensato" }; gtCassaAssegni.ColumnsWidth = new double[] { 3.0, 1.0, 1.0, 1.0 }; gtCassaAssegni.ColumnsMinWidth = new double[] { 0.0, 0.0, 0.0, 0.0 }; gtCassaAssegni.ColumnsTypes = new string[] { "string", "string", "money", "money" }; gtCassaAssegni.ColumnsAlignment = new string[] { "left", "left", "right", "right" }; gtCassaAssegni.ConditionalReadonly = new bool[] { false, false, false, false }; gtCassaAssegni.ConditionalAttribute = "new"; gtCassaAssegni.ColumnsHasTotal = new bool[] { false, false, true, true }; gtCassaAssegni.AliasTotale = "Totale"; gtCassaAssegni.ColumnAliasTotale = 1; gtCassaAssegni.dati = dati; gtCassaAssegni.xml = false; gtCassaAssegni.Xpath = "/Dati/Dato[@ID" + _ID + "]/Valore[@tipo='CassaAssegni']"; gtCassaAssegni.GenerateTable(); }
public override Dictionary<string, object> ReadHash(long ID) { //cant use GT cause GT calls archive to read data and that would create a recursive loop SqlParameterCollection prms = new SqlCommand().Parameters; prms.AddWithValue("@id", ID); DataTable dt = squtil.ExecuteSingleResultSetSQLQuery(String.Format("select * from {0} where {1} = @id", dbTable, mArchiveControl.cfg.IDColumn), prms); if (dt.Rows.Count == 0) return null; GenericTable gt = new GenericTable(squtil, dbTable, mArchiveControl.cfg.IDColumn); gt.Load(dt.Rows[0]); //this was not archived - it was just put there so we have the ability to archive that data if (this.mArchiveControl.ArchiveType == ArchiveControl.ArchiveTypeEnum.Column) gt.Data.Remove(mArchiveControl.cfg.AgeDeterminingColumn); return gt.Data; }
private void MainWindow_Loaded(object sender, RoutedEventArgs e) { DataContext = this; MainTable = new GenericTable <string, double, string>(); MainTable.AddColumn("Col 1"); MainTable.AddColumn("Col 2"); MainTable.AddColumn("Col 3"); MainTable.AddRow("Row 1"); MainTable.AddRow("Row 2"); MainTable.AddRow("Row 3"); MainTable.Update(); }
public void LoadDataSource(string ID, string IDCliente, string IDSessione) { id = int.Parse(ID.ToString()); cBusinessObjects.idcliente = int.Parse(IDCliente.ToString()); cBusinessObjects.idsessione = int.Parse(IDSessione.ToString()); if (ID != "-1" && ID != "") { _ID = "=" + ID + ""; } dati = cBusinessObjects.GetData(id, typeof(CassaTitoli)); foreach (DataRow dtrow in dati.Rows) { if (String.IsNullOrEmpty(dtrow["CreditoEsistente"].ToString())) { txtCreditoEsistente.Text = ""; } else { txtCreditoEsistente.Text = dtrow["CreditoEsistente"].ToString(); } } gtCassaTitoli = new GenericTable(tblCassaTitoli, _ReadOnly); gtCassaTitoli.ColumnsAlias = new string[] { "Titolo", "Scadenza", "Euro" }; gtCassaTitoli.ColumnsValues = new string[] { "name", "codice", "importoPagato" }; gtCassaTitoli.ColumnsWidth = new double[] { 3.0, 1.0, 1.0 }; gtCassaTitoli.ColumnsMinWidth = new double[] { 0.0, 0.0, 0.0 }; gtCassaTitoli.ColumnsTypes = new string[] { "string", "string", "money" }; gtCassaTitoli.ColumnsAlignment = new string[] { "left", "right", "right" }; gtCassaTitoli.ColumnsReadOnly = new bool[] { false, false, false }; gtCassaTitoli.ConditionalReadonly = new bool[] { false, false, false }; gtCassaTitoli.ConditionalAttribute = "new"; gtCassaTitoli.ColumnsHasTotal = new bool[] { false, false, true }; gtCassaTitoli.AliasTotale = "Totale"; gtCassaTitoli.ColumnAliasTotale = 1; gtCassaTitoli.dati = dati; gtCassaTitoli.xml = false; gtCassaTitoli.GenerateTable(); }
internal void SaveOrUpdate() { Loading = true; if (SelectedMainRow != null) { var save = SelectedMainRow.Iserial == 0; if (AllowUpdate != true && !save) { MessageBox.Show(strings.AllowUpdateMsg); return; } var saveRow = new GenericTable(); saveRow.InjectFrom(SelectedMainRow); Glclient.GenericUpdateOrInsertAsync(TablEname, saveRow, MainRowList.IndexOf(SelectedMainRow), LoggedUserInfo.DatabasEname); } }
public void AddNewMainRow(GenericTable row) { var newRow = new TblApprovalViewModel { UserPerRow = { Iserial = LoggedUserInfo.Iserial, AxId = LoggedUserInfo.AxId, UserName = LoggedUserInfo.WFM_UserName }, TblAuthUser = LoggedUserInfo.Iserial, TblSalesOrder = Salesorder, ApprovalDate = DateTime.Now, ApprovalType = row.Iserial, ApprovalPerRow = row }; MainRowList.Add(newRow); }
private bool insertTestSeq() { bool failed = true; GenericTable TEMP = new GenericTable(); /* * Verifica a existência da Sequencia de testes, senão insere nova sequencia de testes; */ _testseq.Name = model.project + "_" + model.phase; TEMP = _generictableIDAL.findPerCode(_testseq); if (TEMP.ID == 0) { _testseq.Description = "Sequencia de testes para " + _testseq.Name; TEMP = _generictableIDAL.insert(_testseq); } _testseq.ID = TEMP.ID; failed = false; return(failed); }
public void SaveImported(ObservableCollection <GenericViewModel> list) { foreach (var variable in list) { if (variable == null) { return; } var saveRow = new GenericTable(); saveRow.InjectFrom(variable); var save = variable.Iserial == 0; if (AllowUpdate != true && !save) { MessageBox.Show(strings.AllowUpdateMsg); return; } Loading = true; Glclient.GenericUpdateOrInsertAsync(TablEname, saveRow, 0, LoggedUserInfo.DatabasEname); } }
private bool insertPhase() { bool failed = true; GenericTable TEMP = new GenericTable(); /* * Verifica a existência da phase, senão insere nova phase; */ _phase.Name = model.phase; TEMP = _generictableIDAL.findPerCode(_phase); if (TEMP.ID == 0) { _phase.Description = "Fase de testes de " + _phase.Name; TEMP = _generictableIDAL.insert(_phase); } _phase.ID = TEMP.ID; failed = false; return(failed); }
private bool insertStation() { bool failed = true; GenericTable TEMP = new GenericTable(); /* * Verifica a existência da estação, senão insere nova estação; */ _station.Name = model.station; TEMP = _generictableIDAL.findPerCode(_station); if (TEMP.ID == 0) { _station.Description = "Estação de testes de " + _station.Name; TEMP = _generictableIDAL.insert(_station); } _station.ID = TEMP.ID; failed = false; return(failed); }
private bool insertLine() { bool failed = true; GenericTable TEMP = new GenericTable(); _generictableIDAL = new GenericTableDAL(conexao); /* * Verifica a existência da linha, senão insere nova linha; */ _line.Name = model.line; TEMP = _generictableIDAL.findPerCode(_line); if (TEMP.ID == 0) { _line.Description = "Linha de produção " + _line.Name; TEMP = _generictableIDAL.insert(_line); } _line.ID = TEMP.ID; failed = false; return(failed); }
public void WriteTable() { var TestObject = new WordFormat(); using (var ResultFile = File.Open("./Results/TestDocx.docx", FileMode.OpenOrCreate)) { var Table = new GenericTable { Title = "My title" }; var Row1 = new GenericRow(); Row1.Cells.Add(new GenericCell("This")); Row1.Cells.Add(new GenericCell("is")); Row1.Cells.Add(new GenericCell("a")); var Row2 = new GenericRow(); Row2.Cells.Add(new GenericCell("test")); Row2.Cells.Add(new GenericCell("doc")); Row2.Cells.Add(new GenericCell("with")); var Row3 = new GenericRow(); Row3.Cells.Add(new GenericCell("a")); Row3.Cells.Add(new GenericCell("table")); Row3.Cells.Add(new GenericCell("inside")); Table.Columns.Add("A"); Table.Columns.Add("B"); Table.Columns.Add("C"); Table.Rows.Add(Row1); Table.Rows.Add(Row2); Table.Rows.Add(Row3); Assert.True(TestObject.Write(ResultFile, Table)); } using (var ResultFile = File.Open("./Results/TestDocx.docx", FileMode.OpenOrCreate)) { var Result = TestObject.Read(ResultFile); Assert.Equal("A\nB\nC\nThis\nis\na\ntest\ndoc\nwith\na\ntable\ninside", Result.ToString()); Assert.Equal("My title", Result.Title); } }
public void LoadDataSource(string ID, string IDCliente, string IDSessione) { id = int.Parse(ID.ToString()); cBusinessObjects.idcliente = int.Parse(IDCliente.ToString()); cBusinessObjects.idsessione = int.Parse(IDSessione.ToString()); bool nodestobeadded = false; ArrayList Al = new ArrayList(); dati = cBusinessObjects.GetData(id, typeof(Excel_CassaContanteNew)); foreach (DataRow dtrow in dati.Rows) { if (!Al.Contains(dtrow["CreditoEsistente"].ToString())) { Al.Add(dtrow["CreditoEsistente"].ToString()); } } if (Al.Count == 0) { Al.Add("Cassa Contante"); if (_ReadOnly == false) { nodestobeadded = true; } } foreach (string item in Al) { TabItem ti = new TabItem(); ti.Header = item; tabControl.Items.Add(ti); } TabItem tiout = new TabItem(); tiout.Header = App.NewTabHeaderText; tabControl.Items.Add(tiout); gtCassaContante = new GenericTable(tblCassaContante, _ReadOnly); gtCassaContante.ColumnsAlias = new string[] { "N° Pezzi", "Unitario", "Importo" }; gtCassaContante.ColumnsValues = new string[] { "numeropezzi", "unitario", "euro" }; gtCassaContante.ColumnsWidth = new double[] { 1.0, 1.0, 1.0 }; gtCassaContante.ColumnsMinWidth = new double[] { 0.0, 0.0, 0.0 }; gtCassaContante.ColumnsTypes = new string[] { "string", "money", "money" }; gtCassaContante.ColumnsAlignment = new string[] { "right", "right", "right" }; gtCassaContante.ColumnsReadOnly = new bool[] { false, false, true }; gtCassaContante.ConditionalReadonly = new bool[] { false, true, true }; gtCassaContante.ConditionalAttribute = "new"; gtCassaContante.ColumnsHasTotal = new bool[] { false, false, true }; gtCassaContante.AliasTotale = "Totale"; gtCassaContante.ColumnAliasTotale = 1; gtCassaContante.xml = false; gtCassaContante.dati = dati; gtCassaContante.TotalToBeCalculated += GtCassaContante_TotalToBeCalculated; if (nodestobeadded) { gtCassaContante.filtercolumn = "CreditoEsistente"; gtCassaContante.filtervalue = "Cassa Contante"; gtCassaContante.GenerateTable(); AggiungiNodo("a", "500,00", "Cassa Contante"); AggiungiNodo("a", "200,00", "Cassa Contante"); AggiungiNodo("a", "100,00", "Cassa Contante"); AggiungiNodo("a", "50,00", "Cassa Contante"); AggiungiNodo("a", "20,00", "Cassa Contante"); AggiungiNodo("a", "10,00", "Cassa Contante"); AggiungiNodo("a", "5,00", "Cassa Contante"); AggiungiNodo("a", "2,00", "Cassa Contante"); AggiungiNodo("a", "1,00", "Cassa Contante"); AggiungiNodo("a", "0,50", "Cassa Contante"); AggiungiNodo("a", "0,20", "Cassa Contante"); AggiungiNodo("a", "0,10", "Cassa Contante"); AggiungiNodo("a", "0,05", "Cassa Contante"); AggiungiNodo("a", "0,02", "Cassa Contante"); AggiungiNodo("a", "0,01", "Cassa Contante"); gtCassaContante.GenerateTable(); } }
public CheckListLinkViewModel() { if (!DesignerProperties.IsInDesignTool) { MainRowList = new ObservableCollection <GenericViewModel>(); SelectedMainRow = new GenericViewModel(); SelectedDetailRow = new TblCheckListLinkViewModel(); Client.GetGenericCompleted += (s, sv) => { foreach (var row in sv.Result) { var newrow = new GenericViewModel { Aname = row.Aname, Ename = row.Ename, Iserial = row.Iserial, Code = row.Code }; MainRowList.Add(newrow); } }; Client.GetGenericAsync("TblCheckListGroup", "%%", "%%", "%%", "Iserial", "ASC"); var detailservice = new CRUD_ManagerServiceClient(); detailservice.GetGenericCompleted += (s, sv) => { foreach (var row in sv.Result) { var newrow = new TblCheckListLinkViewModel { Aname = row.Aname, Ename = row.Ename, Iserial = row.Iserial, Code = row.Code, TblCheckListItem = row.Iserial }; DetailList.Add(newrow); } }; detailservice.GetGenericAsync("TblCheckListItem", "%%", "%%", "%%", "Iserial", "ASC"); var header1Service = new CRUD_ManagerServiceClient(); header1Service.GetGenericCompleted += (s, sv) => { foreach (var row in sv.Result) { var newrow = new GenericTable { Aname = row.Aname, Ename = row.Ename, Iserial = row.Iserial, Code = row.Code, }; CheckListDesignGroupHeader1List.Add(newrow); } }; header1Service.GetGenericAsync("TblCheckListDesignGroupHeader1", "%%", "%%", "%%", "Iserial", "ASC"); var header2 = new CRUD_ManagerServiceClient(); header2.GetGenericCompleted += (s, sv) => { foreach (var row in sv.Result) { var newrow = new GenericTable { Aname = row.Aname, Ename = row.Ename, Iserial = row.Iserial, Code = row.Code, }; CheckListDesignGroupHeader2List.Add(newrow); } }; header2.GetGenericAsync("TblCheckListDesignGroupHeader2", "%%", "%%", "%%", "Iserial", "ASC"); Client.GetTblCheckListLinkCompleted += (s, sv) => { foreach (var row in DetailList) { row.UpdatedAllowed = false; row.Checked = false; row.CheckListDesignGroupHeader1PerRow = null; row.CheckListDesignGroupHeader2PerRow = null; row.TblCheckListDesignGroupHeader1 = null; row.TblCheckListDesignGroupHeader2 = null; } foreach (var row in sv.Result) { var subCheckListRow = DetailList.SingleOrDefault(x => x.Iserial == row.TblCheckListItem); if (subCheckListRow != null) { subCheckListRow.Checked = true; if (row.TblCheckListDesignGroupHeader11 != null) { subCheckListRow.CheckListDesignGroupHeader1PerRow.InjectFrom(row.TblCheckListDesignGroupHeader11); } if (row.TblCheckListDesignGroupHeader21 != null) { subCheckListRow.CheckListDesignGroupHeader2PerRow.InjectFrom(row.TblCheckListDesignGroupHeader21); } } } }; } }
public void LoadDataSource(string ID, string IDCliente, string IDSessione) { id = int.Parse(ID.ToString()); cBusinessObjects.idcliente = int.Parse(IDCliente.ToString()); cBusinessObjects.idsessione = int.Parse(IDSessione.ToString()); bool starternodestobeadded = false; dati = cBusinessObjects.GetData(id, typeof(CassaContante)); foreach (DataRow dtrow in dati.Rows) { if (String.IsNullOrEmpty(dtrow["txtSaldoSchedaContabile"].ToString())) { txtSaldoSchedaContabile.Text = ""; } else { txtSaldoSchedaContabile.Text = dtrow["txtSaldoSchedaContabile"].ToString(); } if (String.IsNullOrEmpty(dtrow["CreditoEsistente"].ToString())) { txtCreditoEsistente.Text = ""; } else { txtCreditoEsistente.Text = dtrow["CreditoEsistente"].ToString(); } starternodestobeadded = true; } gtCassaContante = new GenericTable(tblCassaContante, _ReadOnly); gtCassaContante.ColumnsAlias = new string[] { "N° Pezzi", "Unitario", "Euro" }; gtCassaContante.ColumnsValues = new string[] { "numeropezzi", "unitario", "euro" }; gtCassaContante.ColumnsWidth = new double[] { 1.0, 1.0, 1.0 }; gtCassaContante.ColumnsMinWidth = new double[] { 0.0, 0.0, 0.0 }; gtCassaContante.ColumnsTypes = new string[] { "int", "money", "money" }; gtCassaContante.ColumnsAlignment = new string[] { "right", "right", "right" }; gtCassaContante.ConditionalReadonly = new bool[] { false, true, true }; gtCassaContante.ConditionalAttribute = ""; gtCassaContante.ColumnsHasTotal = new bool[] { false, false, true }; gtCassaContante.AliasTotale = "Totale"; gtCassaContante.ColumnAliasTotale = 1; gtCassaContante.dati = dati; gtCassaContante.xml = false; gtCassaContante.TotalToBeCalculated += GtCassaContante_TotalToBeCalculated; gtCassaContante.GenerateTable(); if (starternodestobeadded) { addNode("500,00", false); addNode("200,00", false); addNode("100,00", false); addNode("50,00", false); addNode("20,00", false); addNode("10,00", false); addNode("5,00", false); addNode("2,00", false); addNode("1,00", false); addNode("0,50", false); addNode("0,20", false); addNode("0,10", false); addNode("0,05", false); addNode("0,02", false); addNode("0,01", false); addNode("Totale", true); } }
public void LoadDataSource(string ID, string IDCliente, string IDSessione) { id = int.Parse(ID.ToString()); cBusinessObjects.idcliente = int.Parse(IDCliente.ToString()); cBusinessObjects.idsessione = int.Parse(IDSessione.ToString()); _ID = ID; datirate = cBusinessObjects.GetData(id, typeof(DichiarazioneRedditi_6_1_Rate)); datidichiarazione = cBusinessObjects.GetData(id, typeof(DichiarazioneRedditi_6_1)); if (datidichiarazione.Rows.Count == 0) { DataRow dd = datidichiarazione.Rows.Add(); dd["ID_CLIENTE"] = cBusinessObjects.idcliente; dd["ID_SESSIONE"] = cBusinessObjects.idsessione; } foreach (DataRow dtrow in datidichiarazione.Rows) { txt_periodo_imposta.Text = dtrow["periodo_imposta"].ToString(); txt_H3.Text = dtrow["H3"].ToString(); txt_H4.Text = dtrow["H4"].ToString(); txt_C1R1.Text = dtrow["C1R1"].ToString(); txt_C2R1.Text = dtrow["C2R1"].ToString(); txt_C3R1.Text = dtrow["C3R1"].ToString(); txt_C4R1.Text = dtrow["C4R1"].ToString(); txt_C1R2.Text = dtrow["C1R2"].ToString(); txt_C2R2.Text = dtrow["C2R2"].ToString(); txt_C3R2.Text = dtrow["C3R2"].ToString(); txt_C4R2.Text = dtrow["C4R2"].ToString(); txt_C1R3.Text = dtrow["C1R3"].ToString(); txt_C2R3.Text = dtrow["C2R3"].ToString(); txt_C3R3.Text = dtrow["C3R3"].ToString(); txt_C4R3.Text = dtrow["C4R3"].ToString(); txt_C1R4.Text = dtrow["C1R4"].ToString(); txt_C2R4.Text = dtrow["C2R4"].ToString(); txt_C3R4.Text = dtrow["C3R4"].ToString(); txt_C4R4.Text = dtrow["C4R4"].ToString(); txt_C1R5.Text = dtrow["C1R5"].ToString(); txt_C2R5.Text = dtrow["C2R5"].ToString(); txt_C3R5.Text = dtrow["C3R5"].ToString(); txt_C4R5.Text = dtrow["C4R5"].ToString(); txt_C1ACC1.Text = dtrow["C1ACC1"].ToString(); txt_C2ACC1.Text = dtrow["C2ACC1"].ToString(); txt_C3ACC1.Text = dtrow["C3ACC1"].ToString(); txt_C1ACC1.Text = dtrow["C4ACC1"].ToString(); txt_compensazione1.Text = dtrow["compensazione1"].ToString(); txt_C1ACC2.Text = dtrow["C1ACC2"].ToString(); txt_C2ACC2.Text = dtrow["C2ACC2"].ToString(); txt_C3ACC2.Text = dtrow["C3ACC2"].ToString(); txt_C1ACC2.Text = dtrow["C4ACC2"].ToString(); txt_compensazione2.Text = dtrow["compensazione2"].ToString(); txt_datapagamento.Text = dtrow["datapagamento"].ToString(); } txt_H1.Text = "IRES"; txt_H1.IsReadOnly = true; txt_H2.Text = "IRAP"; txt_H2.IsReadOnly = true; gtdati1 = new GenericTable(tbrate, _ReadOnly); gtdati1.ColumnsAlias = new string[] { "Rateizzi", "Scadenze", "Rata", "Pagato il" }; gtdati1.ColumnsValues = new string[] { "ID", "scadenze", "rata", "pagatoil" }; gtdati1.ColumnsWidth = new double[] { 1.0, 1.0, 1.0, 1.0 }; gtdati1.ColumnsMinWidth = new double[] { 0.0, 0.0, 0.0, 0.0 }; gtdati1.ColumnsTypes = new string[] { "string", "string", "money", "string" }; gtdati1.ColumnsAlignment = new string[] { "center", "left", "right", "left" }; gtdati1.ColumnsReadOnly = new bool[] { true, false, false, false }; gtdati1.ConditionalReadonly = new bool[] { false, false, false, false }; gtdati1.ConditionalAttribute = "new"; gtdati1.ColumnsHasTotal = new bool[] { false, false, false, false }; gtdati1.dati = datirate; gtdati1.xml = false; gtdati1.GenerateTable(); generatot(); }
public void Load(string ID, string IDCliente, string IDSessione) { id = int.Parse(ID.ToString()); cBusinessObjects.idcliente = int.Parse(IDCliente.ToString()); cBusinessObjects.idsessione = int.Parse(IDSessione.ToString()); _ID = ID; bool oldNode = false; datigtEsecutoriRevisione = cBusinessObjects.GetData(id, typeof(CompensiERisorse_EsecutoriRevisione)); datigtCompensoRevisione = cBusinessObjects.GetData(id, typeof(CompensiERisorse_CompensoRevisione)); datigtTerminiEsecuzione = cBusinessObjects.GetData(id, typeof(CompensiERisorse_TerminiEsecuzione)); if (datigtTerminiEsecuzione.Rows.Count > 0) { oldNode = true; } oldNode = true; foreach (DataRow dtrow in datigtCompensoRevisione.Rows) { try { txtTotale.Text = (dtrow["txtTotale"] != null) ? dtrow["txtTotale"].ToString() : ""; txtTariffaOraria.Text = (dtrow["txtTariffaOraria"] != null) ? dtrow["txtTariffaOraria"].ToString() : ""; txtCompenso.Text = (dtrow["txtCompenso"] != null) ? dtrow["txtCompenso"].ToString() : ""; } catch (Exception) { } } _StartingCalculation = false; if (oldNode) { gtEsecutoriRevisione = new GenericTable(tblEsecutoriRevisione, _ReadOnly); gtEsecutoriRevisione.ColumnsAlias = new string[] { "Nominativo", "Qualifica" }; gtEsecutoriRevisione.ColumnsValues = new string[] { "nome", "qualifica" }; gtEsecutoriRevisione.ColumnsWidth = new double[] { 1.0, 1.0 }; gtEsecutoriRevisione.ColumnsMinWidth = new double[] { 0.0, 0.0 }; gtEsecutoriRevisione.ColumnsTypes = new string[] { "string", "string" }; gtEsecutoriRevisione.ColumnsAlignment = new string[] { "left", "left" }; gtEsecutoriRevisione.ConditionalReadonly = new bool[] { false, false }; gtEsecutoriRevisione.ConditionalAttribute = "new"; gtEsecutoriRevisione.ColumnsHasTotal = new bool[] { false, false }; gtEsecutoriRevisione.AliasTotale = "Totale"; gtEsecutoriRevisione.ColumnAliasTotale = 1; gtEsecutoriRevisione.dati = datigtEsecutoriRevisione; gtEsecutoriRevisione.xml = false; gtEsecutoriRevisione.GenerateTable(); } else { brdEsecutoriRevisione.Visibility = Visibility.Collapsed; } if (oldNode) { gtCompensoRevisione = new GenericTable(tblCompensoRevisione, _ReadOnly); gtCompensoRevisione.ColumnsAlias = new string[] { "Fase", "Attività", "Esecutore - Personale assegnato", "Ore" }; gtCompensoRevisione.ColumnsValues = new string[] { "fase", "attivita", "esecutore", "ore" }; gtCompensoRevisione.ColumnsWidth = new double[] { 1.0, 8.0, 4.0, 2.0 }; gtCompensoRevisione.ColumnsMinWidth = new double[] { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; gtCompensoRevisione.ColumnsTypes = new string[] { "string", "string", "string", "money" }; gtCompensoRevisione.ColumnsAlignment = new string[] { "left", "left", "left", "right" }; gtCompensoRevisione.ConditionalReadonly = new bool[] { true, true, false, false }; gtCompensoRevisione.ConditionalAttribute = "new"; gtCompensoRevisione.ColumnsHasTotal = new bool[] { false, false, false, false }; gtCompensoRevisione.AliasTotale = "Totale"; gtCompensoRevisione.ColumnAliasTotale = 1; gtCompensoRevisione.dati = datigtCompensoRevisione; gtCompensoRevisione.xml = false; gtCompensoRevisione.TotalToBeCalculated += GtCompensoRevisione_TotalToBeCalculated; gtCompensoRevisione.GenerateTable(); if (datigtCompensoRevisione.Rows.Count == 0) { string Attivita = "Fase INTERIM: Determinazione del rischio e della materialità - Pianificazione della revisione"; string Fase = "1"; datigtCompensoRevisione.Rows.Add(id, cBusinessObjects.idcliente, cBusinessObjects.idsessione, Fase, Attivita); Attivita = "Partecipazioni all'inventario di magazzino"; Fase = "2"; datigtCompensoRevisione.Rows.Add(id, cBusinessObjects.idcliente, cBusinessObjects.idsessione, Fase, Attivita); Attivita = "Fase FINAL: Controllo del bilancio come pianificato"; Fase = "3"; datigtCompensoRevisione.Rows.Add(id, cBusinessObjects.idcliente, cBusinessObjects.idsessione, Fase, Attivita); Attivita = "Redazione Relazione"; Fase = "4"; datigtCompensoRevisione.Rows.Add(id, cBusinessObjects.idcliente, cBusinessObjects.idsessione, Fase, Attivita); gtCompensoRevisione.GenerateTable(); recalculateTotal(); } } else { gtCompensoRevisione = new GenericTable(tblCompensoRevisione, _ReadOnly); gtCompensoRevisione.ColumnsAlias = new string[] { "Fase", "Attività", "Esecutore - Personale assegnato", "Data Termine", "Ore" }; gtCompensoRevisione.ColumnsValues = new string[] { "fase", "attivita", "esecutore", "termini", "ore" }; gtCompensoRevisione.ColumnsWidth = new double[] { 1.0, 7.0, 3.0, 1.0, 1.0 }; gtCompensoRevisione.ColumnsMinWidth = new double[] { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; gtCompensoRevisione.ColumnsTypes = new string[] { "string", "string", "string", "string", "money" }; gtCompensoRevisione.ColumnsAlignment = new string[] { "left", "left", "left", "right", "right" }; gtCompensoRevisione.ConditionalReadonly = new bool[] { true, true, false, false, false }; gtCompensoRevisione.ConditionalAttribute = "new"; gtCompensoRevisione.ColumnsHasTotal = new bool[] { false, false, false, false, false }; gtCompensoRevisione.AliasTotale = "Totale"; gtCompensoRevisione.ColumnAliasTotale = 1; gtCompensoRevisione.dati = datigtCompensoRevisione; gtCompensoRevisione.xml = false; gtCompensoRevisione.TotalToBeCalculated += GtCompensoRevisione_TotalToBeCalculated; gtCompensoRevisione.GenerateTable(); if (datigtCompensoRevisione.Rows.Count == 0) { string Attivita = "Fase INTERIM: Determinazione del rischio e della materialità - Pianificazione della revisione"; string Fase = "1"; datigtCompensoRevisione.Rows.Add(id, cBusinessObjects.idcliente, cBusinessObjects.idsessione, Fase, Attivita); Attivita = "Partecipazioni all'inventario di magazzino"; Fase = "2"; datigtCompensoRevisione.Rows.Add(id, cBusinessObjects.idcliente, cBusinessObjects.idsessione, Fase, Attivita); Attivita = "Fase FINAL: Controllo del bilancio come pianificato"; Fase = "3"; datigtCompensoRevisione.Rows.Add(id, cBusinessObjects.idcliente, cBusinessObjects.idsessione, Fase, Attivita); Attivita = "Redazione Relazione"; Fase = "4"; datigtCompensoRevisione.Rows.Add(id, cBusinessObjects.idcliente, cBusinessObjects.idsessione, Fase, Attivita); gtCompensoRevisione.GenerateTable(); recalculateTotal(); } } if (oldNode) { gtTerminiEsecuzione = new GenericTable(tblTerminiEsecuzione, _ReadOnly); gtTerminiEsecuzione.ColumnsAlias = new string[] { "Fase", "Attività da svolgere", "Data Termine" }; gtTerminiEsecuzione.ColumnsValues = new string[] { "fase", "attivita", "termini" }; gtTerminiEsecuzione.ColumnsWidth = new double[] { 1.0, 9.0, 5.0 }; gtTerminiEsecuzione.ColumnsMinWidth = new double[] { 0.0, 0.0, 0.0 }; gtTerminiEsecuzione.ColumnsTypes = new string[] { "string", "string", "string" }; gtTerminiEsecuzione.ColumnsAlignment = new string[] { "left", "left", "right" }; gtTerminiEsecuzione.ConditionalReadonly = new bool[] { true, true, false }; gtTerminiEsecuzione.ConditionalAttribute = "new"; gtTerminiEsecuzione.ColumnsHasTotal = new bool[] { false, false, false }; gtTerminiEsecuzione.AliasTotale = "Totale"; gtTerminiEsecuzione.ColumnAliasTotale = 1; gtTerminiEsecuzione.dati = datigtTerminiEsecuzione; gtTerminiEsecuzione.xml = false; gtTerminiEsecuzione.GenerateTable(); if (datigtTerminiEsecuzione.Rows.Count == 0) { gtTerminiEsecuzione.Xpathparentnode = "//Dati/Dato[@ID" + _ID + "]"; string Attivita = "Fase INTERIM: Determinazione del rischio e della materialità - Pianificazione della revisione"; string Fase = "1"; datigtTerminiEsecuzione.Rows.Add(id, cBusinessObjects.idcliente, cBusinessObjects.idsessione, Fase, Attivita); Attivita = "Partecipazioni all'inventario di magazzino"; Fase = "2"; datigtTerminiEsecuzione.Rows.Add(id, cBusinessObjects.idcliente, cBusinessObjects.idsessione, Fase, Attivita); Attivita = "Fase FINAL: Controllo del bilancio come pianificato"; Fase = "3"; datigtTerminiEsecuzione.Rows.Add(id, cBusinessObjects.idcliente, cBusinessObjects.idsessione, Fase, Attivita); Attivita = "Redazione Relazione"; Fase = "4"; datigtTerminiEsecuzione.Rows.Add(id, cBusinessObjects.idcliente, cBusinessObjects.idsessione, Fase, Attivita); gtTerminiEsecuzione.GenerateTable(); } } else { brdTerminiEsecuzione.Visibility = Visibility.Collapsed; } recalculateTotal(); }
public void Load(string ID, string IDCliente, string IDSessione) { id = int.Parse(ID.ToString()); cBusinessObjects.idcliente = int.Parse(IDCliente.ToString()); cBusinessObjects.idsessione = int.Parse(IDSessione.ToString()); _ID = ID; datiStimaore = cBusinessObjects.GetData(id, typeof(CompensiERisorse_CompensoRevisione_Stimaore_6_1)); if (datiStimaore.Rows.Count == 0) { DataRow aa = datiStimaore.Rows.Add(); aa["ID_SESSIONE"] = cBusinessObjects.idsessione; aa["ID_CLIENTE"] = cBusinessObjects.idcliente; } foreach (DataRow dtt in datiStimaore.Rows) { txtTotale_Attivo.Text = dtt["Totale_Attivo"].ToString(); txtTotale_Ricavi.Text = dtt["Totale_Ricavi"].ToString(); txtSettore.Text = dtt["txtSettore"].ToString(); txtRischio.Text = dtt["txtRischio"].ToString(); } RicalcolaStimaOre(); datigtCompensoRevisione = cBusinessObjects.GetData(id, typeof(CompensiERisorse_CompensoRevisione_6_1)); datigtCompensoTtotali = cBusinessObjects.GetData(id, typeof(CompensiERisorse_Totali_6_1)); if (datigtCompensoTtotali.Rows.Count == 0) { DataRow dd = datigtCompensoTtotali.Rows.Add(); dd["qualifica"] = "Junior"; dd = datigtCompensoTtotali.Rows.Add(); dd["qualifica"] = "Senior"; dd = datigtCompensoTtotali.Rows.Add(); dd["qualifica"] = "Reviewer"; dd = datigtCompensoTtotali.Rows.Add(); dd["qualifica"] = "Revisore o membro CS"; } _StartingCalculation = false; Binding b = new Binding(); b.Source = datigtCompensoRevisione; dtgAffidamenti.SetBinding(ItemsControl.ItemsSourceProperty, b); gtTotali = new GenericTable(tblTerminiEsecuzione, _ReadOnly); gtTotali.ColumnsAlias = new string[] { "Qualifica", "Ore", "Tariffa", "Compenso" }; gtTotali.ColumnsValues = new string[] { "qualifica", "ore", "tariffa", "compenso" }; gtTotali.ColumnsWidth = new double[] { 7.0, 2.0, 3.0, 3.0 }; gtTotali.ColumnsMinWidth = new double[] { 0.0, 0.0, 0.0, 0.0 }; gtTotali.ColumnsTypes = new string[] { "string", "int", "money", "money" }; gtTotali.ColumnsAlignment = new string[] { "left", "right", "right", "right" }; gtTotali.ColumnsReadOnly = new bool[] { true, true, false, true }; gtTotali.ConditionalReadonly = new bool[] { false, false, false, false }; gtTotali.ConditionalAttribute = "new"; gtTotali.ColumnsHasTotal = new bool[] { false, true, false, true }; gtTotali.AliasTotale = "Totale"; gtTotali.ColumnAliasTotale = 0; gtTotali.dati = datigtCompensoTtotali; gtTotali.xml = false; gtTotali.TotalToBeCalculated += GtCompensoRevisione_TotalToBeCalculated; gtTotali.GenerateTable(); }
/// <summary> /// Wird aufgerufen, sobald eine Tabelle erkannt wurde. /// </summary> /// <param name="table">Die erkannte Tabelle.</param> private void OnTable(GenericTable table) { // Just count m_TotalTables += 1; }
public override void WriteHash(long ID, Dictionary<string, object> data) { this.DeleteHash(ID); GenericTable gt = new GenericTable(squtil, dbTable, mArchiveControl.cfg.IDColumn); foreach (KeyValuePair<string,object> kvp in data) { if (kvp.Key == mArchiveControl.cfg.IDColumn) continue; if (kvp.Value != DBNull.Value) gt[kvp.Key] = kvp.Value; } gt.ID = ID; gt.CreateRecord(); }
/// <summary> /// Reads the excel. /// </summary> /// <param name="stream">The stream.</param> /// <returns>The excel data</returns> public override ITable Read(Stream stream) { var data = new GenericTable(); // Open the excel document WorkbookPart?workbookPart; List <Row> rows; try { var document = SpreadsheetDocument.Open(stream, false); workbookPart = document.WorkbookPart; if (workbookPart is null) { return(data); } var sheets = workbookPart.Workbook.Descendants <Sheet>(); var sheet = sheets.First(); data.Title = sheet.Name?.ToString() ?? ""; var workSheet = ((WorksheetPart)workbookPart .GetPartById(sheet.Id !)).Worksheet; var columns = workSheet.Descendants <Columns>().FirstOrDefault(); var sheetData = workSheet.Elements <SheetData>().First(); rows = sheetData.Elements <Row>().ToList(); } catch (Exception) { return(data); } // Read the header if (rows.Count > 0) { var row = rows[0]; var cellEnumerator = GetExcelCellEnumerator(row); while (cellEnumerator.MoveNext()) { var cell = cellEnumerator.Current; var text = ReadExcelCell(cell, workbookPart).Trim(); data.Columns.Add(text); } } // Read the sheet data if (rows.Count > 1) { for (var i = 1; i < rows.Count; i++) { var dataRow = new GenericRow(); data.Rows.Add(dataRow); var row = rows[i]; var cellEnumerator = GetExcelCellEnumerator(row); while (cellEnumerator.MoveNext()) { var cell = cellEnumerator.Current; var text = ReadExcelCell(cell, workbookPart).Trim(); dataRow.Cells.Add(new GenericCell(text)); } } } return(data); }
/// <summary> /// Saves the object changes. /// </summary> /// <param name="dto">The dto.</param> public void SaveChanges(object dto) { if (this.Visible) { _PaymentMethodDto = dto as PaymentMethodDto; if (_PaymentMethodDto != null && _PaymentMethodDto.PaymentMethodParameter != null) { Gateway gateway = GetGateways().GetGatewayById(Gateways.SelectedValue); Guid paymentMethodId = Guid.Empty; if (_PaymentMethodDto.PaymentMethod.Count > 0) { paymentMethodId = _PaymentMethodDto.PaymentMethod[0].PaymentMethodId; } // add new parameters StringBuilder paramsFilter = new StringBuilder(); if (gateway.Properties != null) { foreach (GatewayProperty prop in gateway.Properties) { System.Web.UI.Control ctrl = GenericTable.FindControl(prop.Name); if (ctrl != null) { string val = ((TextBox)ctrl).Text; PaymentMethodDto.PaymentMethodParameterRow row = GetParameterByName(prop.Name); if (row != null) { row.Value = val; } else { CreateParameter(_PaymentMethodDto, prop.Name, val, paymentMethodId); } paramsFilter.AppendFormat("Parameter <> '{0}' AND ", prop.Name); } } } // add gateway parameter PaymentMethodDto.PaymentMethodParameterRow gRow = GetParameterByName(_GatewayParameterName); if (gRow != null) { gRow.Value = Gateways.SelectedValue; } else { CreateParameter(_PaymentMethodDto, _GatewayParameterName, Gateways.SelectedValue, paymentMethodId); } paramsFilter.AppendFormat("Parameter <> '{0}'", _GatewayParameterName); // remove parameters that are not used anymore string filter = paramsFilter.ToString(); PaymentMethodDto.PaymentMethodParameterRow[] rows = (PaymentMethodDto.PaymentMethodParameterRow[])_PaymentMethodDto.PaymentMethodParameter.Select(filter); if (rows != null && rows.Length > 0) { foreach (PaymentMethodDto.PaymentMethodParameterRow pRow in rows) { pRow.Delete(); } } } } }
/// <summary> /// Saves the object changes. /// </summary> /// <param name="dto">The dto.</param> public void SaveChanges(object dto) { if (Visible) { _PaymentMethodDto = dto as PaymentMethodDto; if (_PaymentMethodDto != null && _PaymentMethodDto.PaymentMethodParameter != null) { var gateway = GetGateways().GetGatewayById(Gateways.SelectedValue); var paymentMethodId = Guid.Empty; if (_PaymentMethodDto.PaymentMethod.Count > 0) { paymentMethodId = _PaymentMethodDto.PaymentMethod[0].PaymentMethodId; } // add new parameters var paramsFilter = new StringBuilder(); if (gateway.Properties != null) { foreach (var prop in gateway.Properties) { var ctrl = GenericTable.FindControl(prop.Name); if (ctrl != null) { var val = ((TextBox)ctrl).Text; var row = GetParameterByName(prop.Name); if (row != null) { row.Value = val; } else { CreateParameter(_PaymentMethodDto, prop.Name, val, paymentMethodId); } paramsFilter.AppendFormat("Parameter <> '{0}' AND ", prop.Name); } } } // add gateway parameter var gRow = GetParameterByName(_GatewayParameterName); if (gRow != null) { gRow.Value = Gateways.SelectedValue; } else { CreateParameter(_PaymentMethodDto, _GatewayParameterName, Gateways.SelectedValue, paymentMethodId); } paramsFilter.AppendFormat("Parameter <> '{0}'", _GatewayParameterName); // add transaction type parameter var trRow = GetParameterByName(_TransactionTypeParameterName); if (trRow != null) { trRow.Value = TransactionTypeList.SelectedValue; } else { CreateParameter(_PaymentMethodDto, _TransactionTypeParameterName, TransactionTypeList.SelectedValue, paymentMethodId); } paramsFilter.AppendFormat(" AND Parameter <> '{0}'", _TransactionTypeParameterName); // remove parameters that are not used anymore var filter = paramsFilter.ToString(); var rows = (PaymentMethodDto.PaymentMethodParameterRow[])_PaymentMethodDto.PaymentMethodParameter.Select(filter); if (rows != null && rows.Length > 0) { foreach (var pRow in rows) { pRow.Delete(); } } } } }
public void LoadDataSource(string ID, string IDCliente, string IDSessione) { id = int.Parse(ID.ToString()); cBusinessObjects.idcliente = int.Parse(IDCliente.ToString()); cBusinessObjects.idsessione = int.Parse(IDSessione.ToString()); ArrayList Al = new ArrayList(); dati = cBusinessObjects.GetData(id, typeof(Excel_F24)); dati_Note = cBusinessObjects.GetData(id, typeof(Excel_F24Note)); foreach (DataRow dtrow in dati.Rows) { if (dtrow["Header"] != null) { if (!Al.Contains(dtrow["Header"].ToString())) { Al.Add(dtrow["Header"].ToString()); } } } if (Al.Count == 0) { Al.Add("F24"); } foreach (string item in Al) { TabItem ti = new TabItem(); ti.Header = item; tabControl.Items.Add(ti); } TabItem tiout = new TabItem(); tiout.Header = App.NewTabHeaderText; tabControl.Items.Add(tiout); gtF24 = new GenericTable(tblF24, _ReadOnly); gtF24.ColumnsAlias = new string[] { "Rif", "Codice Tributo", "Competenza", "Importo Pagato", "Importo Compensato", "Data Pagam.", "Data Scadenza" }; gtF24.ColumnsValues = new string[] { "rif", "codicetributo", "competenza", "importopagato", "importocompensato", "datapagamento", "datascadenza" }; gtF24.ColumnsWidth = new double[] { 1.0, 4.0, 2.0, 2.0, 2.0, 1.0, 1.0 }; gtF24.ColumnsMinWidth = new double[] { 50.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; gtF24.ColumnsTypes = new string[] { "int", "string", "string", "money", "money", "string", "string" }; gtF24.ColumnsAlignment = new string[] { "left", "left", "left", "right", "right", "right", "right" }; gtF24.ConditionalReadonly = new bool[] { false, false, false, false, false, false, false }; gtF24.ConditionalAttribute = "new"; gtF24.ColumnsHasTotal = new bool[] { false, false, false, true, true, false, false }; gtF24.AliasTotale = "Totale"; gtF24.dati = dati; gtF24.xml = false; gtF24.ColumnAliasTotale = 1; gtF24Note = new GenericTable(tblF24Note, _ReadOnly); gtF24Note.ColumnsAlias = new string[] { "Rif", "Note" }; gtF24Note.ColumnsValues = new string[] { "rif", "note" }; gtF24Note.ColumnsWidth = new double[] { 1.0, 10.0 }; gtF24Note.ColumnsMinWidth = new double[] { 50.0, 0.0 }; gtF24Note.ColumnsTypes = new string[] { "int", "string" }; gtF24Note.ColumnsAlignment = new string[] { "left", "left" }; gtF24Note.ConditionalReadonly = new bool[] { false, false }; gtF24Note.ConditionalAttribute = "new"; gtF24Note.ColumnsHasTotal = new bool[] { false, false }; gtF24Note.AliasTotale = "Totale"; gtF24Note.dati = dati_Note; gtF24Note.xml = false; gtF24Note.ColumnAliasTotale = 1; }