Esempio n. 1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        String error = Utilis.validaPermisos(Session, NUMFUNCION);

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

        if (!IsPostBack)
        {
            ImageButton mp_imgBtnHelp = (ImageButton)Master.FindControl("imgBtnHelp");
            //Label mpLabel = (Label)Master.FindControl("masterPageLabel");
            if (mp_imgBtnHelp != null)
            {
                mp_imgBtnHelp.Enabled = true;
                mp_imgBtnHelp.Visible = true;
                //mp_imgBtnHelp.Attributes.Add("OnClick", "Ayuda('Help.aspx')");
                mp_imgBtnHelp.Attributes.Add("OnClick", "openwindow()");
            }
        }
        //if (Page.IsValid)
        //{

        //}
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        String error = Utilis.validaPermisos(Session, NUMFUNCION);

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

        int    intTipo     = Int32.Parse(Request.QueryString["tipo"].ToString());
        int    intMonedaId = Int32.Parse(Request.QueryString["monedaId"].ToString());
        String strValor    = Request.QueryString["valor"].ToString();

        lblTitulo.Text = ((intTipo == 0) ? "JOB: " : "ORDEN DE SERVICIO: ") + strValor;

        switch (intMonedaId)
        {
        case 1:
            lblTitulo.Text = lblTitulo.Text + " PESOS";
            break;

        case 2:
            lblTitulo.Text = lblTitulo.Text + " DOLARES";
            break;

        case 3:
            lblTitulo.Text = lblTitulo.Text + " EUROS";
            break;
        }
    }
Esempio n. 3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            String error = Utilis.validaPermisos(Session, NUMFUNCION);
            if (!error.Equals(""))
            {
                Response.Redirect(error);
            }

            error = Utilis.validaPermisos(Session, NUMFUNCION); // Se valida que el usuario tiene el permiso para Seguimiento
            //if (!error.Equals(""))
            //{
            //    lnkSeguimiento.Visible = false;
            //}

            //lstUnidadMedida.SelectedValue = "PZA";
            if (!Page.IsPostBack)
            {
                divCosto.Visible        = false;
                divRentabilidad.Visible = false;
            }
        }
        catch (Exception ex)
        {
        }
    }
Esempio n. 4
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)
    {
        try
        {
            String error = Utilis.validaPermisos(Session, NUMFUNCION);
            if (!error.Equals(""))
            {
                Response.Redirect(error);
            }
            error = Utilis.validaPermisos(Session, NUMFUNCION);

            string fecha = DateTime.Now.ToShortDateString();
            // DateTime fecha = Convert.ToDateTime(((HiddenField)Master.FindControl("hdnDate")).Value);
            //txtRechargeDate.Text = fecha;
            do
            {
                id_perfil = GenerarIdperfil();
            } while (Validar_IdPerfil(id_perfil) != 0);
            if (!Page.IsPostBack)
            {
                refreshdata();
            }
        }
        catch (Exception ex)
        {
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        //Response.AddHeader("REFRESH", "300"); // se refresca la pagina cada 5 min

        // // SEGURIDAD
        String error  = Utilis.validaPermisos(Session, NUMFUNCION);
        String error2 = Utilis.validaPermisos(Session, NUMFUNCION2);
        String error3 = Utilis.validaPermisos(Session, NUMFUNCION3);
        String error4 = Utilis.validaPermisos(Session, NUMFUNCION4);
        String error5 = Utilis.validaPermisos(Session, NUMFUNCION5);

        if (!error.Equals("") && !error2.Equals("") && !error3.Equals("") && !error4.Equals("") && !error5.Equals(""))
        {
            Response.Redirect(error);
        }


        //else if ((Utilis.validaPermisos(Session, 24)).Equals(""))
        //{
        //    Response.Redirect(error);
        //}

        InfoSessionVO infoSession;

        infoSession = (InfoSessionVO)Session["InfoSession"];
        if (infoSession.getValor(InfoSessionVO.PERFIL).ToString() == "1")
        {
            lblCodigoAdmin.Text = " ";
        }
        else
        {
            lblCodigoAdmin.Text = infoSession.getValor(InfoSessionVO.CODIGOUSUARIOADMIN).ToString();
        }
    }
Esempio n. 7
0
    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();
        }
    }
