protected void Page_Load(object sender, EventArgs e)
    {
        System.Web.UI.ScriptManager.GetCurrent(this).RegisterPostBackControl(btnPolizaP);
        //scriptManager.RegisterPostBackControl(this.lblbtndoc1);
        // SEGURIDAD
        String error = Utilis.validaPermisos(Session, NUMFUNCION);

        if (!error.Equals(""))
        {
            Response.Redirect(error);
        }

        InfoSessionVO infoSession = (InfoSessionVO)Session["InfoSession"];

        intUsuarioId = Int32.Parse(infoSession.getValor(InfoSessionVO.USUARIOID).ToString());

        if (IsPostBack)
        {
            dgvPanelEmpDetP.DataBind();
            dgvPanelEmpleadoP.DataBind();
            dvgPanelRPP.DataBind();
            dvgPanelDeptoP.DataBind();
            //UpdatePanel1.Update();
        }
    }
Beispiel #2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        String error = Utilis.validaPermisos(Session, NUMFUNCION);

        if (!error.Equals(""))
        {
            Response.Redirect(error);
        }

        if (!IsPostBack)
        {
            txtFechaCalendario.Text   = "01/" + DateTime.Now.ToString("MM/yyyy");
            AgregaFechaDiv.Visible    = false;
            AgregaAgenteDiv.Visible   = false;
            AgregaGarantiaDiv.Visible = false;
            EditAgenteDiv.Visible     = false;
            garantiaFhEditDiv.Visible = false;

            txtSucursal.Enabled     = false;
            txtSucursarEdit.Enabled = false;
            lblValidaFechas.Text    = "";
            btnShowAgente.Visible   = true;
        }
        //INFORMACION DE LA SESION
        InfoSessionVO infoSession = (InfoSessionVO)Session["InfoSession"];

        lblUsuario.Text      = infoSession.getValor(InfoSessionVO.USUARIOID).ToString();
        Session["usuarioId"] = infoSession.getValor(InfoSessionVO.USUARIOID);
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        String error = Utilis.validaPermisos(Session, NUMFUNCION);

        if (!error.Equals(""))
        {
            Response.Redirect(error);
        }
        if (Session["perfilID"] == null)
        {
            InfoSessionVO infoSession = (InfoSessionVO)Session["InfoSession"];
            int           intPerfil   = Int32.Parse(infoSession.getValor(InfoSessionVO.PERFIL).ToString());
            Session["perfilID"] = intPerfil;
        }
    }
    protected void LoginButton_Click(object sender, EventArgs e)
    {
        if (Page.IsValid)
        {
            Session["usuarioID"]           = null;
            Session["InfoSession"]         = null;
            Session["OrderNumber"]         = null;
            Session["usuarioIDCotizacion"] = null;
            Session["oficinaId"]           = null;
            Session["perfilID"]            = null;
            Session["ubicacion"]           = null;

            LoginBL       accesar = new LoginBL();
            LoginVO       loginVO = new LoginVO();
            InfoSessionVO info    = new InfoSessionVO();


            loginVO.Usuario_login      = Login1.UserName;
            loginVO.Usuario_contrasena = Login1.Password;

            loc = ubicacion.Text.Trim();

            //verifica que el usuario tenga acceso
            loginVO = (LoginVO)accesar.execute(loginVO);

            if (loginVO.Resultado.Equals(1))
            {
                info.setValor(InfoSessionVO.NOMBRECOMPLETO, loginVO.Usuario_nombrecompleto);
                info.setValor(InfoSessionVO.ESTATUSUSUARIO, loginVO.Usuario_estatusId);
                info.setValor(InfoSessionVO.PERFIL, loginVO.Usuario_perfilid);
                info.setValor(InfoSessionVO.OFICINA, loginVO.Usuario_oficinaId);
                info.setValor(InfoSessionVO.FUNCIONES, loginVO.FuncionPerfil);
                info.setValor(InfoSessionVO.USUARIOID, loginVO.Usuarioid);
                info.setValor(InfoSessionVO.CODIGOUSUARIOADMIN, loginVO.Usuario_codigoUsuarioAdmin);
                info.setValor(InfoSessionVO.CORREOELECTRONICO, loginVO.Usuario_correoElectronico);

                Session["nombreCompleto"]             = loginVO.Usuario_nombrecompleto;
                Session["Usuario_codigoUsuarioAdmin"] = loginVO.Usuario_codigoUsuarioAdmin;
                Session["usuarioID"] = loginVO.Usuarioid;
                Session["ubicacion"] = loc;

                //saludo nuevo = new saludo();
                //Session.Add("nuevo", nuevo);

                Session.Add("InfoSession", info);
                log4net.Config.DOMConfigurator.Configure();
                log.Info("Entrando en la aplicacion - Login");
                if (loginVO.Usuario_perfilid == 2)
                {
                    Response.Redirect("~/Cotizador/Default.aspx");
                    return;
                }
                if (loginVO.Usuario_perfilid == 8)
                {
                    Response.Redirect("~/OrdenesCompra/listadoOrdenesCompra.aspx");
                    return;
                }

                Response.Redirect("~/Principal/Default.aspx");
            }
            else
            {
                Response.Redirect("~/Seguridad/Login.aspx");
                Login1.FailureText = "<br>Usuario/Contraseña Invalidos";
            }
        }
    }
