示例#1
0
        protected void CargarDatosConciliacion(string descTipoTransaccion)
        {
            asignacionResumen(ref objresumen);
            LogicaNegocio Ln  = new LogicaNegocio();
            DataTable     dt1 = new DataTable();

            dt1 = Ln.ConsultaFacturacion(objresumen.idEmpresa.ToString(), objresumen.idOperacion.ToString(), objresumen.idUsuario.ToString(), objresumen.descCargo.ToString(), descTipoTransaccion);

            if (dt1.Rows.Count > 0)
            {
                //if (dt1.Rows[0]["fecFactura"].ToString() != "")
                //{
                //    txt_Fecha.Text = dt1.Rows[0]["fecFactura"].ToString();
                //}

                txt_Factura.Text = dt1.Rows[0]["numFactura"].ToString();

                if (dt1.Rows[0]["FechaPago"].ToString() != "")
                {
                    dctFechaPago.SelectedDate = Convert.ToDateTime(dt1.Rows[0]["FechaPago"].ToString());
                }

                if (!string.IsNullOrEmpty(dt1.Rows[0]["IdBanco"].ToString()))
                {
                    ddlbanco.SelectedIndex = ddlbanco.Items.IndexOf(ddlbanco.Items.FindByValue(Convert.ToString(dt1.Rows[0]["IdBanco"].ToString())));
                }

                if (dt1.Rows[0]["IdTipoPago"].ToString() != "")
                {
                    ddlTipoPago.SelectedIndex = ddlTipoPago.Items.IndexOf(ddlTipoPago.Items.FindByValue(Convert.ToString(dt1.Rows[0]["IdTipoPago"].ToString())));
                }

                txtDocumentoPago.Text = dt1.Rows[0]["NroDocumentoPago"].ToString();
                txt_Comentario.Text   = dt1.Rows[0]["Comentario"].ToString();
            }
        }