Esempio n. 8
0
    protected void Page_Load(object sender, EventArgs e)
    {
        String error = Utilis.validaPermisos(Session, NUMFUNCION);

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

        //String[,] arrClientes;
        //ClienteVO VOcliente = new ClienteVO();
        //ClienteBL BLcliente = new ClienteBL();
        //VOcliente.Operacion = ClienteVO.LISTACLIENTES;
        //VOcliente = (ClienteVO)BLcliente.execute(VOcliente);
        //arrClientes = VOcliente.ArrClientes;

        //int a;
        //for (int i = 0; i <= arrClientes.GetLength(1) - 1; i++)
        //{
        //    a = i + 1;
        //    lslCliente.Items.Insert(a, new ListItem(arrClientes[1, i], arrClientes[0, i]));
        //}

        GridView1.Visible = false;
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            String error = Utilis.validaPermisos(Session, NUMFUNCION);
            if (!error.Equals(""))
            {
                Response.Redirect(error);
            }
            error = Utilis.validaPermisos(Session, NUMFUNCION);
            //string fecha = DateTime.Now.ToShortDateString();
            //falta = Convert.ToDateTime(((HiddenField)Master.FindControl("hdnDate")).Value);
            div_visualizar.Visible = false;
            div_sinperfil.Visible  = false;
            plaza = this.Session["ubicacion"].ToString();
            SinPerfil2();

            do
            {
                id_sinper = GenerarIdSinPerfil();
            } while (Validar_IdPerfil(id_sinper) != 0);
            if (!IsPostBack)
            {
                IniciarLllenadoDropDown();
            }
        }
        catch (Exception ex)
        {
        }
    }
Esempio n. 10
0
    protected void Page_Load(object sender, EventArgs e)
    {
        String error = Utilis.validaPermisos(Session, NUMFUNCION);

        if (!error.Equals(""))
        {
            Response.Redirect(error);
        }
    }
