//===========================================================================
        //===========================================================================
        //FUNCION QUE SE ACTIVA CUANDO SE DEJE DE ENFOCAR LA ENTRADA "pickerFilial"
        //private void OnUnfocusedFilial(object sender, FocusEventArgs e){}

        //===========================================================================
        //===========================================================================
        //FUNCION QUE SE ACTIVA CUANDO SE DEJE DE ENFOCAR LA ENTRADA "entryArea"
        private void OnUnfocusedArea(object sender, FocusEventArgs e)
        {
            //SE EVALUA QUE LA PROPIEDAD "Area" NO SE ENCUENTRE NULA O VACIA
            if (!string.IsNullOrEmpty(DatosPagina.Area))
            {
                //SE EVALUA SI EL TEXTO INGRESADO CUMPLE CON LAS CONDICIONES MINIMAS
                if (Metodos.Caracteres(DatosPagina.Area))
                {
                    Mensaje("El nombre del area no puede contener los siguientes caracteres:\n " +
                            "'!', '@', '#', '$', '%', '&', '(', ')', '+', '=', '/', '|'");
                }
                else
                {
                    DatosPagina.Area = Metodos.Mayuscula(DatosPagina.Area);
                }
            }
        }
        public static bool VerificaClienteCadastrado(long cpf)
        {
            string strSQL;

            strSQL = "EXEC VerificaClienteCadastrado " + cpf;

            DataTable tab = Metodos.ExecSQL(strSQL);

            if (tab.Rows.Count == 0)
            {
                return(false);
            }
            else
            {
                return(true);
            }
        }
Exemple #3
0
        public ActionResult Empresa(long modId)
        {
            EmpresaModel model           = new EmpresaModel();
            string       _modId          = modId.ToString();
            int          IdTipoDocumento = int.Parse(_modId.Length == 7 ? _modId.Substring(0, 1) : _modId.Substring(0, 2));
            long         IdModulo        = IdTipoDocumento * 1000000;

            model.PageTitle      = Metodos.GetModuloName(modId);
            ViewBag.Title        = string.Format("{0} - {1}", model.PageTitle, Resources.BCMWebPublic.labelAppTitle);
            model.IdModulo       = IdModulo;
            model.Perfil         = Metodos.GetPerfilData();
            model.IdModuloActual = modId;
            Session["modId"]     = modId;
            Auditoria.RegistarAccion(eTipoAccion.AccesoModuloWeb);

            return(View(model));
        }
Exemple #4
0
        public ActionResult ExportDispositivos()
        {
            string _modId          = Session["modId"].ToString();
            long   modId           = long.Parse(_modId);
            int    IdTipoDocumento = int.Parse(_modId.Substring(0, (_modId.Length == 7 ? 1 : 2)));

            long IdModulo = IdTipoDocumento * 1000000;

            //model.IdModulo = IdModulo;
            //model.IdModuloActual = modId;
            //model.Perfil = Metodos.GetPerfilData();
            //model.PageTitle = Metodos.GetModuloName(modId);
            //ViewBag.Title = string.Format("{0} - {1}", model.PageTitle, Resources.BCMWebPublic.labelAppTitle);

            Session["GridViewData"] = Metodos.GetDispositivosMoviles();
            return(GridViewExportIniciativas.FormatConditionsExportFormatsInfo[GridViewExportFormat.Xlsx](GridViewExportIniciativas.FormatConditionsExportGridViewSettings, Metodos.GetDispositivosMoviles()));
        }
Exemple #5
0
 protected void ddlTipoArbol_OnSelectedIndexChanged(object sender, EventArgs e)
 {
     try
     {
         Metodos.LimpiarCombo(ddlNivel1);
         Metodos.LimpiarCombo(ddlNivel2);
         Metodos.LimpiarCombo(ddlNivel3);
         Metodos.LimpiarCombo(ddlNivel4);
         Metodos.LimpiarCombo(ddlNivel5);
         Metodos.LimpiarCombo(ddlNivel6);
         Metodos.LimpiarCombo(ddlNivel7);
         int idTipoArbol   = Convert.ToInt32(ddlTipoArbol.SelectedValue);
         int idTipoUsuario = Convert.ToInt32(ddlTipoUsuario.SelectedValue);
         Metodos.LlenaComboCatalogo(ddlNivel1, _servicioArbolAcceso.ObtenerNivel1(int.Parse(ddlArea.SelectedValue), idTipoArbol, idTipoUsuario, true));
         if (ddlTipoArbol.SelectedIndex != BusinessVariables.ComboBoxCatalogo.IndexSeleccione)
         {
             btnAgregarNivel1.Enabled = true;
             btnAgregarNivel2.Enabled = false;
             btnAgregarNivel3.Enabled = false;
             btnAgregarNivel4.Enabled = false;
             btnAgregarNivel5.Enabled = false;
             btnAgregarNivel6.Enabled = false;
             btnAgregarNivel7.Enabled = false;
         }
         else
         {
             btnAgregarNivel1.Enabled = false;
             btnAgregarNivel2.Enabled = false;
             btnAgregarNivel3.Enabled = false;
             btnAgregarNivel4.Enabled = false;
             btnAgregarNivel5.Enabled = false;
             btnAgregarNivel6.Enabled = false;
             btnAgregarNivel7.Enabled = false;
         }
         ucAltaNivelArbol.IdTipoArbol = int.Parse(ddlTipoArbol.SelectedValue);
     }
     catch (Exception ex)
     {
         if (_lstError == null)
         {
             _lstError = new List <string>();
         }
         _lstError.Add(ex.Message);
         AlertaGeneral = _lstError;
     }
 }
        public static bool AlterarCliente(Cliente cliente)
        {
            SqlParameter[] parameters =
            {
                new SqlParameter("@nome",               cliente.Nome),
                new SqlParameter("@cpf",                cliente.Cpf),
                new SqlParameter("@id_TipoCliente",     Convert.ToInt32(cliente.TipoCliente)),
                new SqlParameter("@sexo",               cliente.Sexo),
                new SqlParameter("@id_SituacaoCliente", Convert.ToInt32(cliente.SituacaoCliente))
            };
            string strSQL;

            strSQL = "CLIENTE_ALTERAR";
            Metodos.ExecInsert(strSQL, parameters);

            return(true);
        }
