Esempio n. 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            this.panelmensaje.Visible = false;
            if (!this.IsPostBack)
            {
                JSUtils.AddDisableWhenClick(ref this.btnAddproduct, this);
                JSUtils.AddDisableWhenClick(ref this.btnAddFacturaCompra, this);
                JSUtils.AddDisableWhenClick(ref this.btnModifyFacturaCompra, this);
                this.ddlCiclos.DataBind();
                this.ddlGrupos.DataBind();
                this.ddlProveedor.DataBind();
                this.drpdlBodega.DataBind();
                this.drpdlProducto.DataBind();
                this.panelmensaje.Visible        = false;
                this.txtFecha.Text               = Utils.Now.ToString("dd/MM/yyyy");
                this.pnlAddProd.Visible          = false;
                this.btnAddFacturaCompra.Visible = true;

                if (Request.QueryString["data"] != null && this.loadqueryStrings(Request.QueryString["data"].ToString()) && this.myQueryStrings != null && this.myQueryStrings["FacturaDeCompraID"] != null)
                {
                    this.lblFacturaId.Text = this.myQueryStrings["FacturaDeCompraID"].ToString();
                    this.LoadFacturaData();
                }
            }
        }
Esempio n. 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!this.IsPostBack)
            {
                JSUtils.AddDisableWhenClick(ref this.btnAdd, this);
                JSUtils.AddDisableWhenClick(ref this.btnModificar, this);



                int iCreditoFinID = -1;
                this.btnAdd.Visible = true;

                this.btnModificar.Visible = true;
                if (Request.QueryString["data"] != null && this.loadqueryStrings(Request.QueryString["data"].ToString()) && int.TryParse(this.myQueryStrings["CreditoFinID"].ToString(), out iCreditoFinID) && iCreditoFinID > -1)
                {
                    this.txtIDtoMod.Text = iCreditoFinID.ToString();
                    this.LoadCreditoData();
                    this.GridView1.DataBind();

                    this.btnModificar.Visible = true;
                    this.btnAdd.Visible       = false;
                    string parameter;
                    string datosaencriptar;
                    datosaencriptar  = "creditoFinID=";
                    datosaencriptar += this.txtIDtoMod.Text;
                    datosaencriptar += "&";
                    parameter        = "javascript:url('";
                    parameter       += "frmMovBancoAddQuick.aspx?data=";
                    parameter       += Utils.encriptacadena(datosaencriptar);
                    parameter       += "', '";
                    parameter       += "Agregar Movimiento de Banco a un crédito Financiero";
                    parameter       += "',0,200,600,550); return false;";
                    this.btnAddMov.Attributes.Add("onclick", parameter);

                    datosaencriptar  = "credID=";
                    datosaencriptar += this.txtIDtoMod.Text;
                    datosaencriptar += "&";
                    parameter        = "javascript:url('";
                    parameter       += "frmCertificadoAddQuick.aspx?data=";
                    parameter       += Utils.encriptacadena(datosaencriptar);
                    parameter       += "', '";
                    parameter       += "Agregar Certificado a un Crédito Financiero";
                    parameter       += "',0,200,600,550); return false;";
                    this.btnAgregarCert.Attributes.Add("onclick", parameter);


                    this.btnAddMov.Visible           = true;
                    this.btnRecargaMovements.Visible = true;
                }
                else
                {
                    this.pnlMovimientos.Visible = false;

                    this.btnAddMov.Visible           = false;
                    this.btnRecargaMovements.Visible = true;
                }
            }
            this.pnlMensajeAddCredito.Visible = false;
        }