Esempio n. 11
0
    protected void Page_Load(object sender, EventArgs e)
    {
        int usuarioID = 0;
        int oficinaID = 0;

        String error = Utilis.validaPermisos(Session, NUMFUNCION);

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

        if (Session["usuarioID"] == null)
        {
            InfoSessionVO infoSession;
            infoSession          = (InfoSessionVO)Session["InfoSession"];
            usuarioID            = (int)infoSession.getValor(InfoSessionVO.USUARIOID);
            Session["usuarioID"] = usuarioID;
        }

        if (Session["usuarioIDCotizacion"] == null)
        {
            Session["usuarioIDCotizacion"] = Session["usuarioID"];
        }

        if (Session["nombreCompleto"] != null)
        {
            lblUsuario.Text = Session["nombreCompleto"].ToString();
        }

        if (Session["oficinaId"] == null)
        {
            InfoSessionVO infoSession;
            infoSession          = (InfoSessionVO)Session["InfoSession"];
            oficinaID            = (int)infoSession.getValor(InfoSessionVO.OFICINA);
            Session["oficinaID"] = oficinaID;
        }
        // valida si el usuario tiene el permiso para cotizar con otro usuario
        String error2 = Utilis.validaPermisos(Session, 16);

        if (!error2.Equals(""))
        {
            lblAgentes.Enabled        = false;
            lstAgentes.Enabled        = false;
            lblUsuarioAlterno.Enabled = false;
            //ObjectDataSource2 = false;
            lblAgentes.Visible        = false;
            lstAgentes.Visible        = false;
            lblUsuarioAlterno.Visible = false;
        }

        if (Session["usuarioNombreCotizacion"] != null)
        {
            lblUsuarioAlterno.Text = Session["usuarioNombreCotizacion"].ToString();
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        // SEGURIDAD Acceso a Visitas Ventas
        String error = Utilis.validaPermisos(Session, NUMFUNCION);

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



        if (!Page.IsPostBack)
        {
            try
            {
                lblUsuario.Text = Session["usuarioID"].ToString();
            }
            catch (Exception ee)
            {
                Response.Redirect("~/Seguridad/Login.aspx");
            }

            Boolean blnPerfilAdministradorVisitas = false;
            Boolean blnPerfilSupervisorVisitas    = false;
            Boolean blnPerfilAgenteVisitas        = false;

            // determinar si el usuario tiene los permisos como administrador de Visitas Ventas.
            String error2 = Utilis.validaPermisos(Session, 36);
            if (error2.Equals(""))
            {
                blnPerfilAdministradorVisitas     = true;
                lblEtiquetaAgentes.Visible        = true;
                lstAgentes.Visible                = true;
                ObjectDataSource2.EnableViewState = true;
                //lblUsuario.Text = "-1";
            }

            // determinar si el usuario tiene los permisos como supervisor de Visitas Ventas.
            error2 = Utilis.validaPermisos(Session, 37);
            if (error2.Equals(""))
            {
                blnPerfilSupervisorVisitas        = true;
                lblEtiquetaAgentes.Visible        = true;
                lstAgentes.Visible                = true;
                ObjectDataSource2.EnableViewState = true;
            }

            // determinar si el usuario tiene los permisos como Agente de Visitas Ventas.
            error2 = Utilis.validaPermisos(Session, 38);
            if (error2.Equals(""))
            {
                blnPerfilAgenteVisitas = true;
            }
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        lstAutorizaRemision.Attributes.Add("onchange", "javascript:confirm_message()");

        String error = Utilis.validaPermisos(Session, NUMFUNCION);

        if (!error.Equals(""))
        {
            Response.Redirect(error);
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        this.saludo = "hola";

        try
        {
            String error = Utilis.validaPermisos(Session, NUMFUNCION);
            if (!error.Equals(""))
            {
                Response.Redirect(error);
            }
            error = Utilis.validaPermisos(Session, NUMFUNCION);
            if (!Page.IsPostBack)
            {
                fa          = String.IsNullOrEmpty(Request.QueryString["fecha_alta"]) ? "" : Request.QueryString["fecha_alta"].ToString();
                rfc         = String.IsNullOrEmpty(Request.QueryString["rfc"]) ? "" : Request.QueryString["rfc"].ToString();
                id_empresa  = String.IsNullOrEmpty(Request.QueryString["id_empresa"]) ? "" : Request.QueryString["id_empresa"].ToString();
                id_perfil   = String.IsNullOrEmpty(Request.QueryString["id_perfil"]) ? "" : Request.QueryString["id_perfil"].ToString();
                comentarios = String.IsNullOrEmpty(Request.QueryString["imprimir"]) ? "" : Request.QueryString["imprimir"].ToString();

                System.Diagnostics.Debug.WriteLine("Fecha_Alta: " + fa.ToString());
                System.Diagnostics.Debug.WriteLine("RFC: " + rfc);
                System.Diagnostics.Debug.WriteLine("Id_empresa: " + id_empresa);
                System.Diagnostics.Debug.WriteLine("id_perfil: " + id_perfil);
                System.Diagnostics.Debug.WriteLine("imprimir: " + comentarios);
                //ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert('" + fa + "')", true);
                lbpaciente.Text    = Retornar_Nombre_Paciente(rfc);
                lblRFC.Text        = rfc;
                lbrazonsocial.Text = Retornar_RazonSocial(id_empresa);
                lbperfil.Text      = Retornar_Perfil(id_perfil);
                labfechaalta.Text  = fa;
                lblFecha.Text      = Retornar_Fecha(rfc, id_empresa, id_perfil);
                folio          = RetornarFolio(rfc, id_empresa, id_perfil, fa);
                lbfolio.Text   = folio;
                lbempresa.Text = Retornar_Empresa(id_perfil);
                telp.Text      = RetornarTelPaciente(rfc);
                // lbedad.Text = Retornar_Edad(rfc);

                edad_user   = Devolver_Edad(rfc);
                lbsexo.Text = Devolver_Sexo(rfc);

                fnaci.Text    = Retornar_Fecha_nacimiento(rfc);
                vendedor.Text = Retornar_Usernombre(Retornar_UserPerfil(id_perfil));
                //ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert('" + edad_user + "')", true);
                lbedad.Text = edad_user.ToString() + " años";


                Llenado_Labels(id_perfil);
            }
        }
        catch (Exception ex)
        {
        }
    }
Esempio n. 15
0
    protected void Page_Load(object sender, EventArgs e)
    {
        // SEGURIDAD
        String error = Utilis.validaPermisos(Session, NUMFUNCION);

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

        //lblCodigoProducto.Visible = true;
    }
Esempio n. 16
0
    protected void Page_Load(object sender, EventArgs e)
    {
        // SEGURIDAD
        String error = Utilis.validaPermisos(Session, NUMFUNCION);

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

        //txtAno.Text = System.DateTime.Now.ToString("yyyy");
    }
Esempio n. 17
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!Page.IsPostBack)
     {
         // determinar si el usuario tiene los permisos como administrador de seguimiento a pedidos.
         String error2 = Utilis.validaPermisos(Session, 29);
         if (!error2.Equals(""))
         {
             GridView1.Columns[6].Visible = false;
         }
     }
 }
    protected void Page_Load(object sender, EventArgs e)
    {
        String error = Utilis.validaPermisos(Session, NUMFUNCION);

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


        lblUsuario.Text = Session["nombreCompleto"].ToString();

        datos = conteoPendientes.GetData(Int32.Parse(Session["usuarioID"].ToString()));
        if (datos.Rows.Count > 0)
        {
            lblPendientes.Text = datos.Rows[0]["conteoPendientes"].ToString();
        }

        try
        {
            datos = conteoPendientesMarca.GetData(Int32.Parse(Session["usuarioID"].ToString()), Int32.Parse(lstMarca.SelectedItem.Value));
            if (datos.Rows.Count > 0)
            {
                lblPendientesMarca.Text     = datos.Rows[0]["conteoPendientes"].ToString();
                lblEtiquetaPenMarca.Visible = true;
                lblPendientesMarca.Visible  = true;
            }
        }
        catch (NullReferenceException ex)
        {
            lblEtiquetaPenMarca.Visible = false;
            lblPendientesMarca.Visible  = false;
        }


        lblValorEstatus.Text = "";
        lblFecha.Text        = "";

        //--------------------------------

        InfoSessionVO infoSession;

        infoSession = (InfoSessionVO)Session["InfoSession"];
        if (infoSession.getValor(InfoSessionVO.PERFIL).ToString() == "2")
        {
            lnkbtnRegresar.PostBackUrl = "~/Cotizador/Cotizaciones.aspx";
        }
        else
        {
            lnkbtnRegresar.PostBackUrl = "~/Principal/Default.aspx";
        }
    }
    //int intConteo=0;
    //Boolean blnClienteComodin = false;
    protected void Page_Load(object sender, EventArgs e)
    {
        String error = Utilis.validaPermisos(Session, NUMFUNCION);

        if (!error.Equals(""))
        {
            Response.Redirect(error);
        }
        //Button2.Attributes.Add("onclick", "javascript:document.form1.btnTraeFecha.style.display='none';");
        //btnTFecha.Attributes.Add("onclick", "javascript:muestraCalendario();");

        //if (txtRazon.Text.Length != 0)
        //    {
        //    String strTemp = txtRazon.Text;
        //    txtRazon.Text = strTemp.Replace("%","");
        //    }
        //if (txtRFC.Text.Length != 0)
        //    {
        //    String strTemp = txtRFC.Text;
        //    txtRFC.Text = strTemp.Replace("%", "");
        //    }

        //hdCodigoUsuarioAdmin.Text = (String)((Int32.Parse((String)Session["Usuario_codigoUsuarioAdmin"])).ToString());

        btnContinuar.Visible     = false;
        btnHabilitaNuevo.Visible = false;
        //btnClienteComodin.Visible = false;

        lblMoneda.Visible        = false;
        lblTipoDocumento.Visible = false;
        lblDocumento.Visible     = false;
        //lblFecha.Visible = false;
        //lblArchivo.Visible = false;

        lstTipoCambio.Visible    = false;
        txtDocumento.Visible     = false;
        lstTipoDocumento.Visible = false;
        lstUnidadNegocio.Visible = false;
        lblunidadnegocio.Visible = false;
        //txtFechaDocumento.Visible = false;
        //fplArchivo.Visible = false;
        //btnSubir.Visible = false;


        if (IsPostBack)
        {
            //if (txtRazon.Text.Length != 0)
            //    txtRazon.Text = txtRazon.Text.Replace("%", "");
            //if (txtRFC.Text.Length != 0)
            //    txtRFC.Text = txtRFC.Text.Replace("%", "");
        }
    }
Esempio n. 20
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            Session["IdDoctor"] = null;
        }
        String error = Utilis.validaPermisos(Session, NUMFUNCION);

        if (!error.Equals(""))
        {
            Response.Redirect(error);
        }
    }
    protected void ShopCartGrid_RowCreated(object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            //if (intEstatusCotizacion > 0)
            //{
            Button btnEditar = (Button)e.Row.FindControl("Button1");
            Button btnBorrar = (Button)e.Row.FindControl("Button2");

            btnEditar.Visible = false;
            btnBorrar.Visible = false;
            //}
        }

        if (e.Row.RowType == DataControlRowType.Footer)
        {
            String error1 = Utilis.validaPermisos(Session, 14);
            if (error1.Equals(""))
            {
                blnBanderaAceptaCotizacion = true;
            }

            // determinar si el usuario tiene los permisos para aceptar una cotizacion con descuento.
            String error2 = Utilis.validaPermisos(Session, 15);
            if (error2.Equals(""))
            {
                blnBanderaAceptaCotizacionDescuento = true;
            }

            Button btnRevision = (Button)e.Row.FindControl("Button6");
            btnRevision.Visible = false;

            //cotizacion con descuento, solo supervisores la pueden aceptar
            if (blnBanderaCotizacionDescuento && blnBanderaAceptaCotizacionDescuento)
            {
                btnRevision.Visible = true;
            }
            else if (!blnBanderaCotizacionDescuento && (blnBanderaAceptaCotizacion || blnBanderaAceptaCotizacionDescuento))  //cotizacion sin descuento
            {
                btnRevision.Visible = true;
            }
            else
            {
                ErrMessage.Text = "NO SE TIENEN LOS PERMISOS PARA ACEPTAR UNA COTIZACION";
                if (blnBanderaCotizacionDescuento)
                {
                    ErrMessage.Text += " CON DESCUENTO.";
                }
            }
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            String error = Utilis.validaPermisos(Session, NUMFUNCION);
            if (!error.Equals(""))
            {
                Response.Redirect(error);
            }
            error = Utilis.validaPermisos(Session, 50);
            if (!Page.IsPostBack)
            {
                refreshdata();
                nombre_paciente = String.IsNullOrEmpty(Request.QueryString["rfc"]) ? "" : Request.QueryString["rfc"].ToString();
                nombre_empresa  = String.IsNullOrEmpty(Request.QueryString["id_empresa"]) ? "" : Request.QueryString["id_empresa"].ToString();
                nombre_perfil   = String.IsNullOrEmpty(Request.QueryString["id_perfil"]) ? "" : Request.QueryString["id_perfil"].ToString();

                txtpaciente.Text  = Retornar_Nombre_Paciente(nombre_paciente);
                txtrfc.Text       = nombre_paciente;
                txtempresa.Text   = Retornar_Nombre_Empresa(nombre_empresa);
                txtperfil.Text    = Retornar_Perfil(nombre_perfil);
                txtfechaAlta.Text = Retornar_Fecha(nombre_paciente, nombre_empresa, nombre_perfil);
                folio             = RetornarFolio(nombre_paciente, nombre_empresa, nombre_perfil);
                labfolio.Text     = folio;
                using (SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["cotizadorCS"].ToString()))
                {
                    using (SqlCommand cmd = new SqlCommand("select id_examen from TU_PER_CAT_DETALLEPERFIL where id_perfil= '" + nombre_perfil + "'", con))
                    {
                        con.Open();
                        SqlDataReader dr = cmd.ExecuteReader();
                        while (dr.Read())
                        {
                            foreach (GridViewRow gvrow in GridView1.Rows)
                            {
                                var checkbox = gvrow.FindControl("CheckBox1") as CheckBox;
                                var lblID    = gvrow.FindControl("Label1") as Label;
                                if (lblID.Text == dr["id_examen"].ToString())
                                {
                                    checkbox.Checked = true;
                                }
                            }//fin foreach
                        }
                        con.Close();
                    }
                }
            }
        }
        catch (Exception ex)
        {
        }
    }
