Exemple #1
0
        public void getResumen()
        {
            DBConn oConn = new DBConn();

            if (oConn.Open())
            {
                cLitigios oResumen = new cLitigios(ref oConn);
                oResumen.nKeyCliente = hdd_cliente.Value;
                oResumen.CodHolding  = hdd_holding.Value;
                //oResumen.nKeyDeudor = oIsUsuario.NKeyDeudor;
                DataTable dt = oResumen.getResumen();
                if (dt != null)
                {
                    if (dt.Rows.Count > 0)
                    {
                        lb_monto_litigios.Text = "$" + double.Parse(dt.Rows[0]["Total_litigios_monto"].ToString()).ToString("N0");
                        //lbl_dias_proc_normal.Text = dt.Rows[0]["dias_normalizacion"].ToString() + " días";
                    }
                }
                dt = null;


                lbl_dias_proc_normal.Text = oResumen.getDiasProcesoNormalizacion() + " días";
            }
            oConn.Close();
        }
Exemple #2
0
        protected void lnk_litigios_Click(object sender, EventArgs e)
        {
            DBConn oConn = new DBConn();

            if (oConn.Open())
            {
                DataTable dt;
                cLitigios oDetalle = new cLitigios(ref oConn);
                oDetalle.nKeyCliente = hdd_cliente.Value;
                oDetalle.CodHolding  = hdd_holding.Value;
                dt = oDetalle.getDetalle();
                gdDetalle.DataSource = dt;
                gdDetalle.DataBind();

                if (dt != null)
                {
                    if (dt.Rows.Count > 0)
                    {
                        toExcel.Visible = true;
                    }
                }
                dt = null;

                hdd_periodo.Value = string.Empty;
                num_factura.Text  = string.Empty;
                nom_cliente.Text  = string.Empty;
            }
            oConn.Close();
        }
Exemple #3
0
        public void getSubMotivo()
        {
            DBConn oConn = new DBConn();

            if (oConn.Open())
            {
                cLitigios oSubMotivo = new cLitigios(ref oConn);
                oSubMotivo.nKeyCliente = hdd_cliente.Value;
                oSubMotivo.CodHolding  = hdd_holding.Value;
                //oSubMotivo.nKeyDeudor = oIsUsuario.NKeyDeudor;
                DataTable dt = oSubMotivo.getSubmotivo();
                if (dt != null)
                {
                    if (dt.Rows.Count > 0)
                    {
                        StringBuilder sHtml = new StringBuilder();
                        int           i     = 0;
                        foreach (DataRow oRow in dt.Rows)
                        {
                            if (i == 0)
                            {
                                sHtml.Append("<div class=\"col-md-6 border-right-litigios scol-line-height-resumen\">");
                            }

                            if (i == 3)
                            {
                                sHtml.Append("<div class=\"col-md-6 scol-line-height-resumen\">");
                            }

                            sHtml.Append("<div class='space-box'><span class='tt-canal'>").Append(oRow["submotivo"].ToString()).Append("</span></div>");
                            sHtml.Append("<div class='space-box'><span class='lb-dt-canal-submotivo-litigios-monto'>").Append("$").Append(double.Parse(oRow["saldo"].ToString()).ToString("N0")).Append("</span></div>");
                            sHtml.Append("<div class='space-box'><span class='lb-dt-canal-submotivo-litigios-cant'>").Append(oRow["cantidad"].ToString()).Append(" Facturas</span></div>");
                            sHtml.Append("<div class='space-divbox'></div>");

                            if ((i == 2) || (i == 4))
                            {
                                sHtml.Append("</div>");
                            }

                            i++;
                        }

                        if ((i == 2) || (i == 4))
                        {
                            sHtml.Append("</div>");
                        }

                        idSubMotivo.Controls.Add(new LiteralControl(sHtml.ToString()));
                    }
                }
                dt = null;
            }
            oConn.Close();
        }
        public void ProcessRequest(HttpContext context)
        {
            DataTable dt    = null;
            DBConn    oConn = new DBConn();

            if (oConn.Open())
            {
                cLitigios oDetalle = new cLitigios(ref oConn);
                oDetalle.nKeyCliente = oWeb.GetData("hdd_cliente");
                oDetalle.CodHolding  = oWeb.GetData("hdd_holding");

                if (!string.IsNullOrEmpty(oWeb.GetData("nom_cliente")))
                {
                    oDetalle.NomCliente = oWeb.GetData("nom_cliente");
                }

                if (!string.IsNullOrEmpty(oWeb.GetData("num_factura")))
                {
                    oDetalle.NumFactura = oWeb.GetData("num_factura");
                }

                if (!string.IsNullOrEmpty(oWeb.GetData("hdd_periodo")))
                {
                    oDetalle.Periodo = oWeb.GetData("hdd_periodo");
                    oDetalle.OrderBy = true;
                }

                dt = oDetalle.getDetalle();
            }
            oConn.Close();

            System.Web.HttpResponse oResponse = System.Web.HttpContext.Current.Response;
            XLWorkbook wb = new XLWorkbook();

            wb.Worksheets.Add(dt, "ReporteVentas");

            oResponse.Clear();
            oResponse.Buffer      = true;
            oResponse.Charset     = "";
            oResponse.ContentType = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
            oResponse.AddHeader("content-disposition", "attachment;filename=Reporte_Litigios_" + DateTime.Now.ToString("yyyyMMdd") + ".xlsx");
            using (MemoryStream MyMemoryStream = new MemoryStream())
            {
                wb.SaveAs(MyMemoryStream);
                MyMemoryStream.WriteTo(oResponse.OutputStream);
                oResponse.Flush();
                oResponse.End();
            }
        }
