internal void AddJSInCtrls()
        {
            JSUtils.closeCurrentWindow(ref this.btnAceptardtlst);
            this.divPrestamo.Attributes.Add("style", this.drpdlTipoAnticipo.SelectedItem.Text == "PRESTAMO" ? "visibility: visible; display: block" : "visibility: hidden; display: none");
            String sOnchange = "ShowHideDivOnChkBox('";

            sOnchange += this.chkboxAnticipo.ClientID + "','";
            sOnchange += this.divanticipo.ClientID + "')";
            this.chkboxAnticipo.Attributes.Add("onclick", sOnchange);

            sOnchange  = "ShowHideDivOnChkBox('";
            sOnchange += this.chkNewBoleta.ClientID + "','";
            sOnchange += this.divNewBoleta.ClientID + "')";
            this.chkNewBoleta.Attributes.Add("onclick", sOnchange);

            sOnchange  = "ShowHideDivOnChkBox('";
            sOnchange += this.chkChangeFechaSalidaNewBoleta.ClientID + "','";
            sOnchange += this.divFechaSalidaNewBoleta.ClientID + "')";
            this.chkChangeFechaSalidaNewBoleta.Attributes.Add("onclick", sOnchange);

            sOnchange  = "subTextBoxes('";
            sOnchange += this.txtNewPesoEntrada.ClientID + "','";
            sOnchange += this.txtNewPesoSalida.ClientID + "','";
            sOnchange += this.txtPesoNetoNewBoleta.ClientID + "')";
            this.txtNewPesoEntrada.Attributes.Add("onKeyUp", sOnchange);
            this.txtNewPesoEntrada.Attributes.Add("onBlur", sOnchange);
            this.txtNewPesoSalida.Attributes.Add("onKeyUp", sOnchange);
            this.txtNewPesoSalida.Attributes.Add("onBlur", sOnchange);

            sOnchange  = "showDivOnListContains(";
            sOnchange += /*this.ddlConcepto.UniqueID*/ "this" + ",'TRASPASOS','";
            sOnchange += this.divConCuentaYCajaDestino.ClientID + "')";
            this.drpdlGrupoCatalogos.Attributes.Add("onChange", sOnchange);

            sOnchange  = "showDivOnListContains(";
            sOnchange += /*this.ddlConcepto.UniqueID*/ "this" + ",'CAJA CHICA','";
            sOnchange += this.divCajaDestino.ClientID + "');";
            //this.drpdlCatalogoInterno.Attributes.Add("onChange", sOnchange);

            sOnchange += "showDivOnListNOTContains(";
            sOnchange += /*this.ddlConcepto.UniqueID*/ "this" + ",'CAJA CHICA','";
            sOnchange += this.divCuentaDestino.ClientID + "')";
            this.drpdlCatalogoInterno.Attributes.Add("onChange", sOnchange);


            sOnchange  = "checkValueInList(";
            sOnchange += /*this.ddlConcepto.UniqueID*/ "this" + ",'PRESTAMO','";
            sOnchange += this.divPrestamo.ClientID + "')";
            this.drpdlTipoAnticipo.Attributes.Add("onChange", sOnchange);
        }