Esempio n. 3
0
 private void JavaScriptABotones()
 {
     JSUtils.AddDisableWhenClick(ref this.btnActualizaTotales, this);
     JSUtils.AddDisableWhenClick(ref this.btnAddPago, this);
     JSUtils.AddDisableWhenClick(ref this.btnAddproduct, this);
     JSUtils.AddDisableWhenClick(ref this.btnAgregarNewNotaCompra, this);
     JSUtils.AddDisableWhenClick(ref this.btnGuardaNotaCompra, this);
 }
        protected void Page_Load(object sender, EventArgs e)
        {
            this.txtApaterno.Text = this.txtApaterno.Text.ToUpper().Trim();
            this.txtAMaterno.Text = this.txtAMaterno.Text.ToUpper().Trim();
            this.txtNombres.Text  = this.txtNombres.Text.ToUpper().Trim();
            if (!this.IsPostBack)
            {
                JSUtils.AddDisableWhenClick(ref this.btnValidar, this);
                JSUtils.AddDisableWhenClick(ref this.btnAceptar, this);
                JSUtils.AddDisableWhenClick(ref this.btnModificar, this);
                JSUtils.AddDisableWhenClick(ref this.btnAceptardetails, this);
                this.panelmensaje.Visible = false;

                this.cmbEstado.DataBind();
                this.cmbEstadoCivil.DataBind();
                this.cmbRegimen.DataBind();
                //  this.cmbSexo.DataBind();
                this.cmbEstado.SelectedIndex = 13;
                if (Request.QueryString["data"] != null)
                {
                    if (this.loadqueryStrings(Request.QueryString["data"].ToString()))
                    {
                        this.lblProductoresParecidos.Visible = this.GridView1.Visible = false;
                        this.lblHeader.Text = "MODIFICANDO AL PRODUCTOR";

                        if (this.cargadatosmodify())
                        {
                            this.txtIdtomodify.Text = myQueryStrings["idtomodify"].ToString();
                        }
                        else
                        {
                            this.txtIdtomodify.Text = "-1";
                        }
                        this.btnModificar.Visible = true;
                        this.btnAceptar.Visible   = false;
                    }
                    else
                    {
                        myQueryStrings.Clear();
                        Response.Redirect("~/frmAddModifyProductores.aspx", true);
                    }
                }
                else
                {
                    this.lblHeader.Text = "AGREGAR NUEVO UN PRODUCTOR";
                    //  this.txtFechanacimiento.Text = Utils.Now.ToString("dd/MM/yyyy");
                    //this.btnAceptar.Visible = true;
                    this.btnModificar.Visible        = false;
                    this.lblNombreaModificar.Visible = false;
                }
            }
            //this.sdsProductoresRepetidos.SelectCommand = "SELECT [apaterno], [amaterno], [nombre] FROM [Productores] WHERE (([apaterno] LIKE '%' + @apaterno + '%') OR ([amaterno] LIKE '%' + @amaterno + '%') OR ([nombre] LIKE '%' + @nombre + '%')) ORDER BY [apaterno], [amaterno], [nombre]";
            this.sdsProductoresRepetidos.DataBind();
            this.GridView1.DataBind();
            //this.btnAceptar.Visible = (this.GridView1.Rows.Count == 0);
            this.btnModificar.Visible = ((myQueryStrings["idtomodify"] != null && myQueryStrings["idtomodify"].ToString().Length > 0) && !this.GridView1.Visible);
            this.compruebasecurityLevel();
        }
Esempio n. 5
0
        private void AddJSToControls()
        {
            JSUtils.AddDisableWhenClick(ref this.btnAddPago, this);
            //JSUtils.AddDisableWhenClick(ref this.btnAddPago, this);
            //JSUtils.AddDisableWhenClick(ref this.btnRemoveFacturaPago, this);

            String sOnchagemov = "checkValueInList(";

            sOnchagemov += "this" + ",'CHEQUE','";
            sOnchagemov += this.divCheque.ClientID + "');";
            this.cmbConceptomovBancoPago.Attributes.Add("onChange", sOnchagemov);
        }
Esempio n. 6
0
        protected void AddJSToControls()
        {
            JSUtils.AddDisableWhenClick(ref this.btnAddPago, this);

            String sOnchagemov = "checkValueInList(";

            sOnchagemov += "this" + ",'EFECTIVO','";
            sOnchagemov += this.divPagoMovCaja.ClientID + "');";
            this.cmbTipodeMovPago.Attributes.Add("onChange", sOnchagemov);

            sOnchagemov += "checkValueInList(";
            sOnchagemov += "this" + ",'MOVIMIENTO DE BANCO','";
            sOnchagemov += this.divMovBanco.ClientID + "');";
            this.cmbTipodeMovPago.Attributes.Add("onChange", sOnchagemov);

            sOnchagemov  = "checkValueInList(";
            sOnchagemov += "this" + ",'CHEQUE','";
            sOnchagemov += this.divCheque.ClientID + "');";
            this.cmbConceptomovBancoPago.Attributes.Add("onChange", sOnchagemov);
        }
Esempio n. 7
0
 private void AddJSToControls()
 {
     JSUtils.AddDisableWhenClick(ref this.btnAddFacturaAPago, this);
     JSUtils.AddDisableWhenClick(ref this.btnAddPago, this);
     JSUtils.AddDisableWhenClick(ref this.btnRemoveFacturaPago, this);
 }
Esempio n. 8
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");
        }