Exemple #5
0
        public void getDetalle()
        {
            DBConn oConn = new DBConn();

            if (oConn.Open())
            {
                DataTable dt;
                cLitigios oDetalle = new cLitigios(ref oConn);
                oDetalle.nKeyCliente = hdd_cliente.Value;
                oDetalle.CodHolding  = hdd_holding.Value;
                if (!string.IsNullOrEmpty(nom_cliente.Text))
                {
                    oDetalle.NomCliente = nom_cliente.Text;
                }
                if (!string.IsNullOrEmpty(num_factura.Text))
                {
                    oDetalle.NumFactura = num_factura.Text;
                }

                if (!string.IsNullOrEmpty(hdd_periodo.Value))
                {
                    oDetalle.Periodo = hdd_periodo.Value;
                    oDetalle.OrderBy = true;
                }
                dt = oDetalle.getDetalle();
                gdDetalle.DataSource = dt;
                gdDetalle.DataBind();

                if (dt != null)
                {
                    if (dt.Rows.Count > 0)
                    {
                        toExcel.Visible = true;
                    }
                }
                dt = null;
            }
            oConn.Close();
        }
Exemple #6
0
        protected void lnk_litigiosmayor_Click(object sender, EventArgs e)
        {
            DBConn oConn = new DBConn();

            if (oConn.Open())
            {
                DataTable dt;
                cLitigios oDetalle = new cLitigios(ref oConn);
                oDetalle.nKeyCliente = hdd_cliente.Value;
                oDetalle.CodHolding  = hdd_holding.Value;
                if (!string.IsNullOrEmpty(nom_cliente.Text))
                {
                    oDetalle.NomCliente = nom_cliente.Text;
                }
                if (!string.IsNullOrEmpty(num_factura.Text))
                {
                    oDetalle.NumFactura = num_factura.Text;
                }
                oDetalle.Periodo = "mayor";
                oDetalle.OrderBy = true;
                dt = oDetalle.getDetalle();
                gdDetalle.DataSource = dt;
                gdDetalle.DataBind();

                if (dt != null)
                {
                    if (dt.Rows.Count > 0)
                    {
                        toExcel.Visible = true;
                    }
                }
                dt = null;

                hdd_periodo.Value = "mayor";
            }
            oConn.Close();
        }