Example #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!this.IsPostBack)
            {
                this.lblDescripcion.Visible = false;
                String sOnchange;
                this.txtFecha.Text = Utils.Now.ToString("dd/MM/yyyy");
                JSUtils.AddDisableWhenClick(ref this.btnAgregar0, this);
                JSUtils.AddDisableWhenClick(ref this.btnModificar, this);
                sOnchange  = "EnableDisableAbonosCargos('";
                sOnchange += this.ddlConcepto.ClientID + "','";
                sOnchange += this.cmbTipodeMov.ClientID + "');";
                this.ddlConcepto.Attributes.Add("onChange", sOnchange);
                JSUtils.AddMsgToCtrlOnClick(ref this.btnCancelar, "¡¡NO OLVIDE ACTUALIZAR LA LISTA DE MOVIMIENTOS DE BANCO !!", false);
                JSUtils.closeCurrentWindow(ref this.btnCancelar);
                if (Request.QueryString["data"] != null)
                {
                    if (this.loadqueryStrings(Request.QueryString["data"].ToString()))
                    {
                        this.btnAgregar0.Visible  = true;
                        this.btnModificar.Visible = false;
                        if (this.myQueryStrings["movID"] != null && int.TryParse(this.myQueryStrings["movID"].ToString(), out imovID) && imovID > -1) //CHECAMOS SI ES PARA MODIFICAR
                        {
                            this.lblmovID.Text = imovID.ToString();
                            //AQUI VERIFICAMOS SI EL MOVIMIENTO VIENE DE UN CRÉDITO
                            if (this.cargadatostomodify())
                            {
                                Logger.Instance.LogUserSessionRecord(Logger.typeModulo.MOVIMIENTOSDEBANCO, Logger.typeUserActions.SELECT, this.UserID, "ABRIÓ EL MOVIMIENTO DE BANCO NÚMERO." + this.lblmovID.Text);
                                this.btnModificar.Visible = true;
                                this.btnAgregar0.Visible  = false;
                                this.drpdlCuenta.Enabled  = false;
                            }
                            else
                            {
                                Response.Write("<script type=\"text/javascript\">window.close();</script>");
                            }
                        }
//                         else
//                         {
//                            //AQUI PONEMOS EL CODIGO SI RECIBIMOS EL ANTICIPO ID O ALGO
//                             if (this.myQueryStrings["creditoFinID"] != null && int.TryParse(this.myQueryStrings["creditoFinID"].ToString(), out credFinID) && credFinID > -1)
//                             {
//                                 this.lblcredFinID.Text = credFinID.ToString();
//                                 this.lblDescripcion.Text = "ESTE MOVIMIENTO SE AGREGARÁ AL CREDITO FINANCIERO: " + credFinID.ToString();
//                                 this.lblDescripcion.Visible = true;
//                             }
//                         }

                        //here is where if the mov de banco is currently related to anything
                        //load the data for modify it
                        if (this.myQueryStrings["creditoFinID"] != null && int.TryParse(this.myQueryStrings["creditoFinID"].ToString(), out credFinID) && credFinID > -1)
                        {
                            this.lblcredFinID.Text      = credFinID.ToString();
                            this.lblDescripcion.Text    = "ESTE MOVIMIENTO ESTÁ AGREGADO AL CREDITO FINANCIERO: " + credFinID.ToString();
                            this.lblDescripcion.Visible = true;

                            this.chkNotadeCompra.Visible      = false;
                            this.pnlNotaCompra.Visible        = false;
                            this.chkCreditoFinanciero.Enabled = false;
                            this.pnlCreditoFinanciero.Visible = true;
                            this.chkCreditoFinanciero.Checked = true;

                            this.pnlFactura.Visible     = false;
                            this.chkFactura.Visible     = false;
                            this.chkNotadeVenta.Visible = false;
                            this.pnlNotadeVenta.Visible = false;
                            this.LoadCreditoFinancieroData(credFinID);
                        }
                        else
                        if (this.myQueryStrings["FacturaCVID"] != null && int.TryParse(this.myQueryStrings["FacturaCVID"].ToString(), out this.FacturaVentaID) && FacturaVentaID > -1)
                        {
                            this.lblcredFinID.Text            = this.FacturaVentaID.ToString();
                            this.lblDescripcion.Text          = "ESTE MOVIMIENTO ESTÁ LIGADO A LA FACTURA DE VENTA: " + this.FacturaVentaID.ToString();
                            this.lblDescripcion.Visible       = true;
                            this.chkNotadeCompra.Visible      = false;
                            this.pnlNotaCompra.Visible        = false;
                            this.chkCreditoFinanciero.Visible = false;
                            this.pnlCreditoFinanciero.Visible = false;
                            this.chkFactura.Enabled           = false;
                            this.pnlFactura.Visible           = true;
                            this.chkFactura.Checked           = true;
                            this.chkNotadeVenta.Visible       = false;
                            this.pnlNotadeVenta.Visible       = false;

                            this.pnlFactura_CollapsiblePanelExtender.Collapsed = false;
                            SqlConnection connFac = new SqlConnection(myConfig.ConnectionInfo);
                            try
                            {
                                SqlCommand comm = new SqlCommand();
                                connFac.Open();
                                comm.Connection  = connFac;
                                comm.CommandText = "SELECT FacturaCV, cicloID, clienteVentaID FROM FacturasClientesVenta WHERE (FacturaCV = @FacturaCV)";
                                comm.Parameters.Add("@FacturaCV", SqlDbType.Int).Value = FacturaVentaID;
                                SqlDataReader reader = comm.ExecuteReader();
                                reader.Read();
                                this.ddlFacturaCiclo.DataBind();
                                this.ddlFacturaCiclo.SelectedValue = reader["cicloID"].ToString();
                                this.ddlFacturaCiclo.Enabled       = false;
                                this.ddlFacturaClientesVenta.DataBind();
                                this.ddlFacturaClientesVenta.SelectedValue = reader["clienteVentaID"].ToString();
                                this.ddlFacturaClientesVenta.Enabled       = false;
                                this.ddlFacturas.DataBind();
                                this.ddlFacturas.SelectedValue = FacturaVentaID.ToString();
                                this.ddlFacturas.Enabled       = false;
                            }
                            catch (System.Exception ex)
                            {
                                Logger.Instance.LogException(Logger.typeUserActions.SELECT, "getting ciclo y cliente id's", ref ex);
                            }
                            finally
                            {
                                connFac.Close();
                            }
                        }
                        else
                        if (this.myQueryStrings["notaventaID"] != null && int.TryParse(this.myQueryStrings["notaventaID"].ToString(), out notaventaID) && notaventaID > -1)
                        {
                            this.lblNotaVentaID.Text                 = this.notaventaID.ToString();
                            this.lblDescripcion.Text                 = "ESTE MOVIMIENTO ESTÁ LIGADO A LA NOTA DE VENTA: " + this.notaventaID.ToString();
                            this.lblDescripcion.Visible              = true;
                            this.chkNotadeCompra.Visible             = false;
                            this.pnlNotaCompra.Visible               = false;
                            this.chkCreditoFinanciero.Visible        = false;
                            this.pnlCreditoFinanciero.Visible        = false;
                            this.chkFactura.Visible                  = false;
                            this.pnlFactura.Visible                  = false;
                            this.chkNotadeVenta.Enabled              = false;
                            this.pnlNotadeVenta.Visible              = true;
                            this.chkNotadeVenta.Checked              = true;
                            this.CollapsiblePanelExtender3.Collapsed = false;

                            SqlConnection connFac = new SqlConnection(myConfig.ConnectionInfo);
                            try
                            {
                                SqlCommand comm = new SqlCommand();
                                connFac.Open();
                                comm.Connection  = connFac;
                                comm.CommandText = "SELECT  cicloID, productorID,   Folio + ' - ' + CAST(notadeventaID AS VARCHAR(50)) + ' ' + CONVERT(varchar(50), Fecha, 103) AS Nota, notadeventaID FROM Notasdeventa WHERE (notadeventaID = @notadeventaID)";
                                comm.Parameters.Add("@notadeventaID", SqlDbType.Int).Value = notaventaID;
                                SqlDataReader reader = comm.ExecuteReader();
                                reader.Read();
                                this.ddlFacturaCiclo.DataBind();
                                this.drpdlCicloNotaVenta.SelectedValue = reader["cicloID"].ToString();
                                this.drpdlCicloNotaVenta.Enabled       = false;
                                this.drpdlCicloNotaVenta.DataBind();
                                this.drpdlProductoresNotaVenta.SelectedValue = reader["productorID"].ToString();
                                this.drpdlProductoresNotaVenta.Enabled       = false;
                                this.drpdlProductoresNotaVenta.DataBind();
                                this.dprdlNota.SelectedValue = notaventaID.ToString();
                                this.dprdlNota.Enabled       = false;
                            }
                            catch (System.Exception ex)
                            {
                                Logger.Instance.LogException(Logger.typeUserActions.SELECT, "getting ciclo y productor id's", ref ex);
                            }
                            finally
                            {
                                connFac.Close();
                            }
                        }
                        else
                        {
                            if (this.myQueryStrings["notacompraID"] != null && int.TryParse(this.myQueryStrings["notacompraID"].ToString(), out notacompraID) && notacompraID > -1)
                            {
                                this.lblNotaCompraID.Text = this.notacompraID.ToString();
                                this.cargaDatosNCompra();
                            }
                        }
                    }
                    else
                    {
                        Logger.Instance.LogMessage(Logger.typeLogMessage.CRITICAL, Logger.typeUserActions.SELECT, this.UserID, "ERROR AL CARGAR DATOS EN ADDMOVQUICK, LOS PARÄMETROS PASADOS COMO QUERYSTRINGS NO CORRESPONDEN A ALGUN MOVIMIENTO ", this.Request.Url.ToString());
                        Response.Write("<script type=\"text/javascript\">window.close();</script>");
                    }
                }
                else
                {
                    this.txtFecha.Text          = Utils.Now.ToString("dd/MM/yyyy");
                    this.lblDescripcion.Visible = false;
                }
                //this.divConceptosFiscales.Attributes.Add("style", this.chkMostrarFiscales.Checked ? "visibility: visible; display: block" : "visibility: hidden; display: none");
                this.pnlNewMov.Visible = false;
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!this.IsPostBack)
            {
                this.btnModificar.Visible = false;
                this.btnAgregar0.Visible  = true;
                int certid = -1, credid = -1;
                this.ddlCFSeguro.DataBind();
                this.drpdlCred.DataBind();
                string msgConf;
                this.drpdlBodega.DataBind();
                //    msgConf = "return alert('¡¡NO OLVIDE ACTUALIZAR LA LISTA DE CERTIFICADOS !! '); window.close(); ";
                JSUtils.closeCurrentWindow(ref this.btnCancelar);

                /*         this.btnCancelar.Attributes.Add("onclick", "<script type=\"text/javascript\">window.close();</script>");*/

                string sOnchange;
                sOnchange  = "ShowHideDivOnChkBox('";
                sOnchange += this.chkAsignarClienteVenta.ClientID + "','";
                sOnchange += this.divAsignaraClientedeVenta.ClientID + "')";
                this.chkAsignarClienteVenta.Attributes.Add("onclick", sOnchange);


                sOnchange  = "ShowHideDivOnChkBox('";
                sOnchange += this.chkAsignarCredito.ClientID + "','";
                sOnchange += this.divAsignaraCredito.ClientID + "')";
                this.chkAsignarCredito.Attributes.Add("onclick", sOnchange);

                JSUtils.AddDisableWhenClick(ref this.btnAgregar0, this);
                JSUtils.AddDisableWhenClick(ref this.btnModificar, this);
                // this.gridCreditos.DataBind();
                this.drpdlClienteVenta.DataBind();
                // CHECAMOS SI HAY QUERYS
                if (Request.QueryString["data"] != null && this.loadqueryStrings(Request.QueryString["data"].ToString()))
                {
                    // CHECAMOS SI ES PARA MODIFICAR UN CERT
                    if (this.myQueryStrings["certID"] != null && int.TryParse(this.myQueryStrings["certID"].ToString(), out certid) && certid > -1)
                    {
                        this.lblcertID.Text = certid.ToString();
                        this.cargaCert();
                        this.btnAgregar0.Visible  = false;
                        this.btnModificar.Visible = true;
                        this.lblAction.Text       = "MODIFICAR UN CERTIFICADO";
                    }
                    else
                    {
                        //CHECAMOS SI NOS PASARON UN CREDITOID
                        if (this.myQueryStrings["credID"] != null && int.TryParse(this.myQueryStrings["credID"].ToString(), out credid) && credid > -1)
                        {
                            this.lblcredID.Text                 = credid.ToString();
                            this.chkAsignarCredito.Checked      = true;
                            this.chkAsignarCredito.Enabled      = false;
                            this.drpdlCred.Enabled              = false;
                            this.chkAsignarClienteVenta.Checked = false;
                            this.chkAsignarClienteVenta.Enabled = false;
                            this.drpdlCred.SelectedValue        = this.lblcredID.Text;
                            this.lblAction.Text                 = "EL CERTIFICADO SE AGREGARÁ AL CRÉDITO FINANCIERO CON EL ID: " + credid.ToString();
                        }
                        this.btnModificar.Visible = false;
                        this.btnAgregar0.Visible  = true;
                    }
                }
            }
            this.pnlNewMov.Visible = false;
            this.divAsignaraClientedeVenta.Attributes.Add("style", this.chkAsignarClienteVenta.Checked ? "visibility: visible; display: block" : "visibility: hidden; display: none");
            this.divAsignaraCredito.Attributes.Add("style", this.chkAsignarCredito.Checked ? "visibility: visible; display: block" : "visibility: hidden; display: none");
        }