Exemple #7
0
        public ActionResult Edit(ParametroMuestra[] parametros)
        {
            double p = 0, a = 0;

            foreach (var item in parametros)
            {
                ParametroMuestra parametro = db.ParametroMuestra.Find(item.PAMId);
                if (parametro.Parametro == "a")
                {
                    a = item.Valor;
                }
                if (parametro.Parametro == "p")
                {
                    p = item.Valor;
                }
                if (parametro.Parametro == "q")
                {
                    item.Valor = 100 - p;
                }
                if (parametro.Parametro == "Za")
                {
                    var    chart = new Chart();
                    double temp  = (100 - 0.5 * (100 - a)) / 100;
                    item.Valor = Math.Floor((chart.DataManipulator.Statistics.InverseNormalDistribution(temp)) * 100) / 100;
                }

                if (parametro.Valor != item.Valor)
                {
                    parametro.Valor           = item.Valor;
                    parametro.MFechaHora      = DateTime.Now;
                    parametro.MUsuarioId      = System.Web.HttpContext.Current.User.Identity.Name;
                    db.Entry(parametro).State = System.Data.Entity.EntityState.Modified;
                    db.SaveChanges();
                    Metodos.RegistrarLog(new Log
                    {
                        Modulo  = "ParametrosMuestra",
                        Accion  = "Actualizar",
                        Detalle = "Parametro modificado: " + parametro.Descripcion + " " + parametro.Valor
                    });
                }
            }
            TempData["MensajeClase"] = "alert-success";
            TempData["Mensaje"]      = "Cambios guardados correctamente.";
            return(Json(true));
        }
        private void btnAddItem_Click(object sender, EventArgs e)
        {
            try
            {
                int codServ = Convert.ToInt32(cbxServico.SelectedValue);
                if (codServ < 1)
                {
                    throw new Exception("Selecione o serviço para adicionar!");
                }

                ServDetalheVO detalheVO = atendimento.servDetalhes.Find(obj => obj.CodServico == codServ);
                if (detalheVO != null)
                {
                    atendimento.servDetalhes.Remove(detalheVO);
                    detalheVO.Qtde++;
                    detalheVO.PrecoTotal = detalheVO.PrecoUnit * detalheVO.Qtde;
                    atendimento.servDetalhes.Add(detalheVO);
                    dataGridView1.DataSource = atendimento.servDetalhes;
                    dataGridView1.Refresh();
                    return;
                }

                ServicoVO aux = new ServicoDAO().Consulta(codServ) as ServicoVO;
                detalheVO            = new ServDetalheVO();
                detalheVO.CodServico = aux.Id;
                detalheVO.Nome       = aux.Nome;
                detalheVO.PrecoUnit  = aux.Preco;
                detalheVO.Qtde       = 1;
                detalheVO.PrecoTotal = detalheVO.PrecoUnit * detalheVO.Qtde;
                atendimento.servDetalhes.Add(detalheVO);
                dataGridView1.DataSource = atendimento.servDetalhes;
            }
            catch (FormatException)
            {
                Metodos.Mensagem("Campo numérico inválido!", TipoMsgEnum.Erro);
            }
            catch (SqlException)
            {
                Metodos.Mensagem("Ocorreu um erro no banco de dados.", TipoMsgEnum.Erro);
            }
            catch (Exception erro)
            {
                Metodos.Mensagem(erro.Message, TipoMsgEnum.Erro);
            }
        }