Exemple #7
0
        public void getAntiguedad()
        {
            double iMonto30     = 0;
            double iDocumento30 = 0;

            double iMonto60     = 0;
            double iDocumento60 = 0;

            double iMonto90     = 0;
            double iDocumento90 = 0;

            double iMontoMayor90     = 0;
            double iDocumentoMayor90 = 0;

            DataTable dt;

            DBConn oConn = new DBConn();

            if (oConn.Open())
            {
                cLitigios oAntiguedad = new cLitigios(ref oConn);
                oAntiguedad.nKeyCliente = hdd_cliente.Value;
                oAntiguedad.CodHolding  = hdd_holding.Value;
                //oAntiguedad.nKeyDeudor = oIsUsuario.NKeyDeudor;
                oAntiguedad.Periodo = "30";
                dt = oAntiguedad.getAntiguedad();
                if (dt != null)
                {
                    if (dt.Rows.Count > 0)
                    {
                        iMonto30     = double.Parse(dt.Rows[0]["saldo"].ToString());
                        iDocumento30 = double.Parse(dt.Rows[0]["cantidad"].ToString());
                    }
                }
                dt = null;

                oAntiguedad.Periodo = "60";
                dt = oAntiguedad.getAntiguedad();
                if (dt != null)
                {
                    if (dt.Rows.Count > 0)
                    {
                        iMonto60     = double.Parse(dt.Rows[0]["saldo"].ToString());
                        iDocumento60 = double.Parse(dt.Rows[0]["cantidad"].ToString());
                    }
                }
                dt = null;

                oAntiguedad.Periodo = "90";
                dt = oAntiguedad.getAntiguedad();
                if (dt != null)
                {
                    if (dt.Rows.Count > 0)
                    {
                        iMonto90     = double.Parse(dt.Rows[0]["saldo"].ToString());
                        iDocumento90 = double.Parse(dt.Rows[0]["cantidad"].ToString());
                    }
                }
                dt = null;

                oAntiguedad.Periodo = "mayor";
                dt = oAntiguedad.getAntiguedad();
                if (dt != null)
                {
                    if (dt.Rows.Count > 0)
                    {
                        iMontoMayor90     = double.Parse(dt.Rows[0]["saldo"].ToString());
                        iDocumentoMayor90 = double.Parse(dt.Rows[0]["cantidad"].ToString());
                    }
                }
                dt = null;

                double iTotal = iMonto30 + iMonto60 + iMonto90 + iMontoMayor90;
                lb_porcentaje_30.Text = ((iMonto30 / iTotal) * 100).ToString("N0") + "%";
                lb_monto_30.Text      = "$" + iMonto30.ToString("N0");
                lb_documento_30.Text  = iDocumento30.ToString("N0") + " Facturas";

                lb_porcentaje_60.Text = ((iMonto60 / iTotal) * 100).ToString("N0") + "%";
                lb_monto_60.Text      = "$" + iMonto60.ToString("N0");
                lb_documento_60.Text  = iDocumento60.ToString("N0") + " Facturas";

                lb_porcentaje_90.Text = ((iMonto90 / iTotal) * 100).ToString("N0") + "%";
                lb_monto_90.Text      = "$" + iMonto90.ToString("N0");
                lb_documento_90.Text  = iDocumento90.ToString("N0") + " Facturas";

                lbl_porcentaje_mayor90.Text = ((iMontoMayor90 / iTotal) * 100).ToString("N0") + "%";
                lb_monto_mayor90.Text       = "$" + iMontoMayor90.ToString("N0");
                lb_documento_mayor90.Text   = iDocumentoMayor90.ToString("N0") + " Facturas";

                StringBuilder sHtml_Graph = new StringBuilder();
                sHtml_Graph.Append(" google.charts.setOnLoadCallback(drawPieChart); ");
                sHtml_Graph.Append(" function drawPieChart() { ");
                sHtml_Graph.Append(" var data = google.visualization.arrayToDataTable([ ");
                sHtml_Graph.Append(" ['Días','Monto'], ");
                sHtml_Graph.Append(" ['30 días'," + iMonto30.ToString("0.00", CultureInfo.InvariantCulture) + "], ");
                sHtml_Graph.Append(" ['60 días'," + iMonto60.ToString("0.00", CultureInfo.InvariantCulture) + "], ");
                sHtml_Graph.Append(" ['90 días'," + iMonto90.ToString("0.00", CultureInfo.InvariantCulture) + "], ");
                sHtml_Graph.Append(" ['> 90 días'," + iMontoMayor90.ToString("0.00", CultureInfo.InvariantCulture) + "] ");
                sHtml_Graph.Append(" ]); ");
                sHtml_Graph.Append(" var options = { ");
                sHtml_Graph.Append(" pieHole: 0.9, ");
                sHtml_Graph.Append(" pieSliceText:'none', pieSliceTextStyle: 'none', pieSliceBorderColor: 'none', ");
                sHtml_Graph.Append(" colors: ['#4285F4', '#AA66CC', '#F5A623','#D0021B'], ");
                sHtml_Graph.Append(" legend: 'none', chartArea: { left: 10, right: 10, bottom: 10, top: 10 } ");
                sHtml_Graph.Append(" }; ");
                sHtml_Graph.Append(" var chart = new google.visualization.PieChart(document.getElementById('donut_single')); ");
                sHtml_Graph.Append(" chart.draw(data, options); ");
                sHtml_Graph.Append(" }; ");

                ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "donut_single", sHtml_Graph.ToString(), true);
            }
            oConn.Close();
        }