Esempio n. 23
0
 public async Task EnsureMigrated()
 {
     try
     {
         if ((await _dbContext.Database.GetPendingMigrationsAsync()).Any())
         {
             Utilis.DieWith("There are pending migrations!\nrun 'dotnet run --migrate true'");
         }
     }
     catch (Exception e)
     {
         Utilis.DieWith("Can't ensure database is migrated. \nReason: " + e.Message);
     }
 }
    protected void Page_Load(object sender, EventArgs e)
    {
        String error = Utilis.validaPermisos(Session, NUMFUNCION);

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

        if (Request["perfilid"] != null && !IsPostBack)
        {
            cargaDatosActualiza();
        }
    }
Esempio n. 25
0
    private object insertaUsuario()
    {
        int?   res        = -1;
        String contrasena = "";

        contrasena = Utilis.CalculateStringHash(VOReg.Usuario_contrasena);

        setIUsuario.GetData(VOReg.Usuarioid, VOReg.Usuario_login, contrasena.Trim(), VOReg.Usuario_nombrecompleto, VOReg.Usuario_perfilid, VOReg.Usuario_estatusId, VOReg.Usuario_oficinaId, VOReg.Usuario_codigoUsuarioAdmin, VOReg.Usuario_correoElectronico, VOReg.Usuario_radio, VOReg.Usuario_jefeUsuarioId, VOReg.Usuario_comisionId, VOReg.Usuario_correoOC, VOReg.Usuario_correoTraspaso, ref res, VOReg.Usuario_administrativoId, VOReg.Usuario_ventasInternasId);
        if (res > 0)
        {
            VOReg.Resultado = res;
        }
        return(VOReg);
    }