Exemple #9
0
        //===================================================================================================================================================
        //===================================================================================================================================================
        //FUNCION USADA PARA LA VERIFICACION DE LA CONTRASEÑA CUANDO EL USUARIO DEJE DE INTERACTUAR CON EL OBJETO "entryPassword"
        private void UnFocusedPassword(object sender, EventArgs e)
        {
            //SE VUELVE A ACTIVAR LA VISTA COMO PASSWORD
            entryPassword.IsPassword = true;

            //SE VERIFICA SI LA CONTRASEÑA ES LA MISMA QUE EXISTE ACTUALMENTE
            if (ConexionDatos.flagsamePassword)
            {
                //DE SER LA MISMA CONTRASEÑA SE GENERA UNA PREGUNTA AL USUARIO PARA
                //NOTIFICARLE SI DEASEA CONTINUAR CON LA MISMA CONTRASEÑA O DESEA CAMBIARLA
                ConexionDatos.MensajePantalla(ConexionDatos.OnCompletedPasswordSamePassword);
            }
            else
            {
                //SI LA CONTRASEÑA ES DISTINTA, SE PROCEDE A VERIFICAR QUE LA NUEVA CONTRASEÑA
                //CUMPLA CON LOS REQUISITOS MINIMOS ESTABLECIDOS

                //VERIFICACION DE CARACTERES NO PERMITIDOS
                if (Metodos.Caracteres(ConexionDatos.Password)) //true => Existen los caracteres no permitidos
                {
                    //SE CAMBIA EL COLOR DEL TEXTO A ROJO
                    entryPassword.TextColor = Color.Red;
                    //SE LE NOTIFICA AL USUARIO
                    ConexionDatos.MensajePantalla(ConexionDatos.ForbiddenCharacters);
                }
                else
                {
                    //SE DEJA EL COLOR DEL TEXTO EN ROJO
                    entryPassword.TextColor = Color.Black;
                }

                //VERIFICACION DE ESPACIOS EN BLANCO
                if (Metodos.EspacioBlanco(ConexionDatos.Password))
                {
                    //SE CAMBIA EL COLOR DEL TEXTO A ROJO
                    entryPassword.TextColor = Color.Red;
                    //SE LE NOTIFICA AL USUARIO
                    ConexionDatos.MensajePantalla(ConexionDatos.OnCompletePasswordWhiteSpace);
                }
                else
                {
                    entryPassword.TextColor = Color.Black;
                }
            }
        }
        public void Insertar(EOrdenServicio orden, int[] idservicios)
        {
            SqlCommand   comando = Metodos.CrearComando();
            const string query   = "INSERT INTO orden_servicio VALUES (@numero_orden,@fecha_elaboracion,@fecha_aprobacion,@fecha_compromiso,@concepto,@autor_order,@responsable,@vehiculo,"
                                   + "@dias_credito, @estatus, @utilidad, @cliente)";

            comando.CommandText = query;
            comando.Parameters.AddWithValue("@numero_orden", orden.NumeroOrden);
            comando.Parameters.AddWithValue("@fecha_elaboracion", orden.FechaElaboracion);

            if (orden.FechaAprobacion == DateTime.MinValue)
            {
                comando.Parameters.AddWithValue("@fecha_aprobacion", DBNull.Value);
            }
            else
            {
                comando.Parameters.AddWithValue("@fecha_aprobacion", orden.FechaAprobacion);
            }

            if (orden.FechaCompromiso == DateTime.MinValue)
            {
                comando.Parameters.AddWithValue("@fecha_compromiso", DBNull.Value);
            }
            else
            {
                comando.Parameters.AddWithValue("@fecha_compromiso", orden.FechaCompromiso);
            }


            comando.Parameters.AddWithValue("@concepto", orden.Concepto);
            comando.Parameters.AddWithValue("@autor_order", orden.AutorOrder);
            comando.Parameters.AddWithValue("@responsable", orden.Responsable);
            comando.Parameters.AddWithValue("@vehiculo", orden.Vehiculo);
            comando.Parameters.AddWithValue("@dias_credito", orden.DiasCredito);
            comando.Parameters.AddWithValue("@estatus", orden.Estatus);
            comando.Parameters.AddWithValue("@utilidad", orden.Utilidad);
            comando.Parameters.AddWithValue("@cliente", orden.Cliente);
            Metodos.EjecutarComando(comando);
            var maxId = TraerIdMaximo();

            foreach (var idServicio in idservicios)
            {
                LigarServicios(maxId, idServicio);
            }
        }
        public object ObtenerPorId(int idEmpleado)
        {
            SqlCommand comando = Metodos.CrearComando();

            comando.CommandText = "SELECT* FROM Empleado WHERE id_empleado = " + idEmpleado;
            DataTable tabla = Metodos.EjecutarComandoSelect(comando);

            if (tabla.Rows.Count <= 0)
            {
                return(null);
            }
            var       row      = tabla.Rows[0];
            EEmpleado empleado = new EEmpleado();

            empleado.Id                = Convert.ToInt32(row["id_empleado"]);
            empleado.Nombre            = Convert.ToString(row["nombre"]);
            empleado.Apellido          = Convert.ToString(row["apellido"]);
            empleado.Telefono          = Convert.ToString(row["telefono"]);
            empleado.Direccion         = Convert.ToString(row["direccion"]);
            empleado.Puesto            = Convert.ToString(row["puesto"]);
            empleado.Estatus           = Convert.ToInt32(row["estatus"]);
            empleado.NombreUsuario     = Convert.ToString(row["nombre_usuario"]);
            empleado.Contrasena        = Convert.ToString(row["contrasena"]);
            empleado.NumeroEmpleado    = Convert.ToString(row["numero_empleado"]);
            empleado.Rfc               = Convert.ToString(row["rfc"]);
            empleado.Estatura          = Convert.ToString(row["estatura"]);
            empleado.Peso              = Convert.IsDBNull(row["peso"]) ? 0 : Convert.ToInt32(row["peso"]);
            empleado.Referencia        = Convert.ToString(row["referencia"]);
            empleado.ContactoPersonal  = Convert.ToString(row["contacto_personal"]);
            empleado.TipoSangre        = Convert.ToString(row["tipo_sangre"]);
            empleado.FechaContratacion = Convert.IsDBNull(row["fecha_contratacion"]) ? DateTime.MinValue : Convert.ToDateTime(row["fecha_contratacion"]);
            empleado.FechaTerminacion  = Convert.IsDBNull(row["fecha_terminacion"]) ? DateTime.MinValue : Convert.ToDateTime(row["fecha_terminacion"]);
            empleado.FechaNacimiento   = Convert.IsDBNull(row["fecha_nacimiento"]) ? DateTime.MinValue : Convert.ToDateTime(row["fecha_nacimiento"]);
            empleado.Genero            = Convert.IsDBNull(row["genero"]) ? 'N' : Convert.ToChar(row["genero"]);
            empleado.Departamento      = Convert.IsDBNull(row["departamento"]) ? 0 : Convert.ToInt32(row["departamento"]);
            empleado.Administrador     = Convert.IsDBNull(row["administrador"]) ? 0 : Convert.ToInt32(row["administrador"]);
            empleado.Calle             = row["calle"].ToString();
            empleado.Colonia           = row["colonia"].ToString();
            empleado.Ciudad            = row["ciudad"].ToString();
            empleado.CodigoPostal      = Convert.IsDBNull(row["codigo_postal"]) ? 0 : Convert.ToInt32(row["codigo_postal"]);
            empleado.Curp              = row["curp"].ToString();
            empleado.NumeroAfiliacion  = row["numero_afiliacion"].ToString();
            empleado.CreditoInfonavit  = row["credito_infonavit"].ToString();
            return(empleado);
        }
