Example #1
0
        protected void btnIngresar_Click(object sender, EventArgs e)
        {
            bool     estado = false;
            Gestores perfil = new Gestores();

            estado = negges.verificargestor(txtNombre.Text.Trim(), txtContrasenia.Text.Trim());
            if (estado == true)
            {
                Session["NombreUsuario"] = txtNombre.Text.Trim();


                perfil.SetNombPerfilGS(txtNombre.Text);
                negges.get(perfil);
                Session["NivelUsuario"] = perfil.GetNivelGS();

                if (perfil.GetNivelGS() == 1)
                {
                    Response.Redirect("MenuGestoria.aspx");
                }
                else
                {
                    Response.Redirect("MenuGestoriaMaster.aspx");
                }
            }
            else
            {
                lblConfirmado.Text = "mal ingresado el nombre o la contraseña";
            }
        }
        private void ArmarParametrosGestorEliminar(ref SqlCommand Comando, Gestores ges)
        {
            SqlParameter SqlParametros = new SqlParameter();

            SqlParametros       = Comando.Parameters.Add("@MATRICULA", SqlDbType.VarChar);
            SqlParametros.Value = ges.GetMatriculaGS();
        }
Example #3
0
        protected void btnRegistrar_Click(object sender, EventArgs e)
        {
            Boolean comando = false;

            Gestores gesto = new Gestores();

            gesto.SetMatriculaGS(txtMatricula.Text.Trim());
            gesto.SetDniGS(txtDni.Text.Trim());
            gesto.SetNombreGS(txtNombre.Text);
            gesto.SetApellidoGS(txtApellido.Text);
            gesto.SetAnioGS(Convert.ToDateTime(txtFecha.Text));///revisar q envie en el correcto
            gesto.SetMailGS(txtMail.Text.Trim());
            gesto.SetNombPerfilGS(txtPerfil.Text.Trim());
            gesto.SetContrasenaGS(txtContrasenia.Text.Trim());
            gesto.SetNivelGS(1);
            gesto.SetEstadoGS(true);

            comando = Ngestor.AgregarGestores(gesto);

            if (comando == true)
            {
                Session["NombreUsuario"] = txtPerfil.Text.Trim();
                Session["contrasena"]    = txtContrasenia.Text.Trim();
                Response.Redirect("ConfirmacionGestor.aspx");
            }
            else
            {
                lblConfirmado.Text = "no se registro al gestor reintente"; //por ahora sirve pero cambiar por reponse
            }
        }
