private DataTableObject CreateDatatableObject(IEnumerable <Procedimento> procedimentos = null) { var dt = new DataTableObject(); dt.AddHeaders(new List <string> { string.Empty, "Número de Cadastro", "Boletim Unificado", "Boletim de Ocorrência", "Número Processual", "Tipo de Procedimento", "Data de Inserção", "Comarca", "Andamento Processual" }); if (procedimentos != null) { dt.AddDataSet(procedimentos.Select(p => new List <object> { string.Empty, p.Id, p.BoletimUnificado, p.BoletimOcorrencia, p.NumeroProcessual, p.TipoProcedimento.Sigla, p.CriadoEm, p.Comarca.Nome, p.AndamentoProcessual }).ToList()); } return(dt); }
public DataTableViewModel GetRelacaoProcedimentos(int?situacaoId, DateTime?de, DateTime?ate) { var result = _relatorioRepository.GetRelacaoProcedimentos(situacaoId, de, ate); var dt = new DataTableObject(); dt.AddHeaders("Proced n°", "Boletim de Ocorrência", "Artigo", "Indiciados", "Unidade Policial", "Data do Fato", "Instauração", "Situação", "Observação"); dt.AddDataSet(result.Select(x => new Collection <object> { x.NumeroProcedimento, x.BoletimOcorrencia, x.Artigo, x.Indiciados, x.UnidadePolicial, x.DataFato?.ToString("dd/MM/yyyy"), x.Instauracao?.ToString("dd/MM/yyyy"), x.Situacao, x.Observacao })); return(Mapper.Map <DataTableViewModel>(dt)); }
protected override void Execute(NativeActivityContext context) { try { dtable = DataTableObject.Get(context); string lstResult = string.Empty; rowcount = 0; // activitycount = Activities.Count - 1; activitycount = 0; DataRow dataRow = dtable.Rows[rowcount]; CurrentDataRow.Set(context, dataRow); lstResult = Convert.ToString(dataRow[ColumnNumber]); ListResult.Set(context, lstResult); var itemInner = Activities[activitycount]; context.ScheduleActivity(itemInner, onCompleted); } catch (Exception ex) { Logger.Log.Logger.LogData(ex.Message + " in activity DataTableForEach", Logger.LogLevel.Error); if (!ContinueOnError) { context.Abort(); } } }
public List <Product> GetProductTableDataList(DataTableObject Obj) { return(db.ExecuteSprocAccessor(DBRoutine.SELECTPRODUCTTABLEDATA, MapBuilder <Product> .MapAllProperties() //.DoNotMap(p => p.ProductCategoryDescription) .Build(), Obj.limit, Obj.offset, Obj.sortColumn, Obj.sortType).ToList()); }
public DataTableObject <IEnumerable <ViewModels.RateListViewModel> > GetRatesForBase(DataTableParams p, string baseCurrency) { Lookups.CurrencyLookup c = new Lookups.CurrencyLookup(); var res = DIResolver.Data.NinjectConfig.GetKernal().Get <CuMaster.Data.RepositoryInterfaces.IRateTrendsRepository>(); DataTableObject <IEnumerable <Data.Entities.CurrencyRateEntity> > result = res.GetForDataTable(baseCurrency, p); return(new DataTableObject <IEnumerable <ViewModels.RateListViewModel> > { data = ((IEnumerable <Data.Entities.CurrencyRateEntity>)result.data).Select(t => new RateListViewModel { BaseCurrency = t.FromCurrency, CurrencyTo = t.ToCurrency, CurrencyToName = t.ToCurrencyName, DateUpdated = t.LastUpdated, RateFowards = t.Rate, RateInverse = (t.Rate != 0) ? (1 / t.Rate) : 0, IsFromRateCrypto = t.IsCryptoFrom, IsToRateCrypto = t.IsCryptoTo }), extraData = result.extraData, recordsFiltered = result.recordsFiltered, recordsTotal = result.recordsTotal, draw = result.draw }); }
protected override void Execute(NativeActivityContext context) { dt.DataTable db = new System.Data.DataTable(); System.Data.DataTable dtable = null; try { string strcolumnName = string.Empty; strcolumnName = ColumnName.Get(context); dtable = DataTableObject.Get(context); DataColumn colString = new DataColumn(strcolumnName); if (string.IsNullOrEmpty(ColumnType)) { ColumnType = "System.String"; } colString.DataType = System.Type.GetType(ColumnType); dtable.Columns.Add(colString); } catch (Exception ex) { Logger.Log.Logger.LogData(ex.Message + " in activity DataTableAddColumn", Logger.LogLevel.Error); if (!ContinueOnError) { context.Abort(); } } }
public List <CourseSalesMaster> GetProductTableDataList(DataTableObject Obj) { return(db.ExecuteSprocAccessor(DBRoutine.SELECTEDUCOURSESALESMASTERTABLEDATA, MapBuilder <CourseSalesMaster> .MapAllProperties() //.DoNotMap(p => p.ProductCategoryDescription) .Build(), Obj.limit, Obj.offset, Obj.sortColumn, Obj.sortType).ToList()); }
public JsonResult VendorInvoiceList(DataTableObject Obj) { try { Obj.BranchID = BRANCH_ID; var vendorInvoiceList = new InvoiceHeaderBO() .GetVendorInvoiceDataTableList(Obj, UTILITY.CONFIG_INVOICETYPE_VENDOR) .Select(x => new { DocumentNo = x.DocumentNo, InvoiceNo = x.InvoiceNo, CusInvoiceNo = x.CusInvoiceNo, CustomerCode = x.CustomerCode, CustomerName = x.CustomerName, ProductCode = x.ProductCode, ProductName = x.ProductName, InvoiceDate = x.InvoiceDate.ToShortDateString(), WarrantyExpiryDate = x.WarrantyExpiryDate.ToShortDateString(), Quantity = x.Quantity, UnitPrice = x.UnitPrice, EncryptStr = UrlEncryptionHelper.Encrypt(string.Format("invoiceNo={0}?documentNo={1}", x.InvoiceNo, x.DocumentNo)) }).ToList(); var totalRecords = new InvoiceHeaderBO().GetList(BRANCH_ID).Where(x => x.InvoiceType == UTILITY.CONFIG_INVOICETYPE_VENDOR && x.Status == true).Count(); return(Json(new { vendorInvoiceList = vendorInvoiceList, totalRecords = totalRecords }, JsonRequestBehavior.AllowGet)); } catch (Exception ex) { return(Json(new { }, JsonRequestBehavior.AllowGet)); } }
protected override void Control_Load() { this.DataTableObject = jQueryExtension.Select<jQueryPluginObject>("#" + _table.ControlId).dataTable( new Dictionary( "bJQueryUI", _enablejQueryTheme) ); //_isDataTablesRendered = true; Control_SetProperties(); base.Control_Load(); }
public CLigneTableParametrable[] SelectRows(string strRequete) { DataRow[] rows = DataTableObject.Select(strRequete); List <CLigneTableParametrable> result = new List <CLigneTableParametrable>(); foreach (DataRow r in rows) { result.Add(r); } return(result.ToArray()); //return null; }
public int[] GetIndexOfRowsContains(string strColumnName, string strRecherche) { if (!DataTableObject.Columns.Contains(strColumnName)) { return(new int[0]); } List <int> listeIndexes = new List <int>(); DataRow[] resultRows = DataTableObject.Select(strColumnName + "= '" + strRecherche + "'"); foreach (DataRow row in resultRows) { listeIndexes.Add(DataTableObject.Rows.IndexOf(row)); } return(listeIndexes.ToArray()); }
public int GetFirstNotUsedValue(string strColumnName, int nValMin, int nValMax) { if (!DataTableObject.Columns.Contains(strColumnName)) { return(nValMin - 2); } for (int n = nValMin; n <= nValMax; n++) { DataRow[] rows = DataTableObject.Select(strColumnName + "=" + n.ToString()); if (rows.Length == 0) { return(n); } } return(nValMin - 1); }
public JsonResult GetCustomers(DataTableObject Obj) { Obj.BranchID = BRANCH_ID; var customers = new CustomerBO().GetCustomerTableDataList(Obj); var totalRecords = new CustomerBO().GetList(BRANCH_ID).Count(); return(Json(new { customers = customers.Select(x => new { CustomerTypeDescription = x.CustomerTypeDescription, CustomerCode = x.CustomerCode, CustomerName = x.CustomerName, Status = x.Status, EncryptStr = UrlEncryptionHelper.Encrypt(string.Format("customerCode={0}", x.CustomerCode)) }), totalRecords = totalRecords }, JsonRequestBehavior.AllowGet)); }
public DataTableViewModel GetEstatisticaAssunto(DateTime?de, DateTime?ate) { var result = _relatorioRepository.GetEstatisticaAssunto(de, ate); var dt = new DataTableObject(); dt.AddHeaders("Delitos", "Em Andamento", "Na Justiça", "Relatado", "Outra UniPol", "Total"); dt.AddDataSet(result.Select(x => new Collection <object> { x.Assunto, x.EmAndamento, x.NaJustica, x.Relatado, x.OutraUniPol, x.Total })); return(Mapper.Map <DataTableViewModel>(dt)); }
public EmailAlertListViewModel(DataTableObject <IEnumerable <Data.Entities.EmailAlertRecordEntity> > dt) //needs to take in the data to create the datatableobject properly, from library? { this.ListDataTable = new DataTableObject <IEnumerable <EmailAlertRecordViewModel> > { data = ((IEnumerable <Data.Entities.EmailAlertRecordEntity>)dt.data).Select(t => new EmailAlertRecordViewModel { AlertID = t.AlertID, CurrencyFrom = t.CurrencyFrom, CurrencyFromName = t.CurrencyFromName, CurrencyTo = t.CurrencyTo, CurrencyToName = t.CurrencyToName, DateCreated = t.DateCreated, Email = t.Email, LastSent = t.LastSent, PercentageChange = t.PercentageChange, TimeToSend = t.TimeToSend }), extraData = dt.extraData, recordsFiltered = dt.recordsFiltered, recordsTotal = dt.recordsTotal }; }
public ConversionTrackerListViewModel(DataTableObject<IEnumerable<Data.Entities.ConversionTrackerEntity>> dt) //needs to take in the data to create the datatableobject properly, from library? { this.EntryListDataTable = new DataTableObject<IEnumerable<ConversionTrackerViewModel>> { data = ((IEnumerable<Data.Entities.ConversionTrackerEntity>)dt.data).Select(t => new ConversionTrackerViewModel { AmountFrom = t.FromAmount, AmountTo = t.ToAmount, EntryID = t.EntryID, EntryName = t.EntryName, AutoUpdate = t.UpdateRate, CurrencyFrom = t.CurrencyFrom, CurrencyTo = t.CurrencyTo, LastUpdated = t.LastUpdatedDate, RateUsed = t.RateToUse, IsCrypto = t.IsCrypto }), extraData = dt.extraData, recordsFiltered = dt.recordsFiltered, recordsTotal = dt.recordsTotal }; }
public DataTableViewModel GetRelacaoVitimas() { var result = _relatorioRepository.GetRelacaoVitimas(); var dt = new DataTableObject(); dt.AddHeaders("Vítima", "Proced. n°", "Artigo", "Tipo de Procedimento", "Situação"); dt.AddDataSet(result.Select(x => new Collection <object> { x.Vitima, x.NumeroProcedimento, x.Artigo, x.TipoProcedimento, x.SituacaoAtual })); return(Mapper.Map <DataTableViewModel>(dt)); }
public List <InvoiceHeaderData> GetVendorInvoiceDataTableList(DataTableObject Obj, Int16 invoiceType) { return(invoiceheaderDAL.GetVendorInvoiceDataTableList(Obj, invoiceType)); }
public CLigneTableParametrable CreateRow() { return(DataTableObject.NewRow()); }
public List <InvoiceHeaderData> GetVendorInvoiceDataTableList(DataTableObject Obj, Int16 invoiceType) { return(db.ExecuteSprocAccessor(DBRoutine.LISTINVOICEHEADERDATATABLELIST2, MapBuilder <InvoiceHeaderData> .BuildAllProperties(), Obj.limit, Obj.offset, Obj.sortColumn, Obj.sortType, invoiceType, Obj.BranchID).ToList()); }
//public List<Customer> GetCustomerTableDataList(DataTableObject Obj) //{ // return db.ExecuteSprocAccessor(DBRoutine.SELECTCUSTOMERTABLEDATA, // MapBuilder<Customer>.BuildAllProperties(), // Obj.limit, Obj.offset, Obj.sortColumn, Obj.sortType,Obj.BranchID).ToList(); //} public List <Customer> GetCustomerTableDataList(DataTableObject Obj) { return(db.ExecuteSprocAccessor(DBRoutine.CUSTOMERPAGEVIEW, MapBuilder <Customer> .BuildAllProperties(), Obj.BranchID, Obj.limit, Obj.offset, Obj.sortColumn, Obj.sortType).ToList()); }
public async Task <object[]> SyncAsync(string soqlQuery, SqlSyncWriter writer) { if (string.IsNullOrWhiteSpace(soqlQuery)) { throw new ArgumentNullException(nameof(soqlQuery)); } if (writer == null) { throw new ArgumentNullException(nameof(writer)); } // if not login yet then login if (_soapClient == null) { await LoginAsync(); } List <object> writeResult = new List <object>(); try { // read data from sfdc Logger.LogInfo("Querying from Sfdc"); Logger.LogDebug($"SOQL: {soqlQuery}"); queryResponse queryResponse = await _soapClient.queryAsync(_sessionHeader, null, null, null, null, soqlQuery); QueryResult queryResult = queryResponse.result; if (queryResult.records == null) { Logger.LogInfo($"No result return from Sfdc"); return(null); } Logger.LogInfo( $"Querying from Sfdc returning {queryResult.records.Length} records from {queryResult.size} total records"); // loop fetch data from sfdc when is not done bool done; do { done = queryResult.done; // ReSharper disable once InvertIf if (queryResult.size > 0) { // write data DataTableObject data = new DataTableObject(queryResult.records); Logger.LogInfo($"Writing to destination {data.Length} records"); object[] ids = await writer(data); Logger.LogInfo($"Writing to destination completed"); writeResult.AddRange(ids); // query more record if (!queryResult.done) { Logger.LogInfo("Querying more record from Sfdc"); queryMoreResponse queryMoreResponse = await _soapClient.queryMoreAsync(_sessionHeader, null, null, queryResult.queryLocator); queryResult = queryMoreResponse.result; Logger.LogInfo($"Querying more record from Sfdc returning {queryResult.records.Length} records"); } } } while (!done); } catch (Exception e) { throw new Exception("Error sync data.", e); } return(writeResult.ToArray()); }
public List <Customer> GetCustomerTableDataList(DataTableObject Obj) { return(customerDAL.GetCustomerTableDataList(Obj)); }
public async Task <UpsertResult[]> UpsertAsync(DataTableObject data) { if (data == null || !data.Any()) { return(null); } if (Command == null) { throw new NotSupportedException($"{nameof(Command)} can't be null"); } if (string.IsNullOrWhiteSpace(Command.Object)) { throw new NotSupportedException($"{nameof(Command.Object)} can't be null"); } if (string.IsNullOrWhiteSpace(Command.UpsertKeyField)) { throw new NotSupportedException($"{nameof(Command.UpsertKeyField)} can't be null"); } // if not login yet then login if (_soapClient == null) { await LoginAsync(); } // upsert sObject[] sObjects = data.ToSObjectArray(Command.Object, Map); Logger.LogInfo($"Executing Upsert {sObjects.Length} records to Sfdc using {Command.UpsertKeyField} as external id"); Stopwatch stopwatch = Stopwatch.StartNew(); upsertResponse upsertResponse = await _soapClient.upsertAsync(_sessionHeader, null, null, null, null, null, null, null, null, null, null, null, null, null, Command.UpsertKeyField, sObjects); stopwatch.Stop(); Logger.LogInfo($"Executing Upsert completed on {stopwatch.ElapsedMilliseconds} ms"); // logging result Logger.LogInfo($"Logging result"); if (ResultLogger != null) { string keyField = Command.UpsertKeyField; if (Map != null && Map.Any()) { FieldMapping mapKeyField = Map.SingleOrDefault(x => x.To.Equals(Command.UpsertKeyField)); if (mapKeyField == null) { throw new Exception("KeyField not found on Mapping"); } keyField = mapKeyField.From; } await ResultLogger.WriteLog(upsertResponse.result, data, keyField); } return(upsertResponse.result); }
public List <Product> GetProductTableDataList(DataTableObject Obj) { return(productDAL.GetProductTableDataList(Obj)); }