Esempio n. 26
0
    private Object actualizaPassword()
    {
        int?   res        = -1;
        String contrasena = "";

        contrasena = Utilis.CalculateStringHash(VOReg.Usuario_contrasena);

        setUsuario.GetData(VOReg.Usuarioid, "", "", 0, 0, 0, contrasena.Trim(), VOReg.ActualizarPassword, "", "", "", 0, 0, 0, 0, ref res, 0, 0);
        if (res == 0)
        {
            VOReg.Resultado = res;
        }
        return(VOReg);
    }
Esempio n. 27
0
        private void CreateStreamWriter()
        {
            lock (CreationLock)
            {
                if (StreamOk)
                {
                    return;
                }

                var directory = new DirectoryInfo(_directory);

                var lastFile = directory.GetFiles()
                               .Where(file => file.FullName.EndsWith(".log"))
                               .OrderByDescending(f => f.LastWriteTime)
                               .FirstOrDefault()?.Name;
                var opened = false;
                if (!string.IsNullOrEmpty(lastFile))
                {
                    try
                    {
                        Console.WriteLine("Using existing log file: " + lastFile);
                        TryOpenStream(lastFile);
                        _logFileSize = (ulong)_streamWriter.BaseStream.Length;
                        opened       = true;
                        if (_logFileSize > MaxLogFileSize)
                        {
                            Console.WriteLine("Or not, it is already too big.");
                            _streamWriter.Close();
                            _streamWriter = null;
                            opened        = false;
                        }
                    }
                    catch (Exception exc)
                    {
                        Console.WriteLine("Can't use existing log file: " + exc.Message);
                    }
                }


                if (!opened)
                {
                    var dt          = DateTime.Now;
                    var logFileName = $"Log_{dt:yyyy-MM-dd_HH-mm-ss}_{Utilis.GenerateRandomHexString(10)}.log";
                    Console.WriteLine("Creating log file: " + logFileName);
                    TryOpenStream(logFileName);
                    _logFileSize = 0;
                }
            }
        }
    protected void Page_Load(object sender, EventArgs e)
    {
        // SEGURIDAD Acceso a Visitas Ventas
        String error = Utilis.validaPermisos(Session, NUMFUNCION);

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

        Boolean blnPerfilAdministradorVisitas = false;
        Boolean blnPerfilSupervisorVisitas    = false;
        Boolean blnPerfilAgenteVisitas        = false;

        if (!Page.IsPostBack)
        {
            lblAgente.Text = Session["usuarioID"].ToString();

            // determinar si el usuario tiene los permisos como administrador de Visitas Ventas.
            String error2 = Utilis.validaPermisos(Session, 36);
            if (error2.Equals(""))
            {
                blnPerfilAdministradorVisitas = true;
                lblTipoUsuario.Text           = "0";
                lstAgente.Visible             = true;
                odsAgentes.EnableViewState    = true;
                lblEtiAgente.Visible          = true;
            }

            // determinar si el usuario tiene los permisos como supervisor de Visitas Ventas.
            error2 = Utilis.validaPermisos(Session, 37);
            if (error2.Equals(""))
            {
                blnPerfilSupervisorVisitas = true;
                lblTipoUsuario.Text        = "1";
                lstAgente.Visible          = true;
                odsAgentes.EnableViewState = true;
                lblEtiAgente.Visible       = true;
            }

            // determinar si el usuario tiene los permisos como Agente de Visitas Ventas.
            error2 = Utilis.validaPermisos(Session, 38);
            if (error2.Equals(""))
            {
                blnPerfilAgenteVisitas = true;
                lblTipoUsuario.Text    = "2";
            }
        }
    }
Esempio n. 29
0
 protected void Page_Load(object sender, EventArgs e)
 {
     try
     {
         String error = Utilis.validaPermisos(Session, NUMFUNCION);
         if (!error.Equals(""))
         {
             Response.Redirect(error);
         }
         error = Utilis.validaPermisos(Session, NUMFUNCION); // Se valida que el usuario tiene el permiso para Seguimiento
     }
     catch (Exception ex)
     {
     }
 }
    protected void Page_Load(object sender, EventArgs e)
    {
        String error = Utilis.validaPermisos(Session, NUMFUNCION);

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

        //if (gvListadoOrdenesCompra.Rows.Count == 0)
        //{
        //    mostrarCamposBusqueda(false);
        //    Response.Redirect("formularioOrdenCompra.aspx");
        //}
    }