Exemple #12
0
 private void LlenaCombos()
 {
     try
     {
         Metodos.LlenaComboCatalogo(ddlTipoInformacion,
                                    _servicioCatalogosSistema.ObtenerTipoInformacionConsulta(true));
         Metodos.LlenaComboCatalogo(ddlTipoDocumento, _servicioSistemaTipoDocumento.ObtenerTipoDocumentos(true));
     }
     catch (Exception ex)
     {
         if (_lstError == null)
         {
             _lstError = new List <string>();
         }
         _lstError.Add(ex.Message);
         AlertaGeneral = _lstError;
     }
 }
Exemple #13
0
        //===============================================================================================================================
        //===============================================================================================================================
        //METODO PARA VERIFICAR QUE usernameEntry NO TENGA ESPACIOS EN BLANCO Y QUE NO TENGA LOS CARACTERES NO PERMITIDOS
        private async void OnCompletedUserName(object sender, EventArgs e)
        {
            //BUSQUEDA DE ESPACIOS EN BLANCO

            if (Metodos.EspacioBlanco(ConexionDatos.Username.ToLower()))
            {
                usernameEntry.TextColor = Color.Red;
                await DisplayAlert("Alerta", "El nombre de usuario no puede contener espacios en blanco", "Entendido");
            }

            //BUSQUEDA DE CARACTERES

            if (Metodos.Caracteres(ConexionDatos.Username.ToLower()))
            {
                usernameEntry.TextColor = Color.Red;
                await DisplayAlert("Alerta", "No se aceptan los siguientes caracteres: '!', '@', '#', '$', '%', '&', '(', ')', '+', '=', '/', '|'", "Entendido");
            }
        }
Exemple #14
0
        public static List <ConsulMedicaVO> RetornaConsultasPorFiltros(int idAnimal, int idVeterinario, DateTime dataConsulta) //alterar
        {
            SqlParameter[] p =
            {
                new SqlParameter("", idAnimal),
                new SqlParameter("", idVeterinario),
                new SqlParameter("", dataConsulta)
            };
            DataTable             tabela = Metodos.ExecutaProcResultSet("", p);
            List <ConsulMedicaVO> lista  = new List <ConsulMedicaVO>();

            foreach (DataRow registro in tabela.Rows)
            {
                lista.Add(MontaConsultaMedicaVO(registro));
            }

            return(lista);
        }