Example #4
0
        public ActionResult EditModesAddNewPartial([ModelBinder(typeof(DevExpress.Web.Mvc.DevExpressEditorsBinder))] Gestores gestor)
        {
            var gestores = db.vwGestores;

            if (ModelState.IsValid)
            {
                try
                {
                    if (gestor.IdGestor == -1)
                    {
                        db.Gestores.Add(gestor);
                        db.SaveChanges();
                    }
                }
                catch (System.Exception e)
                {
                    ViewData["EditError"] = e.Message;
                }
            }
            else
            {
                ViewData["EditError"] = "Please, correct all errors.";
            }
            return(PartialView("EditPartial", gestores));
        }
        public int AgregarGestores(Gestores ges)
        {
            SqlCommand comando = new SqlCommand();

            ArmarParametrosGestoresAgregar(ref comando, ges);
            return(ds.EjecutarProcedimientoAlmacenado(comando, "spAgregarGestores"));
        }
        private void ArmarParametrosGestoresAgregar(ref SqlCommand Comando, Gestores ges)
        {
            SqlParameter SqlParametros = new SqlParameter();

            SqlParametros       = Comando.Parameters.Add("@MATRICULA_ge", SqlDbType.VarChar);
            SqlParametros.Value = ges.GetMatriculaGS();
            SqlParametros       = Comando.Parameters.Add("@DNI_ge", SqlDbType.VarChar);
            SqlParametros.Value = ges.GetDniGS();
            SqlParametros       = Comando.Parameters.Add("@NOMBRE_ge", SqlDbType.VarChar);
            SqlParametros.Value = ges.GetNombreGS();
            SqlParametros       = Comando.Parameters.Add("@APELLIDO_ge", SqlDbType.VarChar);
            SqlParametros.Value = ges.GetApellidoGS();
            SqlParametros       = Comando.Parameters.Add("@nacimiento_ge", SqlDbType.DateTime);
            SqlParametros.Value = ges.GetAnioGS();//no estoy seguro si esta bien aplicado esto pero creo que devuelve bien la fecha
            SqlParametros       = Comando.Parameters.Add("@MAIL_ge", SqlDbType.VarChar);
            SqlParametros.Value = ges.GetMailGS();
            SqlParametros       = Comando.Parameters.Add("@NOMBRE_PERFIL_ge", SqlDbType.VarChar);
            SqlParametros.Value = ges.GetNombPerfilGS();
            SqlParametros       = Comando.Parameters.Add("@CONTRASENA_ge", SqlDbType.VarChar);
            SqlParametros.Value = ges.GetContrasenaGS();
            SqlParametros       = Comando.Parameters.Add("@NIVEL_ge", SqlDbType.Int);
            SqlParametros.Value = ges.GetNivelGS();
            SqlParametros       = Comando.Parameters.Add("@ESTADO_ge", SqlDbType.Bit);
            SqlParametros.Value = ges.GetEstadoGS();
        }
        /* public Gestores getGestores(Gestores ges)
         * {
         *   DataTable tabla = ds.obtenerTabla("Gestores", "Select * from Gestores where matricula=" + ges.GetMatriculaGS());
         *   ges.SetMatriculaGS(tabla.Rows[0][0].ToString());
         *   ges.SetDniGS(tabla.Rows[0][1].ToString());
         *   ges.SetNombreGS(tabla.Rows[0][2].ToString());
         *   ges.SetApellidoGS(tabla.Rows[0][3].ToString());
         *   ges.SetAnioGS(Convert.ToDateTime(tabla.Rows[0][4]));
         *   ges.SetMailGS(tabla.Rows[0][5].ToString());
         *   ges.SetNombPerfilGS(tabla.Rows[0][6].ToString());
         *   ges.SetContrasenaGS(tabla.Rows[0][7].ToString());
         *   ges.SetNivelGS(Convert.ToInt32(tabla.Rows[0][8].ToString()));
         *   ges.SetEstadoGS(Convert.ToBoolean(tabla.Rows[0][9].ToString()));
         *   return ges;
         * }*/

        public Gestores getGestores(Gestores ges)

        {
            DataTable tabla = ds.obtenerTabla("Gestores", "Select * from Gestores where nombre_perfil_ge = '" + ges.GetNombPerfilGS() + "'");

            ges.SetMatriculaGS(tabla.Rows[0][0].ToString());
            ges.SetDniGS(tabla.Rows[0][1].ToString());
            ges.SetNombreGS(tabla.Rows[0][2].ToString());
            ges.SetApellidoGS(tabla.Rows[0][3].ToString());
            ges.SetAnioGS(Convert.ToDateTime(tabla.Rows[0][4]));
            ges.SetMailGS(tabla.Rows[0][5].ToString());
            ges.SetNombPerfilGS(tabla.Rows[0][6].ToString());
            ges.SetContrasenaGS(tabla.Rows[0][7].ToString());
            ges.SetNivelGS(Convert.ToInt32(tabla.Rows[0][8].ToString()));
            ges.SetEstadoGS(Convert.ToBoolean(tabla.Rows[0][9].ToString()));
            return(ges);
        }
        protected void grvgestores_RowDeleting(object sender, GridViewDeleteEventArgs e)
        {
            negociogestores neg         = new negociogestores();
            string          s_matricula = ((Label)grvgestores.Rows[e.RowIndex].FindControl("lbl_it_matricula")).Text;

            Gestores ges = new Gestores();

            ges.SetMatriculaGS(s_matricula);


            neg.EliminarGestores(s_matricula);

            DataTable tablaGestores = neg.getTabla();

            grvgestores.DataSource = tablaGestores;
            grvgestores.DataBind();
        }