Beispiel #5
0
    protected void Page_Load(object sender, EventArgs e)
    {
        String error = Utilis.validaPermisos(Session, NUMFUNCION);

        if (!error.Equals(""))
        {
            Response.Redirect(error);
        }

        OrdenCompraBL OCBL = new OrdenCompraBL();
        OrdenCompraVO OCVO = new OrdenCompraVO();

        OCVO.Operacion     = OrdenCompraVO.BUSCAR;
        OCVO.OrdenCompraId = Int32.Parse(Request["ordenCompraId"].ToString());
        OCVO = (OrdenCompraVO)OCBL.execute(OCVO);

        lblFecha.Text = OCVO.FechaAlta.ToString("d");

        lblFechaEntrega.Text          = OCVO.FechaEntrega;
        lblContacto.Text              = OCVO.Contacto;
        lblDatosTransferencia.Text    = OCVO.DatosTransferencia;
        lblInstruccionesEmbarque.Text = OCVO.InstruccionesEmbarque;
        lblTerminos.Text              = OCVO.Terminos;
        lblFob.Text         = OCVO.Fob;
        lblProyecto.Text    = OCVO.NombreProyecto;
        lblJob.Text         = OCVO.NombreJob;
        lblViaEmbarque.Text = OCVO.ViaEmbarque;
        lblMoneda.Text      = OCVO.MonedaId.ToString();
        Label6.Text         = OCVO.OrdenServicio.ToString();
        lblNombreJefe.Text  = OCVO.NombreJefe;

        lblDescuento.Text      = OCVO.PorcentajeDescuento.ToString("F2");
        lblEnvio.Text          = String.Format("{0:#,##0.00}", OCVO.CostoEnvio);       //OCVO.CostoEnvio.ToString("F2");
        lblImpuesto.Text       = OCVO.PorcentajeImpuesto.ToString("F2");
        lblImpImportacion.Text = String.Format("{0:#,##0.00}", OCVO.CostoImportacion); //OCVO.CostoImportacion.ToString("F2");

        try
        {
            if (OCVO.AccountName.Trim().Length == 0)
            {
                ((Panel)GridView1.FooterRow.FindControl("pnlBankInformation")).Visible = false;
            }
            else
            {
                ((Label)GridView1.FooterRow.FindControl("lblAccountName")).Text   = OCVO.AccountName;
                ((Label)GridView1.FooterRow.FindControl("lblNameAddress")).Text   = OCVO.Address;
                ((Label)GridView1.FooterRow.FindControl("lblBankName")).Text      = OCVO.BankName;
                ((Label)GridView1.FooterRow.FindControl("lblAccountNumber")).Text = OCVO.AccountNumber;
                ((Label)GridView1.FooterRow.FindControl("lblAba")).Text           = OCVO.Aba;
                ((Label)GridView1.FooterRow.FindControl("lblBankAddress")).Text   = OCVO.BankAddress;
            }
        }
        catch (Exception ex)
        {
            //((Panel)GridView1.FooterRow.FindControl("pnlBankInformation")).Visible = false;
        }

        lblOrdenCompraId.Text = (OCVO.OrigenId == 1 ? "N-" + OCVO.IdNacional.ToString() : "I-" + OCVO.IdInternacional.ToString());

        ProveedoresBL BL = new ProveedoresBL();
        ProveedoresVO VO = new ProveedoresVO();

        VO.Operacion   = ProveedoresVO.BUSCAR;
        VO.ProveedorId = OCVO.ProveedorId;
        VO             = (ProveedoresVO)BL.execute(VO);

        //txtContacto.Text = VO.Representante;
        lblProveedor.Text       = VO.Nombre;
        lblNombreProveedor.Text = VO.Nombre;
        lblRFC.Text             = VO.Rfc;

        DireccionesBL DBL = new DireccionesBL();
        DireccionesVO DVO = new DireccionesVO();

        DVO.Operacion   = DireccionesVO.BUSCAR;
        DVO.DireccionId = VO.DireccionId;
        DVO             = (DireccionesVO)DBL.execute(DVO);


        lblDireccion.Text = DVO.Calle + " " + DVO.NoExterior + " " + DVO.NoInterior + ", " + DVO.Colonia + ", " + DVO.Cp + ", " + DVO.Ciudad + ", " + DVO.Estado;
        lblEMail.Text     = DVO.Email;

        lblTelefono.Text = DVO.Telefono1;
        lblFax.Text      = DVO.Fax;

        TipoCambioVO VOtipoCambio = new TipoCambioVO();
        TipoCambioBL BLtipoCambio = new TipoCambioBL();

        VOtipoCambio.MonedaId  = OCVO.MonedaId;
        VOtipoCambio.Operacion = TipoCambioVO.BUSCAR;
        VOtipoCambio           = (TipoCambioVO)BLtipoCambio.execute(VOtipoCambio);

        if (VOtipoCambio.Descripcion != null)
        {
            lblMoneda.Text = VOtipoCambio.Descripcion;
        }

        usuarioVO VOUsuario = new usuarioVO();
        UsuarioBL BLUsuario = new UsuarioBL();

        VOUsuario.Operacion = usuarioVO.BUSCAR;
        VOUsuario.Usuarioid = OCVO.UsuarioId;
        VOUsuario           = (usuarioVO)BLUsuario.execute(VOUsuario);

        lblNombreAgente.Text = VOUsuario.Usuario_nombrecompleto;

        InfoSessionVO infoSession = (InfoSessionVO)Session["InfoSession"];

        if (Int32.Parse(infoSession.getValor(InfoSessionVO.OFICINA).ToString()) != 4)
        {
            Image1.ImageUrl = "~/Imagenes/caidaCalvek.JPG";
        }
        else
        {
            Image1.ImageUrl = "~/Imagenes/logoCalvekAutomation.jpg";
        }

        OCBL        = null;
        OCVO        = null;
        BL          = null;
        VO          = null;
        DBL         = null;
        DVO         = null;
        VOUsuario   = null;
        BLUsuario   = null;
        infoSession = null;
    }