Exemple #15
0
 protected void initPage()
 {
     this.jogonline   = Metodos.getJogos();
     this.destaque    = Metodos.getJogosDestaque();
     this.recomendado = Metodos.getJogosRecomendados();
     if (Session["id"] != null)
     {
         if (Metodos.hasUser(Session["id"].ToString() ?? ""))
         {
             this.user = Metodos.getUser(Session["id"].ToString());
             this.icon = Metodos.getIcone(this.user.Icone_id);
         }
     }
     else
     {
         Response.Redirect("~/Public/Login.aspx");
     }
 }
Exemple #16
0
 protected void initPage()
 {
     if (Session["id"] != null)
     {
         if (Metodos.hasUser(Session["id"].ToString() ?? ""))
         {
             this.user  = Metodos.getUser(Session["id"].ToString());
             this.icon  = Metodos.getIcone(this.user.Icone_id);
             this.cats  = DAL.DALCategories.SelectAll();
             this.jogos = DAL.DALGames.SelectAll();
             this.jogos = DAL.DALGames.SelectAll();
         }
     }
     else
     {
         Response.Redirect("~/Public/Login.aspx");
     }
 }
Exemple #17
0
 private void LimpiarCampos()
 {
     try
     {
         txtNombreCatalogo.Text      = String.Empty;
         txtDescripcionCatalogo.Text = string.Empty;
         Metodos.LimpiarRadioList(rbtnHojas);
         Session["registrosCatalogos"] = new List <CatalogoGenerico>();
         Session["ArchivoCarga"]       = null;
         rbtnManual.Checked            = false;
         rbtnArchivo.Checked           = false;
         LlenaRegistros();
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message);
     }
 }
        public ActionResult NuevaContra()
        {
            Metodos m       = new Metodos();
            string  pass    = Request.Form["pass"].ToString();
            string  usuario = "";
            string  mjs     = "";

            if (TempData["usuario"] != null)
            {
                usuario = TempData["usuario"] as string;
            }

            //actualizar contraseña
            mjs = m.Contra(usuario, pass);
            TempData.Keep();

            return(View("~/Views/Home/Index.cshtml"));
        }
        private void ResolverRF(object sender, RoutedEventArgs e)
        {
            ResultadoRaizCerrados resultado = new ResultadoRaizCerrados(Convert.ToInt32(iteraciones_textbox_reglafalsa.Text), Convert.ToDouble(tolerancia_textbox_reglafalsa.Text));

            resultado.XI = Convert.ToDouble(Xi_textbox_reglafalsa.Text);
            resultado.XD = Convert.ToDouble(Xd_textbox_reglafalsa.Text);
            Function f       = new Function("f(x) = " + fx_reglafalsa_textbox.Text);
            var      Metodos = new Metodos();

            Metodos.ReglaFalsa(resultado, f);

            Resultado_label_reglafalsa.Content         = "Raíz: " + resultado.valorRaiz;
            ResultadoError_label_reglafalsa.Content    = "Error: " + resultado.error;
            iterusadas_rf_label.Content                = "Iteraciones: " + resultado.iteraciones;
            Resultado_label_reglafalsa.Visibility      = Visibility.Visible;
            ResultadoError_label_reglafalsa.Visibility = Visibility.Visible;
            iterusadas_rf_label.Visibility             = Visibility.Visible;
        }
        private void Resolver_Tangente_Click(object sender, RoutedEventArgs e)
        {
            ResultadoRaizAbiertos resultado = new ResultadoRaizAbiertos(Convert.ToInt32(iteraciones_tan_textbox.Text), Convert.ToDouble(error_tan_textbox.Text));

            resultado.Xini = Convert.ToDouble(xini_textbox.Text);

            Function f       = new Function("f(x) = " + fx_tan_textbox.Text);
            var      Metodos = new Metodos();

            Metodos.Tangente(resultado, f);

            Resultado_label_tan.Content         = "Raíz: " + resultado.valorRaiz;
            ResultadoError_label_tan.Content    = "Error: " + resultado.error;
            iterusadas_tan_label.Content        = "Iteraciones: " + resultado.iteraciones;
            Resultado_label_tan.Visibility      = Visibility.Visible;
            ResultadoError_label_tan.Visibility = Visibility.Visible;
            iterusadas_tan_label.Visibility     = Visibility.Visible;
        }