示例#2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            LogicaNegocio Ln = new LogicaNegocio();

            if (Page.Session["RESUMEN"] != null)
            {
                ViewState["RES"] = (Resumen)Page.Session["RESUMEN"];
            }
            asignacionResumen(ref objresumen);

            string          PermisoConfigurado = string.Empty;
            SPWeb           app2    = SPContext.Current.Web;
            DataTable       dt2     = new DataTable("dt");
            ValidarPermisos validar = new ValidarPermisos
            {
                NombreUsuario = util.ObtenerValor(app2.CurrentUser.Name),
                Pagina        = pagina,
                Etapa         = objresumen.area,
            };

            dt2 = validar.ListarPerfil(validar);
            if (dt2.Rows.Count > 0)
            {
                if (!Page.IsPostBack)
                {
                    if (Page.Session["RESUMEN"] != null)
                    {
                        ViewState["BUSQUEDA"]    = Page.Session["BUSQUEDA"];
                        Page.Session["BUSQUEDA"] = null;

                        objresumen = (Resumen)Page.Session["RESUMEN"];
                        Page.Session["RESUMEN"] = null;

                        lbEmpresa.Text   = objresumen.desEmpresa;
                        lbRut.Text       = objresumen.rut;
                        lbEjecutivo.Text = objresumen.descEjecutivo;
                        lbOperacion.Text = objresumen.desOperacion.ToString();

                        ocultarDiv();
                        string descTipoTransaccion = System.Web.HttpUtility.HtmlDecode(Page.Request.QueryString["idTT"] as string);

                        idTransaccion.Text        = descTipoTransaccion;
                        lbTitulo.Text             = descTipoTransaccion;
                        pnDatos.Visible           = false;
                        pnDatosAsesoria.Visible   = false;
                        pnDatosDevolucion.Visible = false;

                        CargarAcreedor();

                        DataSet dt = new DataSet();
                        dt = Ln.ConsultaDatosContabilidad(objresumen.idEmpresa.ToString(), objresumen.idOperacion.ToString(), objresumen.idUsuario.ToString(), objresumen.descCargo.ToString(), descTipoTransaccion);

                        if (dt.Tables[1].Rows.Count > 0)
                        {
                            txtRanzonSocial.Text = dt.Tables[1].Rows[0]["RazonSocial"].ToString();
                            txtRut.Text          = dt.Tables[1].Rows[0]["Rut"].ToString();
                            txtActEconomica.Text = dt.Tables[1].Rows[0]["DescActividad"].ToString();
                            txtDireccion.Text    = dt.Tables[1].Rows[0]["direccion"].ToString();
                            txtComuna.Text       = dt.Tables[1].Rows[0]["DescComuna"].ToString();
                            txtProvincia.Text    = dt.Tables[1].Rows[0]["DescProvincia"].ToString();
                            txtRegion.Text       = dt.Tables[1].Rows[0]["DescRegion"].ToString();
                            txtTelefonof.Text    = dt.Tables[1].Rows[0]["TelFijo1"].ToString();
                            txtEmail.Text        = dt.Tables[1].Rows[0]["EMail"].ToString();
                        }

                        if (dt.Tables[0].Rows.Count > 0)
                        {
                            if (descTipoTransaccion != "1" && descTipoTransaccion != "3")
                            {
                                pnDatos.Visible             = true;
                                txtCertificado.Text         = dt.Tables[0].Rows[0]["NCertificado"].ToString();
                                txtMonto.Text               = dt.Tables[0].Rows[0]["MontoOperacion"].ToString();
                                txtFechaEmision.Text        = dt.Tables[0].Rows[0]["fecEmision"].ToString();
                                txtComisionCLp.Text         = dt.Tables[0].Rows[0]["comisionCLP"].ToString();
                                txtProducto.Text            = dt.Tables[0].Rows[0]["descProducto"].ToString();
                                txtGastosOperacionales.Text = dt.Tables[0].Rows[0]["gastosOperacionales"].ToString();
                                txtAcreedor.Text            = dt.Tables[0].Rows[0]["Acreedor"].ToString();
                                txtSeguro.Text              = dt.Tables[0].Rows[0]["costoSeguro"].ToString();
                                lbseguro.Text               = dt.Tables[0].Rows[0]["incluido"].ToString();
                                lbcomision.Text             = dt.Tables[0].Rows[0]["incluidoComision"].ToString();
                                lbgastosOpe.Text            = dt.Tables[0].Rows[0]["incluidoGastosOperacionales"].ToString();
                                lbTitulo.Text               = dt.Tables[0].Rows[0]["descTipoTransaccion"].ToString();

                                txtSeguroDesgravamen.Text = dt.Tables[0].Rows[0]["costoSeguroDesgravamen"].ToString();
                                lbSeguroDesgravamen.Text  = dt.Tables[0].Rows[0]["incluidoDesgravamen"].ToString();

                                txtTimbreyEstAcreedor.Text = dt.Tables[0].Rows[0]["TimbreYEstampillaAcreedor"].ToString();
                                lbTimbreyEstAcreedor.Text  = dt.Tables[0].Rows[0]["incluidoTimbreYEstampillaAcreedor"].ToString();

                                txtTimbreyEstMultiaval.Text = dt.Tables[0].Rows[0]["TimbreYEstampilla"].ToString();
                                lbTimbreyEstMultiaval.Text  = dt.Tables[0].Rows[0]["incluidoTimbreYEstampilla"].ToString();

                                txtNotario.Text = dt.Tables[0].Rows[0]["Notario"].ToString();
                                lbNotario.Text  = dt.Tables[0].Rows[0]["incluidoNotario"].ToString();
                            }

                            if (descTipoTransaccion == "3")
                            {
                                pnDatosDevolucion.Visible = true;
                                txtCertificadoD.Text      = dt.Tables[0].Rows[0]["NCertificado"].ToString();
                                txtMontoD.Text            = dt.Tables[0].Rows[0]["MontoOperacion"].ToString();
                                txtFechaEmisionD.Text     = dt.Tables[0].Rows[0]["fecEmision"].ToString();
                                txtComisionCLPD.Text      = dt.Tables[0].Rows[0]["comisionCLP"].ToString();
                                txtProductoD.Text         = dt.Tables[0].Rows[0]["descProducto"].ToString();

                                txtGastosOperacionales.Text = dt.Tables[0].Rows[0]["gastosOperacionales"].ToString();
                                txtAcreedorD.Text           = dt.Tables[0].Rows[0]["Acreedor"].ToString();
                                txtFondoD.Text               = dt.Tables[0].Rows[0]["fondo"].ToString();
                                txtCostoFondoD.Text          = dt.Tables[0].Rows[0]["costoFondo"].ToString();
                                txtNroFacturaComisión.Text   = dt.Tables[0].Rows[0]["NroFactura"].ToString();
                                txtFechaFacturaComision.Text = dt.Tables[0].Rows[0]["FechaFactura"].ToString();
                                txtTipoContrato.Text         = dt.Tables[0].Rows[0]["tipoContrato"].ToString();
                                txtDevolucionFinal.Text      = dt.Tables[0].Rows[0]["devolucionFinal"].ToString();
                                txtDevolucionCostoFondo.Text = dt.Tables[0].Rows[0]["devolucionCostoFondo"].ToString();
                                txtGatosOperacionalesP.Text  = dt.Tables[0].Rows[0]["GastosOperacionalPendiente"].ToString();
                                lbTitulo.Text = dt.Tables[0].Rows[0]["descTipoTransaccion"].ToString();
                            }

                            if (descTipoTransaccion == "1")
                            {
                                pnDatosAsesoria.Visible = true;
                                txtComisionA.Text       = dt.Tables[0].Rows[0]["comisionCLP"].ToString();
                                txtProductoA.Text       = dt.Tables[0].Rows[0]["descProducto"].ToString();
                                txtFechaEstimada.Text   = dt.Tables[0].Rows[0]["fecEstimadaCierre"].ToString();
                                lbTitulo.Text           = dt.Tables[0].Rows[0]["descTipoTransaccion"].ToString();
                            }
                        }

                        DataTable dt1 = new DataTable();
                        dt1 = Ln.ConsultaFacturacion(objresumen.idEmpresa.ToString(), objresumen.idOperacion.ToString(), objresumen.idUsuario.ToString(), objresumen.descCargo.ToString(), descTipoTransaccion);

                        if (dt1.Rows.Count > 0)
                        {
                            if (dt1.Rows[0]["fecFactura"].ToString() != "")
                            {
                                txt_Fecha.Text = dt1.Rows[0]["fecFactura"].ToString();
                            }

                            txt_Factura.Text = dt1.Rows[0]["numFactura"].ToString();

                            if (dt1.Rows[0]["FechaPago"].ToString() != "")
                            {
                                dctFechaPago.SelectedDate = Convert.ToDateTime(dt1.Rows[0]["FechaPago"].ToString());
                            }

                            if (!string.IsNullOrEmpty(dt1.Rows[0]["IdBanco"].ToString()))
                            {
                                ddlbanco.SelectedIndex = ddlbanco.Items.IndexOf(ddlbanco.Items.FindByValue(Convert.ToString(dt1.Rows[0]["IdBanco"].ToString())));
                            }

                            if (dt1.Rows[0]["IdTipoPago"].ToString() != "")
                            {
                                ddlTipoPago.SelectedIndex = ddlTipoPago.Items.IndexOf(ddlTipoPago.Items.FindByValue(Convert.ToString(dt1.Rows[0]["IdTipoPago"].ToString())));
                            }

                            txtDocumentoPago.Text = dt1.Rows[0]["NroDocumentoPago"].ToString();
                            txt_Comentario.Text   = dt1.Rows[0]["Comentario"].ToString();
                        }
                    }
                    else
                    {
                        Page.Response.Redirect("MensajeSession.aspx");
                    }
                }

                Control divFormulario = this.FindControl("dvFormulario");
                bool    TieneFiltro   = true;

                if (divFormulario != null)
                {
                    util.bloquear(divFormulario, dt2.Rows[0]["Permiso"].ToString(), TieneFiltro);
                }
                else
                {
                    dvFormulario.Style.Add("display", "none");
                    dvWarning1.Style.Add("display", "block");
                    lbWarning1.Text = "Usuario sin permisos configurados";
                }
            }
            else
            {
                dvFormulario.Style.Add("display", "none");
                dvWarning1.Style.Add("display", "block");
                lbWarning1.Text = "Usuario sin permisos configurados";
            }
        }