public void FormatoElementoDesgasteDanio(Valorizacion valorizacion) { const string nameRelation = "maquinaria.vwvalorizacion"; string whereList = string.Format("idvalorizacion = {0}", valorizacion.Idvalorizacion); const string ordersList = "idvalorizacion"; const string fieldsList = "*"; DataTable dt = HelperDb.SqlConsulta(nameRelation, whereList, ordersList, fieldsList); DataTable dtDet = HelperDb.SqlConsulta("maquinaria.vwvalorizaciondanioelementoimp", string.Format("idvalorizacion = {0}", valorizacion.Idvalorizacion), "idarticulogrupo", "*"); DataTable eddCab = HelperDb.SqlConsulta("maquinaria.vwvalorizaciondanioelemento", string.Format("idvalorizacion = {0}", valorizacion.Idvalorizacion), "idvalorizaciondanioelemento", "*"); Report report = new Report(); string nameReporte = FilesHelper.FindingFileName(Application.StartupPath, string.Format("Reportes\\Ventas\\{0}", "elementodesgastedanio.frx")); report.Load(nameReporte); report.RegisterData(dt, "valorizacion"); report.RegisterData(dtDet, "edd"); report.RegisterData(eddCab, "eddc"); report.RegisterData(VwSucursalList, "emp"); ReportHelper1 reportHelper1 = new ReportHelper1(report); reportHelper1.ShowDialog(); }
public void FormatoCierreCaja(Cierrecaja cierrecaja) { const string nameRelation = "caja.vwcierrecajaimpresion"; string whereList = string.Format("idcierrecaja = {0}", cierrecaja.Idcierrecaja); const string ordersList = "idmediopago"; const string fieldsList = "*"; DataSet dsRecibo = new DataSet { DataSetName = "reciboresumen" }; DataTable dtEmpresa = HelperDb.SqlConsulta("inntecc.vwsucursal", string.Format("idsucursal = {0}", SessionApp.SucursalSel.Idsucursal), null, "*"); DataTable dt = HelperDb.SqlConsulta(nameRelation, whereList, ordersList, fieldsList); DataTable dtRecibo = dt.Copy(); dtRecibo.TableName = "reciboresumen"; DataTable dtEmpresaSel = dtEmpresa.Copy(); dtEmpresaSel.TableName = "empresa"; dsRecibo.Tables.Add(dtRecibo); dsRecibo.Tables.Add(dtEmpresaSel); string nameReporte = FilesHelper.FindingFileName(Application.StartupPath, "Reportes\\Finanzas\\reciboresumen.repx"); ReportHelper3 reportHelper3 = new ReportHelper3(nameReporte, dsRecibo, null, "reciboresumen"); reportHelper3.ShowDialog(); }
public void FormatoCierreCajaDetalle(int idEmpleado, DateTime fechaCierrecaja) { const string nameRelation = "finanzas.vwreciboingresoegresodet"; string whereList = string.Format("idempleado {0} and fechapago = '{1:yyyy-MM-dd}'", idEmpleado, fechaCierrecaja); const string ordersList = "fechapago"; const string fieldsList = "*"; DataSet dsRecibo = new DataSet { DataSetName = "dsie" }; DataTable dtEmpresa = HelperDb.SqlConsulta("inntecc.vwsucursal", string.Format("idsucursal = {0}", SessionApp.SucursalSel.Idsucursal), null, "*"); DataTable dt = HelperDb.SqlConsulta(nameRelation, whereList, ordersList, fieldsList); DataTable dtRecibo = dt.Copy(); dtRecibo.TableName = "rd"; DataTable dtEmpresaSel = dtEmpresa.Copy(); dtEmpresaSel.TableName = "empresa"; dsRecibo.Tables.Add(dtRecibo); dsRecibo.Tables.Add(dtEmpresaSel); string nameReporte = FilesHelper.FindingFileName(Application.StartupPath, "Reportes\\Finanzas\\reciboingresoegresodet.repx"); ReportHelper3 reportHelper3 = new ReportHelper3(nameReporte, dsRecibo, null, "ingresoegresodetallado"); reportHelper3.ShowDialog(); }
public void FormatoRendicionCajaChica(Rendicioncajachica rendicioncajachica) { var tipocp = Service.GetTipocp(x => x.Idtipocp == rendicioncajachica.Idtipocp); const string nameRelation = "finanzas.vwrendicioncajachicaimpresion"; string whereList = string.Format("idrendicioncajachica = {0}", rendicioncajachica.Idrendicioncajachica); const string ordersList = "numeroitem"; const string fieldsList = "*"; DataTable dt = HelperDb.SqlConsulta(nameRelation, whereList, ordersList, fieldsList); if (string.IsNullOrEmpty(tipocp.Nombrereporte)) { XtraMessageBox.Show("No se asignó un formato de impresión", "Atención", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return; } Report report = new Report(); string nameReporte = FilesHelper.FindingFileName(Application.StartupPath, string.Format("Reportes\\Finanzas\\{0}", tipocp.Nombrereporte.Trim())); report.Load(nameReporte); report.RegisterData(dt, "rdcch"); report.RegisterData(VwSucursalList, "emp"); ReportHelper1 reportHelper1 = new ReportHelper1(report); reportHelper1.ShowDialog(); }
public void FormatoValorizacionProveedor(Valorizacionproveedor valorizacion) { List <VwValorizacionegresoproveedor> vwValorizacionegresoList = Service.GetAllVwValorizacionegresoproveedor(x => x.Idvalorizacionproveedor == valorizacion.Idvalorizacionproveedor); var tipocp = Service.GetTipocp(x => x.Idtipocp == valorizacion.Idtipocp); const string nameRelation = "maquinaria.vwvalorizacionproveedorimpresion"; string whereList = string.Format("idvalorizacionproveedor = {0}", valorizacion.Idvalorizacionproveedor); const string ordersList = "numeroitem"; const string fieldsList = "*"; DataTable dt = HelperDb.SqlConsulta(nameRelation, whereList, ordersList, fieldsList); if (string.IsNullOrEmpty(tipocp.Nombrereporte)) { XtraMessageBox.Show("No se asignó un formato de impresión", "Atención", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return; } Report report = new Report(); string nameReporte = FilesHelper.FindingFileName(Application.StartupPath, string.Format("Reportes\\Ventas\\{0}", tipocp.Nombrereporte.Trim())); report.Load(nameReporte); report.RegisterData(dt, "valorizacion"); report.RegisterData(vwValorizacionegresoList, "valorizaegreso"); report.RegisterData(VwSucursalList, "emp"); ReportHelper1 reportHelper1 = new ReportHelper1(report); reportHelper1.ShowDialog(); }
private string GetDefaultFilePath() { // this routine appears to have the only purpose of find a file!? string x = Path.Combine(this.DefaultPath, "SomeSubDir", this.DefaultFileName); return(Path.GetDirectoryName(FilesHelper.FindingFileName(Application.StartupPath, x, true))); }
public void FormatoOrdenDeServicio(Ordenservicio ordenservicio) { var tipocp = Service.GetTipocp(x => x.Idtipocp == ordenservicio.Idtipocp); const string nameRelation = "compras.vwordenservicioimpresion"; string whereList = string.Format("idordenservicio = {0}", ordenservicio.Idordenservicio); const string ordersList = "numeroitem"; const string fieldsList = "*"; DataTable dt = HelperDb.SqlConsulta(nameRelation, whereList, ordersList, fieldsList); if (string.IsNullOrEmpty(tipocp.Nombrereporte)) { XtraMessageBox.Show("No se asignó un formato de impresión", "Atención", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return; } var report = new Report(); string nameReporte = FilesHelper.FindingFileName(Application.StartupPath, string.Format("Reportes\\Compras\\{0}", tipocp.Nombrereporte.Trim())); report.Load(nameReporte); report.RegisterData(dt, "oc"); report.RegisterData(VwSucursalList, "emp"); ReportHelper1 reportHelper1 = new ReportHelper1(report); reportHelper1.ShowDialog(); }
public static DataTable GetHousesSalesTable() { if (housesSales == null) { DataSet temp = new DataSet(); temp.ReadXml(FilesHelper.FindingFileName(Application.StartupPath, "Data\\HousesSales.xml", false)); housesSales = temp.Tables[0]; } return(housesSales); }
public void VistaPreviaNotaCreditoCliente(Notacreditocli notacreditocliMnt) { Tipocp tipocp = Service.GetTipocp(x => x.Idtipocp == notacreditocliMnt.Idtipocp); const string nameRelation = "ventas.vwnotacreditocliimpresion"; string whereList = string.Format("idnotacreditocli = {0}", notacreditocliMnt.Idnotacreditocli); const string ordersList = "numeroitem"; const string fieldsList = "*"; DataTable dt = HelperDb.SqlConsulta(nameRelation, whereList, ordersList, fieldsList); dt.TableName = "cp"; if (string.IsNullOrEmpty(tipocp.Nombrereporte)) { XtraMessageBox.Show("No se asignó un formato de impresión", "Atención", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return; } //ImporteLetras string importeDocumentoLetra = UtilityReport.ToNumberLetters(notacreditocliMnt.Totaldocumento.ToString(CultureInfo.InvariantCulture)); string nameReporte = FilesHelper.FindingFileName(Application.StartupPath, string.Format("Reportes\\Ventas\\{0}", tipocp.Nombrereporte.Trim())); switch (tipocp.Tiporeporteador) { case 0: //FastReport Report fastReport = new Report(); fastReport.Load(nameReporte); fastReport.RegisterData(dt, "cp"); fastReport.RegisterData(VwSucursalList, "emp"); fastReport.SetParameterValue("ImporteDocLetras", importeDocumentoLetra); ReportHelper1 reportHelper1 = new ReportHelper1(fastReport); reportHelper1.ShowDialog(); break; case 1: //XtraReport //XtraReport xtraReport = new XtraReport { DataSource = dt }; //xtraReport.LoadLayout(nameReporte); //Parametros object[] parametrosReporte = { importeDocumentoLetra }; ReportHelper2 reportHelper2 = new ReportHelper2(nameReporte, dt, parametrosReporte, "NotaCreditoCliente"); reportHelper2.ShowDialog(); break; } }
public static BindingList <TaskRecord> LoadTasks() { string file = FilesHelper.FindingFileName(Application.StartupPath, "Data\\KanbanModuleData\\KanbanTasks.xml"); var _tasks = new BindingList <TaskRecord>(); using (var reader = new StreamReader(file)) { XmlSerializer deserializer = new XmlSerializer(typeof(TaskList), new XmlRootAttribute("DocumentElement")); var taskList = (TaskList)deserializer.Deserialize(reader); _tasks = taskList.List; } return(_tasks); }
private void Reporte() { string nameRelation = null; string whereList = null; string ordersList = null; string fieldsList = null; string nameFileReport = null; List <VwSucursal> vwSucursalList = Service.GetAllVwSucursal(x => x.Idempresa == SessionApp.EmpresaSel.Idempresa); switch (lbOptions.SelectedIndex) { case 0: nameRelation = "reportes.vwlistadosocionegocio"; whereList = "idsocionegocio IN (select a.idcliente from ventas.cpventa a)"; ordersList = "razonsocial"; fieldsList = "*"; nameFileReport = "listadoclientes.frx"; break; case 1: nameRelation = "reportes.vwlistadosocionegocio"; whereList = "idsocionegocio IN (select a.idproveedor from compras.cpcompra a)"; ordersList = "razonsocial"; fieldsList = "*"; nameFileReport = "listadoproveedores.frx"; break; } DataTable dt = HelperDb.SqlConsulta(nameRelation, whereList, ordersList, fieldsList); var report = new Report(); var reporte = FilesHelper.FindingFileName(Application.StartupPath, string.Format("Reportes\\Gerencia\\{0}", nameFileReport)); report.Load(reporte); report.RegisterData(dt, "lis"); report.RegisterData(vwSucursalList, "emp"); int opcionReporte = (int)rgOpcionReporte.EditValue; switch (opcionReporte) { case 0: //Vistaprevia report.Show(); break; case 1: //Diseño report.Design(); break; } report.Dispose(); }
private static DataTable CreateDataTable(string table) { DataSet dataSet = new DataSet(); string dataFile = FilesHelper.FindingFileName(Application.StartupPath, "Data\\Mail.xml"); if (dataFile != string.Empty) { FileInfo fi = new FileInfo(dataFile); dataSet.ReadXml(fi.FullName); return(dataSet.Tables[table]); } return(null); }
static DataSet GetDataSet(string name) { string dataFile = FilesHelper.FindingFileName(Application.StartupPath, name); DataSet result = null; if (!string.IsNullOrEmpty(dataFile) && !dataSets.TryGetValue(dataFile, out result)) { result = new DataSet(name); result.ReadXml(dataFile); dataSets.Add(dataFile, result); } return(result); }
private void btnImprimir_Click(object sender, EventArgs e) { // DataTable dt = HelperDb.SqlConsulta(nameRelation, whereList, ordersList, fieldsList); var report = new Report(); const string nameFileReport = "ultimoscostos.frx"; string reporte = FilesHelper.FindingFileName(Application.StartupPath, string.Format("Reportes\\Compras\\{0}", nameFileReport)); report.Load(reporte); report.RegisterData(DtUc, "uc"); //report.Design(); report.Show(); report.Dispose(); }
public static DataTable LoadMembers() { string file = FilesHelper.FindingFileName(Application.StartupPath, "Data\\KanbanModuleData\\KanbanMembers.xml"); var members = new DataTable(); members.TableName = "TaskMembers"; members.Columns.Add("TaskID", typeof(Int32)); members.Columns.Add("MemberID", typeof(Int32)); if (!String.IsNullOrEmpty(file) && System.IO.File.Exists(file)) { members.ReadXml(file); } return(members); }
/// <summary> /// 加载数据 /// </summary> /// <param name="tableName"></param> /// <returns></returns> IList GetXMLData(string tableName) { var xmlFileName = FilesHelper.FindingFileName(Application.StartupPath, "Data\\nwindSalesPerson.xml"); if (string.IsNullOrEmpty(xmlFileName)) { return(null); } using (DataSet dataSet = new DataSet()) { dataSet.ReadXml(xmlFileName); return(dataSet.Tables[tableName].DefaultView); } }
private void Form1_Load(object sender, EventArgs e) { this.snapControl1.DataSources.Add(string.Empty, CreateDataSource()); this.snapControl1.Options.SnapMailMergeVisualOptions.DataSourceName = string.Empty; string filename = FilesHelper.FindingFileName(AppDomain.CurrentDomain.BaseDirectory, @"Data\template.snx", true); if (File.Exists(filename)) { this.snapControl1.Document.LoadDocument(filename, SnapDocumentFormat.Snap); } this.snapControl1.ReplaceService <ISnapMailMergeProgressIndicationService>( new MyProgressIndicationService(this.snapControl1)); }
public static DataTable LoadChecklist() { string file = FilesHelper.FindingFileName(Application.StartupPath, "Data\\KanbanModuleData\\KanbanChecklist.xml"); var checklist = new DataTable(); checklist.TableName = "TaskChecklist"; checklist.Columns.Add("TaskID", typeof(Int32)); checklist.Columns.Add("Caption", typeof(String)); checklist.Columns.Add("Checked", typeof(Boolean)); if (!String.IsNullOrEmpty(file) && System.IO.File.Exists(file)) { checklist.ReadXml(file); } return(checklist); }
public object GetDataSource() { string path = FilesHelper.FindingFileName(AppDomain.CurrentDomain.BaseDirectory, @"Data\nwind.mdb", false); var dataSource = new nwindDataSet(); var connection = new OleDbConnection(); connection.ConnectionString = string.Format(@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source={0}", path); FillDataSource(connection, dataSource); var bindingSource = new BindingSource(); bindingSource.DataSource = dataSource; bindingSource.DataMember = DataMember; return(bindingSource); }
static List <Agent> GetAgents() { List <Agent> ret = new List <Agent>(); DataSet temp = new DataSet(); string dbName = FilesHelper.FindingFileName(Application.StartupPath, "Data\\Homes.xml", false); if (string.IsNullOrEmpty(dbName)) { return(ret); } temp.ReadXml(dbName); foreach (DataRow row in temp.Tables["Agents"].Rows) { ret.Add(new Agent(row)); } return(ret); }
public static DataTable LoadEmployees() { string DBFileName = string.Empty; string connectionString = string.Empty; DBFileName = FilesHelper.FindingFileName(Application.StartupPath, "Data\\nwind.xml"); if (String.IsNullOrEmpty(DBFileName)) { return(null); } DataSet ds = new DataSet(); ds.ReadXml(DBFileName); var table = ds.Tables["Employees"]; table.PrimaryKey = new DataColumn[] { table.Columns["EmployeeID"] }; return(table); }
internal static List <Contacto> GetContacts() { List <Contacto> ret = new List <Contacto>(); DataSet temp = new DataSet(); string dbName = FilesHelper.FindingFileName(Application.StartupPath, "Data\\VideoRent.xml", false); if (string.IsNullOrEmpty(dbName)) { return(ret); } temp.ReadXml(dbName); DataTable tbl = temp.Relations["FK_CustomerOidOidPerson"].ChildTable; for (int i = 0; i < tbl.Rows.Count; i++) { ret.Add(new Contacto(tbl.Rows[i], tbl.Rows[i].GetParentRow("FK_CustomerOidOidPerson"))); } return(ret); }
public void FormatoCpVentaImpresora(int idCpVenta) { const string nameRelation = "ventas.vwcpventaimpresion"; string whereList = string.Format("idcpventa = {0}", idCpVenta); const string ordersList = "numeroitem"; const string fieldsList = "*"; DataTable dtCpVenta = HelperDb.SqlConsulta(nameRelation, whereList, ordersList, fieldsList); dtCpVenta.TableName = "cp"; DataRow row = dtCpVenta.Rows[0]; string nombreArchivoReporte = row["nombrereporte"].ToString(); decimal totalDocumento = Convert.ToDecimal(row["totaldocumento"]); string nombreTipoMoneda = row["nombretipomoneda"].ToString(); string nombreReporte = string.Format("{0} {1}-{2}", row["nombretipoformato"].ToString().Trim(), row["seriecpventa"].ToString().Trim(), row["numerocpventa"].ToString().Trim()); if (string.IsNullOrEmpty(nombreArchivoReporte)) { XtraMessageBox.Show("No se asignó un formato de impresión", "Atención", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return; } string importeDocumentoLetra = string.Format("{0} {1}", UtilityReport.ToNumberLetters(totalDocumento.ToString(CultureInfo.InvariantCulture)), nombreTipoMoneda); string nombreArchivoImpresion = FilesHelper.FindingFileName(Application.StartupPath, string.Format("Reportes\\Ventas\\{0}", nombreArchivoReporte)); object[] parametrosReporte = { importeDocumentoLetra }; XtraReportCustom report = PrepareReport(dtCpVenta, parametrosReporte, nombreArchivoImpresion, nombreReporte); report.PrintDialog(); }
private void Reporte() { DateTime fechaInicio = (DateTime)iFechaInicio.EditValue; DateTime fechaFinal = (DateTime)iFechaFinal.EditValue; string sqlQuery; string nameFileReport = string.Empty; DataTable dt = null; object[] parametros = { fechaInicio, fechaFinal, iIdCentroCosto.EditValue, SessionApp.SucursalSel.Idsucursal }; switch (lbOptions.SelectedIndex) { case 0: //Ordenes de compra pendiente de ingresos sqlQuery = "reportes.fn_gastos_cc_resumen_articulo"; dt = HelperDb.ExecuteStoreProcedure(sqlQuery, parametros); nameFileReport = "centrocostoxarticulo.repx"; break; case 1: //Ordenes de compra pendiente de comprobante de compra sqlQuery = "reportes.fn_gastos_cc_x_cp"; dt = HelperDb.ExecuteStoreProcedure(sqlQuery, parametros); nameFileReport = "centrocostoxcomprobante.repx"; break; } string rutaArchivoReporte = FilesHelper.FindingFileName(Application.StartupPath, string.Format("Reportes\\Gerencia\\{0}", nameFileReport)); XtraReport xtraReport = new XtraReport { DataSource = dt }; xtraReport.LoadLayout(rutaArchivoReporte); ReportHelper2 reportHelper2 = new ReportHelper2(rutaArchivoReporte, dt, null, null); int opcionReporte = (int)rgOpcionReporte.EditValue; switch (opcionReporte) { case 0: //Vistaprevia reportHelper2.ShowDialog(); break; case 1: //Diseño reportHelper2.ShowDialog(); break; } reportHelper2.Dispose(); }
private void Reporte() { DateTime fechaInicio = (DateTime)iFechaInicio.EditValue; DateTime fechaFinal = (DateTime)iFechaFinal.EditValue; int idTipoMoneda = (int)iIdtipomoneda.EditValue; var idProveedor = iIdsocionegocio.EditValue; string whereProveedor; string nameRelation; string whereList; string ordersList; string fieldsList; string nameFileReport = string.Empty; string nameAlias = null; DataTable dt = null; string rutaReporte = null; switch (lbOptions.SelectedIndex) { case 0: //Resumen de entradas a almacen nameRelation = "almacen.vwresumensalidaalmacen"; whereProveedor = idProveedor != null?string.Format(" and idsocionegocio = {0}", (int)idProveedor) : string.Empty; whereList = string.Format("fechasalida BETWEEN '{0}' and '{1}' and idsucursal = {2} {3} and idtipomoneda = {4} and anulado = '0'" , fechaInicio.ToString("yyyy-MM-dd") , fechaFinal.ToString("yyyy-MM-dd") , SessionApp.SucursalSel.Idsucursal , whereProveedor , idTipoMoneda); ordersList = "razonsocial,seriesalidaalmacen,numerosalidaalmacen"; fieldsList = "*"; dt = HelperDb.SqlConsulta(nameRelation, whereList, ordersList, fieldsList); nameFileReport = "salidaalmacenres.frx"; nameAlias = "en"; rutaReporte = "Reportes\\Almacen\\"; break; case 1: //Entradas de almacen detallado nameRelation = "almacen.vwsalidaalmacendetallado"; whereProveedor = idProveedor != null?string.Format(" and idsocionegocio = {0}", (int)idProveedor) : string.Empty; whereList = string.Format("fechasalida BETWEEN '{0}' and '{1}' and idsucursal = {2} {3} and idtipomoneda = {4} and anulado = '0'" , fechaInicio.ToString("yyyy-MM-dd") , fechaFinal.ToString("yyyy-MM-dd") , SessionApp.SucursalSel.Idsucursal , whereProveedor , idTipoMoneda); ordersList = "razonsocial,serienumerosalida,numeroitem"; fieldsList = "*"; dt = HelperDb.SqlConsulta(nameRelation, whereList, ordersList, fieldsList); nameFileReport = "salidaalmacendet.frx"; nameAlias = "en"; rutaReporte = "Reportes\\Almacen\\"; break; } var report = new Report(); string reporte = FilesHelper.FindingFileName(Application.StartupPath, string.Format("{0}{1}", rutaReporte, nameFileReport)); report.Load(reporte); report.RegisterData(dt, nameAlias); report.SetParameterValue("FechaInicio", fechaInicio); report.SetParameterValue("FechaFinal", fechaFinal); int opcionReporte = (int)rgOpcionReporte.EditValue; switch (opcionReporte) { case 0: //Vistaprevia report.Show(); break; case 1: //Diseño report.Design(); break; } report.Dispose(); }
private void Reporte() { DateTime fechaInicio = (DateTime)iFechaInicio.EditValue; DateTime fechaFinal = (DateTime)iFechaFinal.EditValue; string nameRelation = null; string whereList = null; string ordersList = null; string fieldsList = null; string nameFileReport = null; int idTipoMoneda = (int)iIdtipomoneda.EditValue; List <VwSucursal> vwSucursalList = Service.GetAllVwSucursal(x => x.Idempresa == SessionApp.EmpresaSel.Idempresa); switch (lbOptions.SelectedIndex) { case 0: nameRelation = "compras.vwordencompraresumido"; if (iIdsocionegocio.EditValue == null) { whereList = string.Format("fechaordencompra BETWEEN '{0}' and '{1}' and idsucursal = '{2}' and idtipomoneda = {3}" , fechaInicio.ToString("yyyyMMdd") , fechaFinal.ToString("yyyyMMdd") , SessionApp.SucursalSel.Idsucursal , idTipoMoneda); } else { whereList = string.Format("fechaordencompra BETWEEN '{0}' and '{1}' and idsucursal = '{2}' and idproveedor = '{3}' and idtipomoneda = {4}" , fechaInicio.ToString("yyyyMMdd") , fechaFinal.ToString("yyyyMMdd") , SessionApp.SucursalSel.Idsucursal , iIdsocionegocio.EditValue , idTipoMoneda); } ordersList = "serieorden,numeroorden,fechaordencompra"; fieldsList = "*"; nameFileReport = "ocresumido.frx"; break; case 1: nameRelation = "compras.vwordencompradetallado"; if (iIdsocionegocio.EditValue == null && iIdarea.EditValue == null) { whereList = string.Format("fechaordencompra BETWEEN '{0}' and '{1}' and idsucursal = '{2}' and idtipomoneda = {3}" , fechaInicio.ToString("yyyyMMdd") , fechaFinal.ToString("yyyyMMdd") , SessionApp.SucursalSel.Idsucursal , idTipoMoneda); nameFileReport = "ocdetallado.frx"; } if (iIdsocionegocio.EditValue == null && iIdarea.EditValue != null) { whereList = string.Format("fechaordencompra BETWEEN '{0}' and '{1}' and idsucursal = '{2}' and idarea = '{3}' and idtipomoneda = {4}" , fechaInicio.ToString("yyyyMMdd") , fechaFinal.ToString("yyyyMMdd") , SessionApp.SucursalSel.Idsucursal , iIdarea.EditValue , idTipoMoneda); nameFileReport = "ocdetalladoxarea.frx"; } if (iIdsocionegocio.EditValue != null && iIdarea.EditValue == null) { whereList = string.Format("fechaordencompra BETWEEN '{0}' and '{1}' and idsucursal = '{2}' and idproveedor = '{3}' and idtipomoneda = {4}" , fechaInicio.ToString("yyyyMMdd") , fechaFinal.ToString("yyyyMMdd") , SessionApp.SucursalSel.Idsucursal , iIdsocionegocio.EditValue , idTipoMoneda); nameFileReport = "ocdetallado.frx"; } if (iIdsocionegocio.EditValue != null && iIdarea.EditValue != null) { whereList = string.Format("fechaordencompra BETWEEN '{0}' and '{1}' and idsucursal = '{2}' and idproveedor = '{3}' and idarea = '{4}' and idtipomoneda = {5}" , fechaInicio.ToString("yyyyMMdd") , fechaFinal.ToString("yyyyMMdd") , SessionApp.SucursalSel.Idsucursal , iIdsocionegocio.EditValue , iIdarea.EditValue , idTipoMoneda); nameFileReport = "ocdetalladoxarea.frx"; } ordersList = "serieorden,numeroorden,fechaordencompra"; fieldsList = "*"; // nameFileReport = "ocdetallado.frx"; break; case 2: nameRelation = "compras.vwordencompradetallado"; if (iIdarea.EditValue == null) { whereList = string.Format("fechaordencompra BETWEEN '{0}' and '{1}' and idsucursal = '{2}' and idtipomoneda = {3}" , fechaInicio.ToString("yyyyMMdd") , fechaFinal.ToString("yyyyMMdd") , SessionApp.SucursalSel.Idsucursal , idTipoMoneda); } else { whereList = string.Format("fechaordencompra BETWEEN '{0}' and '{1}' and idsucursal = '{2}' and idarea = '{3}' and idtipomoneda = {4}" , fechaInicio.ToString("yyyyMMdd") , fechaFinal.ToString("yyyyMMdd") , SessionApp.SucursalSel.Idsucursal , iIdarea.EditValue , idTipoMoneda); } ordersList = "idarea,serieorden,numeroorden,fechaordencompra"; fieldsList = "*"; nameFileReport = "ocdetalladoxarea.frx"; break; } DataTable dt = HelperDb.SqlConsulta(nameRelation, whereList, ordersList, fieldsList); Report report = new Report(); string reporte = FilesHelper.FindingFileName(Application.StartupPath, string.Format("Reportes\\Compras\\{0}", nameFileReport)); report.Load(reporte); report.RegisterData(dt, "oc"); report.RegisterData(vwSucursalList, "emp"); report.SetParameterValue("FechaInicio", fechaInicio.ToString("yyyyMMdd")); report.SetParameterValue("FechaFinal", fechaFinal.ToString("yyyyMMdd")); int opcionReporte = (int)rgOpcionReporte.EditValue; switch (opcionReporte) { case 0: //Vistaprevia report.Show(); break; case 1: //Diseño report.Design(); break; } report.Dispose(); }
private void Reporte() { DateTime fechaInicio = (DateTime)iFechaInicio.EditValue; DateTime fechaFinal = (DateTime)iFechaFinal.EditValue; //string nameRelation = null; //string whereList = null; //string ordersList = null; //string fieldsList = null; string nameFileReport = null; string reporte; string sqlQuery = null; object[] parametrosConsulta = { }; List <VwSucursal> vwSucursalList = Service.GetAllVwSucursal(x => x.Idempresa == SessionApp.EmpresaSel.Idempresa); switch (lbOptions.SelectedIndex) { case 0: //nameRelation = "compras.vwregistroventasunat"; //nameRelation = string.Empty; nameFileReport = "registroventas.frx"; sqlQuery = "reportes.fnregistroventa"; parametrosConsulta = new object[] { fechaInicio, fechaFinal }; //whereList = string.Format("fechaemision BETWEEN '{0}' and '{1}' and idsucursal = '{2}'" // , fechaInicio.ToString("yyyyMMdd") // , fechaFinal.ToString("yyyyMMdd") // , UsuarioAutenticado.SucursalSel.Idsucursal); // ordersList = "fechaemision,seriecpventa,numerocpventa"; // fieldsList = "*"; // nameFileReport = "registroventas.frx"; break; } DataTable dt = null; if (lbOptions.SelectedIndex == 0) { dt = HelperDb.ExecuteStoreProcedure(sqlQuery, parametrosConsulta); } else { } //DataTable dt = HelperDb.SqlConsulta(nameRelation, whereList, ordersList, fieldsList); var report = new Report(); reporte = FilesHelper.FindingFileName(Application.StartupPath, string.Format("Reportes\\Gerencia\\{0}", nameFileReport)); report.Load(reporte); report.RegisterData(dt, "rc"); report.RegisterData(vwSucursalList, "emp"); report.SetParameterValue("FechaInicio", fechaInicio.ToString("yyyyMMdd")); report.SetParameterValue("FechaFinal", fechaFinal.ToString("yyyyMMdd")); int opcionReporte = (int)rgOpcionReporte.EditValue; switch (opcionReporte) { case 0: //Vistaprevia report.Show(); break; case 1: //Diseño report.Design(); break; } report.Dispose(); }
private void Reporte() { DateTime fechaInicio = (DateTime)iFechaInicio.EditValue; DateTime fechaFinal = (DateTime)iFechaFinal.EditValue; string nameRelation = null; string whereList = null; string ordersList = null; string fieldsList = null; string nameFileReport = null; string reporte = null; List <VwSucursal> vwSucursalList = Service.GetAllVwSucursal(x => x.Idempresa == SessionApp.EmpresaSel.Idempresa); AlmacenSel = Service.GetVwAlmacen(x => x.Idalmacen == (int)iIdalmacen.EditValue); switch (lbOptions.SelectedIndex) { case 0: nameRelation = "almacen.vwentradaalmacenverifica"; if (iIdalmacen.EditValue == null) { MessageBox.Show("Seleccione Almacen", "Verifique", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); iIdalmacen.Select(); return; } if (iIdsocionegocio.EditValue == null) { whereList = string.Format(@"fechaverificacion BETWEEN '{0}' and '{1}' and idsucursal = '{2}' and idalmacendestino = '{3}' and idestadoarticulo <> 6 and idarticulo in(select idarticulo from almacen.vwstock where vwentradaalmacenverifica.idarticulo = vwstock.idarticulo and idalmacen = {3} and codigoperiodo = '{5}' and idsucursal = {2} and cantidadstock >0)" , fechaInicio.ToString("yyyyMMdd") , fechaFinal.ToString("yyyyMMdd") , SessionApp.SucursalSel.Idsucursal , iIdalmacen.EditValue , SessionApp.EjercicioActual); } else { whereList = string.Format(@"fechaverificacion BETWEEN '{0}' and '{1}' and idsucursal = '{2}' and idalmacendestino = '{3}' and idsocionegocio = '{4}' and idestadoarticulo <> 6 and idarticulo in(select idarticulo from almacen.vwstock where vwentradaalmacenverifica.idarticulo = vwstock.idarticulo and idalmacen = {3} and codigoperiodo = '{6}' and idsucursal = {2} and cantidadstock >0)" , fechaInicio.ToString("yyyyMMdd") , fechaFinal.ToString("yyyyMMdd") , SessionApp.SucursalSel.Idsucursal , iIdalmacen.EditValue , iIdsocionegocio.EditValue , SessionApp.EjercicioActual); } ordersList = "idsocionegocio,fechaverificacion,serieentradaalmacen,numeroentradaalmacen"; fieldsList = "*"; nameFileReport = "almacenreclamos.frx"; break; case 1: break; case 2: break; } DataTable dt = HelperDb.SqlConsulta(nameRelation, whereList, ordersList, fieldsList); var report = new Report(); reporte = FilesHelper.FindingFileName(Application.StartupPath, string.Format("Reportes\\Almacen\\{0}", nameFileReport)); report.Load(reporte); report.RegisterData(dt, "rc"); report.RegisterData(vwSucursalList, "emp"); report.SetParameterValue("FechaInicio", fechaInicio.ToString("yyyyMMdd")); report.SetParameterValue("FechaFinal", fechaFinal.ToString("yyyyMMdd")); int opcionReporte = (int)rgOpcionReporte.EditValue; switch (opcionReporte) { case 0: //Vistaprevia report.Show(); break; case 1: //Diseño report.Design(); break; } report.Dispose(); }
private void Reporte() { DateTime fechaInicio = (DateTime)iFechaInicio.EditValue; DateTime fechaFinal = (DateTime)iFechaFinal.EditValue; int idTipoMoneda = (int)iIdtipomoneda.EditValue; string sqlQuery; string nameFileReport = string.Empty; DataTable dt = null; object[] parametros = { fechaInicio, fechaFinal, iIdcptooperacion.EditValue, iIdSocionegocio.EditValue, null, SessionApp.SucursalSel.Idsucursal, idTipoMoneda }; switch (lbOptions.SelectedIndex) { case 0: //Ordenes de compra pendiente de ingresos sqlQuery = "reportes.fn_cajaingresoegreso"; dt = HelperDb.ExecuteStoreProcedure(sqlQuery, parametros); nameFileReport = "cajaingresoegresoresumen.repx"; break; case 1: //Ordenes de compra pendiente de comprobante de compra sqlQuery = "reportes.fn_cajaegreso"; dt = HelperDb.ExecuteStoreProcedure(sqlQuery, parametros); nameFileReport = "cajaingresoegresoresumen.repx"; break; case 2: //Ordenes de compra pendiente de comprobante de compra sqlQuery = "reportes.fn_cajaingreso"; dt = HelperDb.ExecuteStoreProcedure(sqlQuery, parametros); nameFileReport = "cajaingresoegresoresumen.repx"; break; } //Parametros object[] parametrosReporte = { iIdtipomoneda.Text.Trim() }; string rutaArchivoReporte = FilesHelper.FindingFileName(Application.StartupPath, string.Format("Reportes\\Gerencia\\{0}", nameFileReport)); XtraReport xtraReport = new XtraReport { DataSource = dt }; xtraReport.LoadLayout(rutaArchivoReporte); ReportHelper2 reportHelper2 = new ReportHelper2(rutaArchivoReporte, dt, parametrosReporte, null); int opcionReporte = (int)rgOpcionReporte.EditValue; switch (opcionReporte) { case 0: //Vistaprevia reportHelper2.ShowDialog(); break; case 1: //Diseño reportHelper2.ShowDialog(); break; } reportHelper2.Dispose(); }
private void Reporte() { DateTime fechaInicio = (DateTime)iFechaInicio.EditValue; DateTime fechaFinal = (DateTime)iFechaFinal.EditValue; string nameRelation = null; string whereList = null; string ordersList = null; string fieldsList = null; string nameFileReport = null; string whereProveedor; string reporte = null; List <VwSucursal> vwSucursalList = Service.GetAllVwSucursal(x => x.Idempresa == SessionApp.EmpresaSel.Idempresa); var idProveedor = iIdsocionegocio.EditValue; switch (lbOptions.SelectedIndex) { case 0: nameRelation = "compras.vwrpordenespendientesingreso"; whereProveedor = idProveedor != null?string.Format(" and idproveedor = {0}", (int)idProveedor) : string.Empty; whereList = string.Format("saldoaimportar > 0 and fechaordencompra BETWEEN '{0}' and '{1}' and idsucursal = {2} {3}" , fechaInicio.ToString("yyyyMMdd") , fechaFinal.ToString("yyyyMMdd") , SessionApp.SucursalSel.Idsucursal , whereProveedor); ordersList = "nombretipoformato,serieorden,numeroorden,numeroitem"; fieldsList = "*"; nameFileReport = "ocpendienteingreso.frx"; break; case 1: nameRelation = "compras.vwrpordenespendientescpcompra"; whereProveedor = idProveedor != null?string.Format(" and idproveedor = {0}", (int)idProveedor) : string.Empty; whereList = string.Format("saldoaimportar > 0 and fechaordencompra BETWEEN '{0}' and '{1}' and idsucursal = {2} {3}" , fechaInicio.ToString("yyyyMMdd") , fechaFinal.ToString("yyyyMMdd") , SessionApp.SucursalSel.Idsucursal , whereProveedor); ordersList = "nombretipoformato,serieorden,numeroorden,numeroitem"; fieldsList = "*"; nameFileReport = "ocpendientecpcompra.frx"; break; case 2: break; } DataTable dt = HelperDb.SqlConsulta(nameRelation, whereList, ordersList, fieldsList); var report = new Report(); reporte = FilesHelper.FindingFileName(Application.StartupPath, string.Format("Reportes\\Compras\\{0}", nameFileReport)); report.Load(reporte); report.RegisterData(dt, "oc"); report.RegisterData(vwSucursalList, "emp"); report.SetParameterValue("FechaInicio", fechaInicio.ToString("yyyyMMdd")); report.SetParameterValue("FechaFinal", fechaFinal.ToString("yyyyMMdd")); int opcionReporte = (int)rgOpcionReporte.EditValue; switch (opcionReporte) { case 0: //Vistaprevia report.Show(); break; case 1: //Diseño report.Design(); break; } report.Dispose(); }