Exemple #21
0
        public ActionResult Activar(EventoRegistroEmpresaModel model)
        {
            string _modId          = Session["modId"].ToString();
            long   modId           = long.Parse(_modId);
            int    IdTipoDocumento = int.Parse(_modId.Substring(0, (_modId.Length == 7 ? 1 : 2)));

            long IdModulo = IdTipoDocumento * 1000000;

            model.IdModulo       = IdModulo;
            model.IdModuloActual = modId;
            model.Perfil         = Metodos.GetPerfilData();
            model.PageTitle      = Metodos.GetModuloName(modId);
            model.Dispositivos   = Metodos.GetDispositivosMovilEvento(model.IdSubmoduloSelected);

            ViewBag.SelectAllCheckBoxMode = (model.Dispositivos.Count(x => x.FechaEnvio == null) == 0 ? GridViewSelectAllCheckBoxMode.None : GridViewSelectAllCheckBoxMode.AllPages);
            ViewBag.Title = string.Format("{0} - {1}", model.PageTitle, Resources.BCMWebPublic.labelAppTitle);
            return(View(model));
        }
Exemple #22
0
        private void btnExcluir_Click(object sender, EventArgs e)
        {
            if (!Metodos.Mensagem("Tem certeza que quer excluir esse registro?", TipoMsgEnum.Exclusao))
            {
                return;
            }

            try
            {
                objetoDAO.Excluir(Convert.ToInt32(txtId.Text));
                LimpaCampos(this);
                btnPrimeiro.PerformClick();
            }
            catch (Exception ex)
            {
                TrataErro(ex);
            }
        }
Exemple #23
0
 private void btnExcluir_Click(object sender, EventArgs e)
 {
     if (!Metodos.Mensagem("Confirma?", TipoMensagemEnum.pergunta))
     {
         return;
     }
     try
     {
         AnimalVO animal = RetornaObjetoAnimal();
         AniDAO.Manipulacao(animal, "d");
         btnPrimeiro.PerformClick();
         AlteraParaModo(EnumModoOperacao.Navegacao);
     }
     catch (Exception erro)
     {
         TrataErro(erro);
     }
 }
        protected void BuscarLinkButton_Click(object sender, EventArgs e)
        {
            RepositorioFactura repositorio = new RepositorioFactura();

            var factura = repositorio.Buscar(Utils.ToInt(facturaIdTextBox.Text));

            lista = Metodos.ListaDetalle(Utils.ToInt(facturaIdTextBox.Text));
            if (factura != null)
            {
                Utils.ShowToastr(this, "Busqueda exitosa", "Exito", "success");
                LlenarCampos(factura);
            }
            else
            {
                LimpiaObjetos();
                Utils.ShowToastr(this, "No existe la Factura especificada", "Error", "error");
            }
        }
Exemple #25
0
    public void GenerarMapa()
    {
        //limpiamos el mapa de losetas
        MapaDeLosetas.ClearAllTiles();
        //creamos el array bidimensional del mapa
        int[,] mapa = null;
        //generamos una semilla nueva aleatoria
        if (SemillaAleatoria)
        {
            Semilla = Random.Range(0f, 1000f);
        }

        switch (algoritmo)
        {
        case Algoritmo.PerlinNoise:
            mapa = Metodos.GenerarArray(Ancho, Alto, true);
            mapa = Metodos.PerlinNoise(mapa, Semilla);
            break;

        case Algoritmo.PerlinNoiseSuavizado:
            mapa = Metodos.GenerarArray(Ancho, Alto, true);
            mapa = Metodos.PerlinNoiseSuavizado(mapa, Semilla, Intervalo);
            break;

        case Algoritmo.RandomWalk:
            mapa = Metodos.GenerarArray(Ancho, Alto, true);
            mapa = Metodos.RandomWalk(mapa, Semilla);
            break;

        case Algoritmo.RandomWalkSuavizado:
            mapa = Metodos.GenerarArray(Ancho, Alto, true);
            mapa = Metodos.RandomWalkSuavizado(mapa, Semilla, MinimoAnchoSeccion);
            break;

        case Algoritmo.PerlinNoiseCueva:
            mapa = Metodos.GenerarArray(Ancho, Alto, false);
            mapa = Metodos.PerlinNoiseCueva(mapa, Modificador, LosBordeSonMuros, OffSetX, OffSetY, Semilla);
            break;
        }

        Metodos.GenerarMapa(mapa, MapaDeLosetas, Loseta);
        //= Metodos.GenerarArray(Ancho, Alto, false);
        //Metodos.GenerarMapa(mapa, MapaDeLosetas, Loseta);
    }