Example #9
0
        public bool verificargestor(string nombrePer, string contrasena)
        {
            Gestores ges = new Gestores();

            ges.SetNombPerfilGS(nombrePer);
            ges.SetContrasenaGS(contrasena);
            datosgestor dtg = new datosgestor();

            if (dtg.existegestor(ges) == true)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Example #10
0
        public bool EliminarGestores(string cod)
        {
            //Validar si existente
            datosgestor dato = new datosgestor();
            Gestores    ges  = new Gestores();

            ges.SetMatriculaGS(cod);
            int op = dato.EliminarGestores(ges);

            if (op == 1)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Example #11
0
        public bool AgregarGestores(Gestores ges)
        {
            int cantFilas = 0;

            datosgestor dato = new datosgestor();

            if (dato.existegestor(ges) == false)
            {
                cantFilas = dato.AgregarGestores(ges);
            }

            if (cantFilas == 1)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
        protected void grvgestores_RowUpdating(object sender, GridViewUpdateEventArgs e)
        {
            String s_matricula = ((Label)grvgestores.Rows[e.RowIndex].FindControl("lbl_eit_matricula")).Text;
            String s_dni       = ((Label)grvgestores.Rows[e.RowIndex].FindControl("lbl_eit_dni")).Text;
            String s_nombre    = ((TextBox)grvgestores.Rows[e.RowIndex].FindControl("txt_eit_nombre")).Text;
            String s_apellido  = ((TextBox)grvgestores.Rows[e.RowIndex].FindControl("txt_eit_apellido")).Text;
            //string s_nacimiento = Convert.ToString((Label)grvgestores.Rows[e.RowIndex].FindControl("lbl_eit_apellido"));
            DateTime s_nacimiento = Convert.ToDateTime(((Label)grvgestores.Rows[e.RowIndex].FindControl("lbl_eit_nacimiento")).Text);
            //string s_nacimiento = ((Label)grvgestores.Rows[e.RowIndex].FindControl("lbl_eit_nacimiento")).Text;
            String  s_mail       = ((Label)grvgestores.Rows[e.RowIndex].FindControl("lbl_eit_mail")).Text;
            String  s_perfil     = ((TextBox)grvgestores.Rows[e.RowIndex].FindControl("txt_eit_perfil")).Text;
            string  s_contrasena = ((Label)grvgestores.Rows[e.RowIndex].FindControl("lbl_eit_dni")).Text;
            int     s_nivel      = Convert.ToInt32(((Label)grvgestores.Rows[e.RowIndex].FindControl("lbl_eit_dni")).Text);
            Boolean s_estado     = true;

            //negociogestores neg = negociogestores();
            Gestores ges = new Gestores();

            ges.SetMatriculaGS(s_matricula);
            ges.SetDniGS(s_dni);
            ges.SetNombreGS(s_nombre);
            ges.SetApellidoGS(s_apellido);
            ges.SetAnioGS(s_nacimiento);
            //ges.GetAnioGS();
            // ges.SetAnioGS(Convert.ToDateTime(s_nacimiento));
            ges.SetMailGS(s_mail);
            ges.SetNombPerfilGS(s_perfil);
            ges.SetContrasenaGS(s_contrasena);
            ges.SetNivelGS(s_nivel);
            ges.SetEstadoGS(s_estado);

            negociogestores nego = new negociogestores();

            nego.AgregarGestores(ges);
            grvgestores.EditIndex = -1;
            DataTable tablaGestores = neg.getTabla();

            grvgestores.DataSource = tablaGestores;
            grvgestores.DataBind();
        }
Example #13
0
        public ActionResult EditModesUpdatePartial(Gestores gestor)
        {
            var gestores = db.vwGestores;

            if (ModelState.IsValid)
            {
                try
                {
                    db.Entry(gestores).State = EntityState.Modified;
                    db.SaveChanges();
                }
                catch (System.Exception e)
                {
                    ViewData["EditError"] = e.Message;
                }
            }
            else
            {
                ViewData["EditError"] = "Please, correct all errors.";
            }

            return(PartialView("EditPartial", gestores));
        }
Example #14
0
File: hcrDAO.cs Project: royds4/HCR
        public Gestores GestGrid(paramGestDTO DTO)
        {
            Gestores userse = new Gestores();
            string connectionString = UtilSh.strCnn2; //System.Configuration.ConfigurationManager.ConnectionStrings["cnnSql2"].ToString();

            using (SqlConnection connection = new SqlConnection(connectionString))
            {
                using (SqlCommand command = new SqlCommand())
                {
                    command.Connection = connection;
                    command.CommandText = "Exec dbo.GestBGrid @Pais=" + DTO.Pais + " ,@Codigo="+ DTO.Codigo +" ,@Nombre='"+  DTO.Nombre + "' ,@Id="+DTO.IdCupo;
                    command.CommandType = CommandType.Text;
                    connection.Close();
                    connection.Open();

                    using (SqlDataReader dataReader = command.ExecuteReader())
                    {
                        GestorDTO user;
                        while (dataReader.Read())
                        {
                            user = new GestorDTO();//Creación de un nuevo objeto del tipo de nuestro DTO en donde cargaremos toda la información proveniente de nuestro comando de DB, discriminando cada elemento con 'request'
                            user.ID = Convert.ToInt32(dataReader["ID"]);
                            user.Llave = Convert.ToString(dataReader["Llave"]);
                            user.NUsuario = Convert.ToString(dataReader["NUsuario"]);
                            user.CodCliente = Convert.ToString(dataReader["CodCliente"]);
                            user.CodClienteA = Convert.ToString(dataReader["CodClienteA"]);
                            user.NCliente = Convert.ToString(dataReader["NCliente"]);
                            user.Comercial = Convert.ToString(dataReader["Comercial"]);
                            user.Pais = Convert.ToString(dataReader["Pais"]);
                            user.Cupo = Convert.ToString(dataReader["Cupo"]);
                            user.CupoOtorgado = Convert.ToString(dataReader["CupoOtorgado"]);
                            user.CupoActual = Convert.ToString(dataReader["CupoActual"]);
                            user.Plazo = Convert.ToString(dataReader["Plazo"]);
                            user.PlazoOtorgado = Convert.ToString(dataReader["PlazoOtorgado"]);
                            user.PlazoActual = Convert.ToString(dataReader["PlazoActual"]);
                            user.Tipo = Convert.ToString(dataReader["Tipo"]);
                            user.Estado = Convert.ToString(dataReader["Estado"]);
                            user.Vice = Convert.ToString(dataReader["Vice"]);
                            user.Fecha = Convert.ToString(dataReader["Fecha"]);
                            user.Hora = Convert.ToString(dataReader["Hora"]);
                            user.Asegurado = Convert.ToString(dataReader["Asegurado"]);
                            user.EstadoSeg = Convert.ToString(dataReader["EstadoSeg"]);
                            user.ConceptoCredito = Convert.ToString(dataReader["ConceptoCredito"]);
                            user.ComentarioCredito = Convert.ToString(dataReader["ComentarioCredito"]);
                            user.NotasImportantes = Convert.ToString(dataReader["NotasImportantes"]);
                            user.FechaDocCompletos = Convert.ToString(dataReader["FechaDocCompletos"]);
                            user.FechaGarantia = Convert.ToString(dataReader["FechaGarantia"]);
                            user.FechaConceptoCredito = Convert.ToString(dataReader["FechaConceptoCredito"]);
                            user.FechaSeguro = Convert.ToString(dataReader["FechaSeguro"]);
                            user.FechaJefeCartera = Convert.ToString(dataReader["FechaJefeCartera"]);
                            user.FechaGerente = Convert.ToString(dataReader["FechaGerente"]);
                            user.FechaDirector = Convert.ToString(dataReader["FechaDirector"]);
                            user.FechaVicepresidente = Convert.ToString(dataReader["FechaVicepresidente"]);
                            user.FechaComite = Convert.ToString(dataReader["FechaComite"]);
                            user.FechaPresidentePais = Convert.ToString(dataReader["FechaPresidentePais"]);
                            user.FechaPresidenteRegion = Convert.ToString(dataReader["FechaPresidenteRegion"]);
                            user.FechaNegado = Convert.ToString(dataReader["FechaNegado"]);
                            user.FechaTramitado = Convert.ToString(dataReader["FechaTramitado"]);
                            user.FechaSuspendido = Convert.ToString(dataReader["FechaSuspendido"]);
                            user.FechaProximaRevision = Convert.ToString(dataReader["FechaProximaRevision"]);
                            user.FechaRad = Convert.ToString(dataReader["FechaRad"]);
                            userse.Add(user);
                        }
                    }

                    //Convert.ToInt32(paramTotalRecords.Value);
                }
            }

            return userse;
            /*IRdmsConnection cnn = new SqlRdmsConnection<GestorDTO>(UtilSh.strCnn2, "dbo.GestGrid");//Procedimiento almacenado para inserción de solicitudes.
            var result = cnn.Execute(true, CommandType.StoredProcedure);
            var res = (from r in result
                       select (GestorDTO)r).ToArray();
            foreach (var x in res)
            {
                userse.Add(x);
            }

            return userse;*/
        }
Example #15
0
 public static Gestores GetUsers(paramGestDTO DTO)
 {
     Gestores userse = new Gestores();
         ServHCR shcr = new ServHCR();
         userse = shcr.GestGrid(DTO);
         return userse;
 }
Example #16
0
        /*public Gestores get(Gestores cod)
         * {
         *  datosgestor dato = new datosgestor();
         *  Gestores ges = new Gestores();
         *  ges.SetMatriculaGS(cod);
         *  return dato.getGestores(ges);
         * }*/

        public Gestores get(Gestores ges)
        {
            datosgestor dato = new datosgestor();

            return(dato.getGestores(ges));
        }
        public Boolean existegestor(Gestores ges)
        {
            string consulta = "select Nombre_Perfil_ge, Contrasena_ge from Gestores where Nombre_Perfil_ge='" + ges.GetNombPerfilGS() + "' and Contrasena_ge='" + ges.GetContrasenaGS() + "'";

            return(ds.existe(consulta));
        }