Exemplo n.º 1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if ((this.Session["Usuario"] == null) || (this.Session["Usuario"].ToString() == ""))
     {
         base.Response.Write("<script>alert('Por seguridad expiro la p\x00e1gina');window.open('" + ConfigurationSettings.AppSettings["Inicio"].ToString() + "','_top')</script>");
         base.Response.End();
     }
     if (!this.Page.IsPostBack)
     {
         this.lblMontoaRendir.Text = "0";
         string str  = base.Request.QueryString["nrooperacion"].ToString();
         string str2 = base.Request.QueryString["rutdeudor"].ToString();
         string str3 = base.Request.QueryString["nomdeudor"].ToString().ToUpper();
         string str4 = base.Request.QueryString["nrocomprobante"].ToString();
         string str5 = base.Request.QueryString["nomcliente"].ToString().ToUpper();
         string str6 = base.Request.QueryString["montoabono"].ToString().ToUpper();
         this.hddnrooperacion.Value   = str.ToString();
         this.hddrutdeudor.Value      = str2.ToString();
         this.hddnomdeudor.Value      = str3.ToString();
         this.hddnrocomprobante.Value = str4.ToString();
         this.hddnomcliente.Value     = str5.ToString();
         this.hddmontoabono.Value     = str6.ToString();
         string str7 = base.Request.QueryString["id_abono"].ToString().ToUpper();
         string str8 = base.Request.QueryString["id_cobranza"].ToString().ToUpper();
         this.hddIdAbono.Value       = str7.ToString();
         this.hiddCobranza.Value     = str8.ToString();
         this.lblNrooperacion.Text   = str;
         this.lblRutDeudor.Text      = str2;
         this.lblDeudor.Text         = str3;
         this.lblnrocomprobante.Text = str4;
         this.lblCliente.Text        = str5;
         this.lblTotalTodo.Text      = str6;
         DataTable table = null;
         table = ConsultasEspecificas.RendicionDesglose(this.hddIdAbono.Value.ToString());
         if ((table.Rows.Count > 0) && (table != null))
         {
             this.lblIntereses.Text        = table.Rows[0]["intereses"].ToString();
             this.lblInteresAdicional.Text = table.Rows[0]["int_adic"].ToString();
             this.lblHonorarios.Text       = table.Rows[0]["honorarios"].ToString();
             this.lblDescHonorarios.Text   = table.Rows[0]["desc_honorarios"].ToString();
             this.lblOtrosDescuentos.Text  = table.Rows[0]["otros_desc"].ToString();
             this.lblDescInteres.Text      = table.Rows[0]["desc_interes"].ToString();
             this.lblMonto.Text            = table.Rows[0]["monto"].ToString();
             this.lblGastos.Text           = table.Rows[0]["gastos"].ToString();
         }
         else
         {
             this.lblIntereses.Text        = "0";
             this.lblInteresAdicional.Text = "0";
             this.lblHonorarios.Text       = "0";
             this.lblDescHonorarios.Text   = "0";
             this.lblOtrosDescuentos.Text  = "0";
             this.lblDescInteres.Text      = "0";
             this.lblGastos.Text           = "0";
         }
         DataTable table2 = null;
         table2 = ConsultasEspecificas.MostrarYaRendidas(this.hddIdAbono.Value.ToString(), this.hiddCobranza.Value.ToString());
         if ((table2.Rows.Count > 0) && (table2 != null))
         {
             if (table2.Rows[0]["swInteres"].ToString() == "S")
             {
                 this.chkIntereses.Text    = "Rendido";
                 this.chkIntereses.Enabled = false;
             }
             if (table2.Rows[0]["swint_adic"].ToString() == "S")
             {
                 this.chkInteresAdicional.Enabled = false;
                 this.chkInteresAdicional.Text    = "Rendido";
             }
             if (table2.Rows[0]["swhonorarios"].ToString() == "S")
             {
                 this.chkHonorarios.Enabled = false;
                 this.chkHonorarios.Text    = "Rendido";
             }
             if (table2.Rows[0]["swdesc_honorarios"].ToString() == "S")
             {
                 this.chkDescHonorarios.Enabled = false;
                 this.chkDescHonorarios.Text    = "Rendido";
             }
             if (table2.Rows[0]["swdesc_interes"].ToString() == "S")
             {
                 this.chkDescInteres.Enabled = false;
                 this.chkDescInteres.Text    = "Rendido";
             }
             if (table2.Rows[0]["swOtros_desc"].ToString() == "S")
             {
                 this.chkOtrosDescuentos.Enabled = false;
                 this.chkOtrosDescuentos.Text    = "Rendido";
             }
             if (table2.Rows[0]["swmonto"].ToString() == "S")
             {
                 this.chkMonto.Enabled = false;
                 this.chkMonto.Text    = "Rendido";
             }
             if (table2.Rows[0]["swgasto"].ToString() == "S")
             {
                 this.chkGastos.Enabled = false;
                 this.chkGastos.Text    = "Rendido";
             }
         }
         this.CargaGrilla(this.hiddCobranza.Value.ToString());
         DataTable table3 = null;
         table3 = ConsultasEspecificas.MostrarDesglose(this.hddIdAbono.Value.ToString());
         if ((table3.Rows.Count <= 0) || (table3 == null))
         {
             this.Page.RegisterClientScriptBlock("Mensaje", "<script>alert('Atenci\x00f3n! No existe desglose para est\x00e1 operaci\x00f3n, ya que fue realizada antes del paso a producci\x00f3n');</script>");
         }
     }
 }