Exemple #26
0
 protected void btnCrearCampus_OnClick(object sender, EventArgs e)
 {
     try
     {
         if (Metodos.ValidaCapturaCatalogoCampus(Convert.ToInt32(ddlTipoUsuarioCampus.SelectedValue), txtDescripcionCampus.Text, ddlColonia.SelectedValue == "" ? 0 : Convert.ToInt32(ddlColonia.SelectedValue), txtCalle.Text.Trim(), txtNoExt.Text.Trim(), txtNoInt.Text.Trim()))
         {
             Ubicacion ubicacion = new Ubicacion
             {
                 IdTipoUsuario = IdTipoUsuario,
                 IdPais        = Convert.ToInt32(ddlpais.SelectedValue),
                 Campus        = new Campus
                 {
                     IdTipoUsuario = Convert.ToInt32(ddlTipoUsuarioCampus.SelectedValue),
                     Descripcion   = txtDescripcionCampus.Text.Trim(),
                     Domicilio     = new List <Domicilio>
                     {
                         new Domicilio
                         {
                             IdColonia = Convert.ToInt32(ddlColonia.SelectedValue),
                             Calle     = txtCalle.Text.Trim(),
                             NoExt     = txtNoExt.Text.Trim(),
                             NoInt     = txtNoInt.Text.Trim()
                         }
                     },
                     Habilitado = chkHabilitado.Checked
                 }
             };
             _servicioUbicacion.GuardarUbicacion(ubicacion);
             LimpiaCampus();
             ddlpais_OnSelectedIndexChanged(ddlpais, null);
             LlenaUbicaciones();
             ScriptManager.RegisterClientScriptBlock(Page, typeof(Page), "Script", "CierraPopup(\"#editCampus\");", true);
         }
     }
     catch (Exception ex)
     {
         if (_lstError == null)
         {
             _lstError = new List <string>();
         }
         _lstError.Add(ex.Message);
         AlertaCampus = _lstError;
     }
 }
Exemple #27
0
        public void LimpiarPantalla()
        {
            try
            {
                //Step 1
                ddlNivel1_OnSelectedIndexChanged(ddlNivel1, null);
                ddlTipoUsuario.SelectedIndex = BusinessVariables.ComboBoxCatalogo.IndexSeleccione;
                txtTitulo.Text            = string.Empty;
                txtDescripcionOpcion.Text = string.Empty;
                LlenaCombos();
                chkPublico.Checked         = false;
                chkEvaluacion.Checked      = true;
                chkNivelHabilitado.Checked = true;
                Metodos.LimpiarCombo(ddlNivel1);
                Metodos.LimpiarCombo(ddlNivel2);
                Metodos.LimpiarCombo(ddlNivel3);
                Metodos.LimpiarCombo(ddlNivel4);
                Metodos.LimpiarCombo(ddlNivel5);
                Metodos.LimpiarCombo(ddlNivel6);

                //Step 2
                txtDescripcionCategoria.Text = string.Empty;
                txtDescripcionN1.Text        = string.Empty;
                txtDescripcionN2.Text        = string.Empty;
                txtDescripcionN3.Text        = string.Empty;
                txtDescripcionN4.Text        = string.Empty;
                txtDescripcionN5.Text        = string.Empty;
                txtDescripcionN6.Text        = string.Empty;
                Metodos.LimpiarCombo(ddlCategoria);
                Metodos.LimpiarCombo(ddlNivel1);
                divNivel2.Visible = false;
                divNivel3.Visible = false;
                divNivel4.Visible = false;
                divNivel5.Visible = false;
                divNivel6.Visible = false;
                Metodos.LimpiarCombo(ddlGrupoAccesoCentroSoporte);
                Metodos.LimpiarCombo(ddlGrupoResponsableCategoria);
                Metodos.LimpiarCombo(ddlGrupoResponsableContenido);
            }
            catch (Exception e)
            {
                throw new Exception(e.Message);
            }
        }
Exemple #28
0
        private void GetMateriaChamada()
        {
            Label lb = GetLabelDefaul();

            ConsumeRest getChamada = new ConsumeRest();

            string parametros = string.Format("alunoId={0}", usuario.Id);

            getChamada.GetResponse <Retorno>("alunoChamada/GetChamadaAberta", parametros).ContinueWith(t =>
            {
                if (t.IsCompleted)
                {
                    Device.BeginInvokeOnMainThread(() =>
                    {
                        Retorno obj;

                        if (t.Result is Retorno)
                        {
                            obj = (Retorno)t.Result;

                            if ((TpRetornoEnum)obj.TpRetorno == TpRetornoEnum.Sucesso && obj.ObjRetorno != null)
                            {
                                if (obj.ObjTypeName == typeof(ChamadaForPresencaVO).Name)
                                {
                                    chamada = Metodos.JsonToCustomObject <ChamadaForPresencaVO>(obj.ObjRetorno);
                                }

                                dadosChamada.BackgroundColor = Color.FromHex("328325");
                                GetDadosChamada(chamada);
                            }
                            else if ((TpRetornoEnum)obj.TpRetorno == TpRetornoEnum.Erro)
                            {
                                dadosChamada.BackgroundColor = Color.FromHex("A63030");
                            }

                            lb.Text = obj.RetornoMensagem + ((!string.IsNullOrWhiteSpace(obj.RetornoDescricao)) ?
                                                             (Environment.NewLine + obj.RetornoDescricao) : "");
                            dadosChamada.IsVisible = true;
                            dadosChamada.Content   = lb;
                        }
                    });
                }
            });
        }
Exemple #29
0
        public ActionResult Index(Usuario usuario)
        {
            if (FormsAuthentication.Authenticate(usuario.Usuario1, usuario.Contrasena))
            {
                FormsAuthentication.SetAuthCookie(usuario.Usuario1, false);
                Metodos.RegistrarLog(new Log
                {
                    Modulo  = "Acceso",
                    Accion  = "Ingresar",
                    Detalle = "Acceso exitoso"
                });
                return(RedirectToAction("Index", "Home"));
            }
            var us = db.Usuario.Where(u => u.Usuario1 == usuario.Usuario1 && u.Estatus == "A").Any();

            if (us)
            {
                ICA.ServiceReferenceUsuarios.LoginClient servicio = new ICA.ServiceReferenceUsuarios.LoginClient();
                var respuesta = servicio.Autenticar(usuario.Usuario1, usuario.Contrasena);
                if (respuesta.EsValido)
                {
                    FormsAuthentication.SetAuthCookie(usuario.Usuario1, false);
                    Metodos.RegistrarLog(new Log
                    {
                        Modulo  = "Acceso",
                        Accion  = "Ingresar",
                        Detalle = "Acceso exitoso"
                    });
                    return(RedirectToAction("Index", "Home"));
                }
            }

            ViewBag.Mensaje = "El usuario no tiene permitido ingresar a la aplicación, favor de contactar al administrador.";
            ViewBag.Usuario = usuario.Usuario1;
            Metodos.RegistrarLog(new Log
            {
                Modulo     = "Acceso",
                Accion     = "Ingresar",
                Detalle    = "Acceso fallido",
                MUsuarioId = usuario.Usuario1
            });

            return(View(usuario));
        }
Exemple #30
0
        private string enviarCorreo(string corre, string curp)
        {
            string password  = Metodos.generatePassword(6);
            string subject   = "Recuperación de contraseña";
            string contenido = "";

            contenido += "<center>";
            contenido += "<h4>";
            contenido += "Recuperación de contraseña, su curp:<br>";
            contenido += "<b>" + curp + "</b><br>";
            contenido += "Ha solicitado una nueva contraseña<br>";
            contenido += "Para countinuar, acceda en la siguiente página:<br><br>";
            contenido += "<a href='http://tabletasube.itleon.edu.mx/'  target='_blank'>http://tabletasube.itleon.edu.mx/</a><br>";
            contenido += "<br>con la siguiente contraseña: ";
            contenido += "<strong>";
            contenido += password;
            contenido += "</strong></h4>";
            contenido += "</center>";
            Conexion con       = new Conexion();
            string   campos    = "password='******', estatus ='E'";
            string   condicion = "curp = '" + curp + "'";

            password = password.Replace("'", "");
            curp     = curp.Replace("'", "");

            objHomeTrans.cambiaUsuarioEspera(curp, password);

            if (true)//con.actualizarcorreo(password,curp)
            {
                // //("Se generó la contraseña correctamente");
            }
            else
            {
                return("Algo extraño sucedió y no pudimos generar tu contraseña, vuelva a intentarlo mas tarde");
            }
            if (Metodos.sendMail(contenido, corre, subject))
            {
                return("Se ha enviado un correo con su contraseña");
            }
            else
            {
                return("Algo extraño sucedió, vuelva a intentarlo mas tarde");
            }
        }
    protected void ButtonConsultar_Click(object sender, EventArgs e)
    {
        LabelErroCupom.Text = string.Empty;
        LabelErroNome.Text = string.Empty;
        bool erro = false;

        if (TextNome.Text != string.Empty || TextCupom.Text != string.Empty)
        {
            Metodos method = new Metodos();
            if (!method.validaUsuario(TextNome.Text))
            {
                LabelErroNome.Text = "Usuário não existe na base!";
                erro = true;
            }

            if (!method.validaQtdeCaracterCupom(TextCupom.Text))
            {
                LabelErroCupom.Text = "Cupom incorreto, faltam números!";
                erro = true;
            }
            else if (!method.validaDigitoVerificador(TextCupom.Text.Replace("-", string.Empty)))
            {
                LabelErroCupom.Text = "Dígito verificador incorreto!";
                erro = true;
            }
            else if (!method.validaQuantidadePontos(TextCupom.Text.Replace("-", string.Empty)))
            {
                LabelErroCupom.Text = "Cupom com valores incorretos!";
                erro = true;
            }

            if (!erro)
                MensagemUsuario.Mostrar(Controles_MensagemUsuario.Tipo.Sucesso, ("Parabêns " + TextNome.Text + ", você tem acumulados " +
                    method.quantidadePontos(TextCupom.Text.Replace("-", string.Empty)) + " potz para gastar como quiser em qualquer um dos estabelecimentos no mundo que aceitam o Potz."));
        }
    }