Example #1
0
    private void CargarProyectos()
    {
        try
        {
            //Accedemos a la clase de negocio
            Proyectos proyecto = new Proyectos();
            Utilidades objUtils = new Utilidades();

            //Recogemos el nombre del patrocinador
            string titulo = string.Empty;

            if (this.txtBuscador.Text != string.Empty)
                titulo = "%" + this.txtBuscador.Text + "%";
            else
                titulo = "%";

            //Obtengo los proyectos
            DataSet ds = new DataSet();
            ds = proyecto.dameProyectos(titulo,2);

            //Si todo correcto, mostramos los datos en el Grid
            if (ds.Tables["DATOS"].Rows.Count > 0)
            {
                //Mostramos los resultados obtenidos
                objUtils.cargarDatos(ds, rpProyectos);
            }
            else
                objUtils.cargarDatos(null, rpProyectos);

            //Si todo correcto, mostramos los datos en el Grid
            if (ds.Tables["DATOS"].Rows.Count > 0)
            {
                //Mostramos los resultados obtenidos
                objUtils.cargarDatos(ds, rpContenido);
            }
            else
                objUtils.cargarDatos(null, rpContenido);

        }
        catch (Exception e) { string resultado = e.Message; }
    }
    private void CargarProyectos()
    {
        try
        {
            //Accedemos a la clase de negocio
            Proyectos proyecto = new Proyectos();
            Utilidades objUtils = new Utilidades();

            //Obtengo los proyectos
            DataSet ds = new DataSet();
            ds = proyecto.dameProyectos("%", 2);

            //Si todo correcto, mostramos los datos en el Grid
            if (ds.Tables["DATOS"].Rows.Count > 0)
            {
                //Mostramos los resultados obtenidos
                objUtils.cargarDatos(ds, rpProyectos);
            }
            else
                objUtils.cargarDatos(null, rpProyectos);

        }
        catch (Exception e) { string resultado = e.Message; }
    }
Example #3
0
        public static string CatalogoById(int t391_idsupernodo1)
        {
            StringBuilder sb = new StringBuilder();

            sb.Append("<table id='tblAlertas' class='texto MANO' style='width:930px;' mantenimiento='1'>");
            sb.Append("<colgroup><col style='width:30px'/><col style='width:210px'/><col style='width:165px'/><col style='width:65px'/><col style='width:165px'/><col style='width:65px'/><col style='width:165px'/><col style='width:65px'/></colgroup>");
            sb.Append("<tbody>");

            SqlDataReader dr = SUPER.DAL.SN1Alertas.CatalogoById(null, t391_idsupernodo1);

            while (dr.Read())
            {
                sb.Append("<tr id=" + dr["t825_idsn1alertas"].ToString());
                sb.Append(" bd='N' onclick='ms(this)' onkeyup='fm(event); aG(3)' style='height:20px;'>");

                sb.Append("<td style='text-align:right;padding-right:3px'>" + dr["t820_idalerta"].ToString() + "</td>");
                sb.Append("<td style='padding-left:3px;' class='tdcol'><nobr class='NBR W210' onmouseover='TTip(event)'>" + dr["t820_denominacion"].ToString() + "</nobr></td>");
                sb.Append("<td style='padding-left:2px;'><nobr class='NBR W160' onmouseover='TTip(event)'>" + dr["t820_parametro1"].ToString() + "</nobr></td>");
                if (dr["t820_parametro1"].ToString() == "")
                {
                    sb.Append("<td class='tdcol'></td>");
                }
                else
                {
                    sb.Append("<td class='tdcol'><input type='text' class='txtNumL' SkinID='Numero' onkeypress='vtn(event);' onfocus='fn(this,8,0)' style='width:55px' value='" + Utilidades.getInt(dr["t825_parametro1"].ToString()) + "' maxlength='8'></td>");
                }
                sb.Append("<td style='padding-left:2px;'><nobr class='NBR W160' onmouseover='TTip(event)'>" + dr["t820_parametro2"].ToString() + "</nobr></td>");
                if (dr["t820_parametro2"].ToString() == "")
                {
                    sb.Append("<td class='tdcol'></td>");
                }
                else
                {
                    sb.Append("<td class='tdcol'><input type='text' class='txtNumL' SkinID='Numero' onkeypress='vtn(event);' onfocus='fn(this,8,0)' style='width:55px' value='" + Utilidades.getInt(dr["t825_parametro2"].ToString()) + "' maxlength='8'></td>");
                }
                sb.Append("<td style='padding-left:2px;'><nobr class='NBR W160' onmouseover='TTip(event)'>" + dr["t820_parametro3"].ToString() + "</nobr></td>");
                if (dr["t820_parametro3"].ToString() == "")
                {
                    sb.Append("<td class='tdcol'></td>");
                }
                else
                {
                    sb.Append("<td class='tdcol'><input type='text' class='txtNumL' SkinID='Numero' onkeypress='vtn(event);' onfocus='fn(this,8,0)' style='width:55px' value='" + Utilidades.getInt(dr["t825_parametro3"].ToString()) + "' maxlength='8'></td>");
                }
                sb.Append("</tr>");
            }
            dr.Close();
            dr.Dispose();
            sb.Append("</tbody>");
            sb.Append("</table>");

            return(sb.ToString());
        }
    private string setPreferencia(string sCategoria, string sCualidad, string sOpcionPeriodo,
                                  string sOperadorLogico, string sFormato, string sValoresMultiples)
    {
        string sResul = "";

        #region abrir conexión y transacción
        try
        {
            oConn = Conexion.Abrir();
            tr    = Conexion.AbrirTransaccionSerializable(oConn);
        }
        catch (Exception ex)
        {
            if (oConn.State == ConnectionState.Open)
            {
                Conexion.Cerrar(oConn);
            }
            sResul = "Error@#@" + Errores.mostrarError("Error al abrir la conexión", ex);
            return(sResul);
        }
        #endregion

        try
        {
            int nPref = PREFERENCIAUSUARIO.Insertar(tr,
                                                    (int)Session["IDFICEPI_PC_ACTUAL"],
                                                    19,
                                                    (sFormato == "") ? null : sFormato,
                                                    (sCategoria == "") ? null : sCategoria,
                                                    (sCualidad == "") ? null : sCualidad,
                                                    (sOperadorLogico == "") ? null : sOperadorLogico,
                                                    (sOpcionPeriodo == "") ? null : sOpcionPeriodo,
                                                    null,
                                                    null,
                                                    null,
                                                    null,
                                                    null,
                                                    null,
                                                    null,
                                                    null,
                                                    null,
                                                    null, null, null, null, null, null, null);

            #region Valores Múltiples
            if (sValoresMultiples != "")
            {
                string[] aValores = Regex.Split(sValoresMultiples, "///");
                foreach (string oValor in aValores)
                {
                    if (oValor == "")
                    {
                        continue;
                    }
                    string[] aDatos = Regex.Split(oValor, "##");
                    ///aDatos[0] = concepto
                    ///aDatos[1] = idValor
                    ///aDatos[2] = denominacion

                    PREFUSUMULTIVALOR.Insertar(tr, nPref, byte.Parse(aDatos[0]), aDatos[1], Utilidades.unescape(aDatos[2]));
                }
            }

            #endregion

            Conexion.CommitTransaccion(tr);

            sResul = "OK@#@" + nPref.ToString();
        }
        catch (Exception ex)
        {
            Conexion.CerrarTransaccion(tr);
            sResul = "Error@#@" + Errores.mostrarError("Error al guardar la preferencia.", ex);
        }
        finally
        {
            Conexion.Cerrar(oConn);
        }
        return(sResul);
    }
    private string cargarCriterios(int nDesde, int nHasta)
    {
        StringBuilder sb = new StringBuilder();
        int           i  = 0;

        try
        {
            /*
             * t -> tipo
             * c -> codigo
             * d -> denominacion
             * ///datos auxiliares para el catálogo de proyecto (16)
             * a -> categoria
             * u -> cualidad
             * e -> estado
             * l -> cliente
             * n -> nodo
             * r -> responsable
             * */
            SqlDataReader dr = ConsultasPGE.ObtenerDatosConsumosProveedCriterios((int)Session["UsuarioActual"], nDesde, nHasta, Constantes.nNumElementosMaxCriterios);
            while (dr.Read())
            {
                if ((int)dr["codigo"] == -1)
                {
                    sb.Append("\tjs_cri[" + i + "] = {\"t\":" + dr["tipo"].ToString() + ",\"excede\":1};\n");
                }
                else
                {
                    if ((int)dr["tipo"] == 16)
                    {
                        sb.Append("\tjs_cri[" + i + "] = {\"t\":" + dr["tipo"].ToString() + ",\"c\":" + dr["codigo"].ToString() + ",\"d\":\"" + Utilidades.escape(dr["denominacion"].ToString().Replace((char)34, (char)39)) + "\",\"p\":\"" + dr["t301_idproyecto"].ToString() + "\",\"a\":\"" + dr["t301_categoria"].ToString() + "\",\"u\":\"" + dr["t305_cualidad"].ToString() + "\",\"e\":\"" + dr["t301_estado"].ToString() + "\",\"l\":\"" + dr["t302_denominacion"].ToString() + "\",\"n\":\"" + dr["t303_denominacion"].ToString() + "\",\"r\":\"" + dr["Responsable"].ToString() + "\"};\n");
                    }
                    else
                    {
                        sb.Append("\tjs_cri[" + i + "] = {\"t\":" + dr["tipo"].ToString() + ",\"c\":" + dr["codigo"].ToString() + ",\"d\":\"" + Utilidades.escape(dr["denominacion"].ToString().Replace((char)34, (char)39)) + "\"};\n");
                    }
                }
                i++;
            }
            dr.Close();
            dr.Dispose();

            return("OK@#@" + sb.ToString());
        }
        catch (Exception ex)
        {
            return("Error@#@" + Errores.mostrarError("Error al cargar los criterios", ex));
        }
    }
Example #6
0
        static void Main(string[] args)
        {
            Utilidades.EnviarCorreo();
// Mamifero
            Console.WriteLine("++++++++++++++++++++++++++++++++++++++++++++++++++");
            Console.WriteLine("******************** Mamifero ********************");
            Console.WriteLine("++++++++++++++++++++++++++++++++++++++++++++++++++");
            Perro p = new Perro();

            p.Nombre      = "Perro: Shepsky";
            p.Patas       = 4;
            p.EsDomestico = true;
            p.Comer();
            p.Caminar();
            p.Ladrar();
            p.Tamano();

            Console.WriteLine(p.Nombre);
            Console.WriteLine("Numero de patas:" + p.Patas);
            Console.WriteLine("");

            Gato g = new Gato("Gato: Chay", 4, "Si");

            g.Comer();
            g.Caminar();
            g.Maullar();

            Console.WriteLine(g.Nombre);
            Console.WriteLine("Numero de patas:" + g.Patas);
            Console.WriteLine("");

            Caballo c = new Caballo();

            c.Nombre = "Caballo: Shire";
            c.Patas  = 4;
            c.Melena = "Liso";
            c.Comer();
            c.Caminar();
            c.Relinchar();

            Console.WriteLine(g.Nombre);
            Console.WriteLine("Numero de patas:" + c.Patas);
            Console.WriteLine("");

            Mono m = new Mono();

            m.Nombre = "Mono: Kandti";
            m.Patas  = 4;
            m.Pelaje = "Negro y Cafe";
            m.Comer();
            m.Caminar();
            m.Maullar();

            Console.WriteLine(m.Nombre);
            Console.WriteLine("Numero de patas:" + m.Patas);
            Console.WriteLine("");
// AVES
            Console.WriteLine("++++++++++++++++++++++++++++++++++++++++++++++++++");
            Console.WriteLine("********************** Aves ********************* ");
            Console.WriteLine("++++++++++++++++++++++++++++++++++++++++++++++++++");

            Aguila a = new Aguila();

            a.Nombre  = "Aguila : Real";
            a.Plumaje = "Color  : Negro y Cafe";
            a.Comer();
            a.Volar();
            a.Tamano();

            Console.WriteLine(a.Nombre);
            Console.WriteLine(a.Plumaje);
            Console.WriteLine("");

            Loro l = new Loro();

            l.Nombre  = "Loro: Cacatúa";
            l.Plumaje = "Color: Blanco con Copo Verde";
            l.Comer();
            l.Hablar();
            l.Tamano();

            Console.WriteLine(l.Nombre);
            Console.WriteLine(l.Plumaje);
            Console.WriteLine("");

            Console.WriteLine("++++++++++++++++++++++++++++++++++++++++++++++++++");
            Console.WriteLine("********************* PECES **********************");
            Console.WriteLine("++++++++++++++++++++++++++++++++++++++++++++++++++");

            PezGlobo pg = new PezGlobo();

            pg.Nombre  = "Pez: Globo";
            pg.Escamas = "Color: Amarillo Con Negro ";
            pg.Aletas  = 3;

            pg.Defensa();
            pg.Tamano();

            Console.WriteLine(pg.Nombre);
            Console.WriteLine(pg.Escamas);
            Console.WriteLine("Numero de Aletas:" + pg.Aletas);
            Console.WriteLine("");

            PezDorado pd = new PezDorado();

            pd.Nombre  = "Pez: Dorado";
            pd.Escamas = "Color: Amarillo Oro ";
            pd.Aletas  = 5;
            pd.Tamano();

            Console.WriteLine(pd.Nombre);
            Console.WriteLine(pd.Escamas);
            Console.WriteLine("Numero de Aletas:" + pd.Aletas);
            Console.WriteLine("");
        }
 private void timer1_Tick(object sender, EventArgs e)
 {
     label_data.Text = Utilidades.obterData();
 }
        public UsuarioViewModel Create(UsuarioViewModel obj)
        {
            var verficadorCliente = (from c in entities.Clientes
                                     where c.TipoDocumento_id == obj.TipoDocumento_id && c.Identificacion == obj.Identificacion
                                     select c).Count();

            if (verficadorCliente <= 0)
            {
                Cliente entity = new Cliente();
                entity.DateCreated = DateTime.Now;
                var usuarioConectado = Utilidades.GetCurrentUser().Id;
                entity.IdCreatorby = usuarioConectado;
                bool nuevo = false;
                entity.Id                      = obj.Id;
                entity.TipoPersona_id          = obj.TipoPersona_id;
                entity.TipoDocumento_id        = obj.TipoDocumento_id;
                entity.Identificacion          = obj.Identificacion;
                entity.PrimerNombreRazonSocial = obj.PrimerNombres;
                entity.SegundoNombre           = obj.SegundoNombres;
                entity.PrimerApellido          = obj.PrimerApellido;
                entity.SegundoApellido         = obj.SegundoApellido;
                entity.FechaNacimiento         = obj.FechaNacimiento;
                entity.Genero_id               = obj.Genero_id;
                entity.Email                   = obj.EmailPersona;
                entity.Celular                 = obj.Celular;
                entity.TelefonoCasa            = obj.TelefonoCasa;
                entity.TelefonoOficina         = obj.TelefonoOficina;
                entity.Imagen                  = obj.imagen;
                entity.IsEmpresa               = obj.EsEmpresa;
                entity.Activo                  = true;
                if (obj.Id == 0)
                {
                    nuevo = true;
                    entities.Add(entity);
                }
                entities.SaveChanges();
                obj.Id = entity.Id;
                var idCliente = obj.Id;

                var entityUser = new Usuario();
                entityUser.IdClientePersona = idCliente;
                entityUser.Nombre           = obj.Usuario;
                entityUser.Email            = obj.Email;
                entityUser.Contrasena       = Utilidades.Encrypt(obj.Password);
                entityUser.IdCreatorby      = usuarioConectado;
                entityUser.DateCreated      = DateTime.Now;
                entityUser.Activo           = true;
                entities.Add(entityUser);
                entities.SaveChanges();

                if (nuevo)
                {
                    foreach (var item in obj.Direcciones)
                    {
                        entities.Add(new DireccionesCliente
                        {
                            Ubicacion    = item.Direccion,
                            CodigoPostal = item.CodigoPostal,
                            Ciudad_id    = item.Ciudad_id,
                            Cliente_id   = idCliente,
                            DateCreated  = DateTime.Now,
                            IdCreatorby  = usuarioConectado,
                            Latitud      = item.Latitud,
                            Longitud     = item.Longitud,
                            Activo       = true
                        });
                        entities.SaveChanges();
                    }
                }
                return(obj);
            }
            else
            {
                obj = null;
                return(obj);
            }
        }
        private void ConsultarButton_Click(object sender, RoutedEventArgs e)
        {
            var listado = new List <Vehiculos>();

            if (CriterioTextBox.Text.Trim().Length > 0)
            {
                switch (FiltroComboBox.SelectedIndex)
                {
                case 0:
                    try
                    {
                        listado = VehiculosBLL.GetList(l => l.VehiculoId == Utilidades.ToInt(CriterioTextBox.Text));
                    }
                    catch (FormatException)
                    {
                        MessageBox.Show("Debes ingresar un Critero valido para aplicar este filtro.", "Advertencia", MessageBoxButton.OK, MessageBoxImage.Warning);
                    }
                    break;

                case 1:
                    try
                    {
                        listado = VehiculosBLL.GetList(l => l.MarcaId == Utilidades.ToInt(CriterioTextBox.Text));
                    }
                    catch (FormatException)
                    {
                        MessageBox.Show("Debes ingresar un Critero valido para aplicar este filtro.", "Advertencia", MessageBoxButton.OK, MessageBoxImage.Warning);
                    }
                    break;

                case 2:
                    try
                    {
                        listado = VehiculosBLL.GetList(l => l.Modelo.Contains(CriterioTextBox.Text));
                    }
                    catch (FormatException)
                    {
                        MessageBox.Show("Debes ingresar un Critero valido para aplicar este filtro.", "Advertencia", MessageBoxButton.OK, MessageBoxImage.Warning);
                    }
                    break;

                case 3:
                    try
                    {
                        listado = VehiculosBLL.GetList(l => l.Ano == Utilidades.ToInt(CriterioTextBox.Text));
                    }
                    catch (FormatException)
                    {
                        MessageBox.Show("Debes ingresar un Critero valido para aplicar este filtro.", "Advertencia", MessageBoxButton.OK, MessageBoxImage.Warning);
                    }
                    break;

                case 5:
                    try
                    {
                        long id = long.Parse(CriterioTextBox.Text);
                        listado = VehiculosBLL.GetList(l => l.Costo == id);
                    }
                    catch (FormatException)
                    {
                        MessageBox.Show("Debes ingresar un Critero valido para aplicar este filtro.", "Advertencia", MessageBoxButton.OK, MessageBoxImage.Warning);
                    }
                    break;
                }
            }
            else
            {
                listado = VehiculosBLL.GetList(c => true);
            }

            if (DesdeDatePicker.SelectedDate != null)
            {
                listado = VehiculosBLL.GetList(c => c.FechaIngreso.Date >= DesdeDatePicker.SelectedDate);
            }

            if (HastaDatePicker.SelectedDate != null)
            {
                listado = VehiculosBLL.GetList(c => c.FechaIngreso.Date <= HastaDatePicker.SelectedDate);
            }

            DatosDataGrid.ItemsSource = null;
            DatosDataGrid.ItemsSource = listado;
        }
Example #10
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void rbtnSolExamen_Click(object sender, EventArgs e)
        {
            MuestraLaboratorioBll objBllHisMed = new MuestraLaboratorioBll();
            ArrayList             idExamenes   = new ArrayList();

            foreach (RadListBoxItem itm in this.lstMuestras.Items)
            {
                if (itm.Checked)
                {
                    idExamenes.Add(itm.Value);
                }
            }

            string medComment = this.rtxtComSolExm.Text.Trim();

            if (idExamenes.Count <= 0)
            {
                RadScriptManager.RegisterClientScriptBlock(this, this.GetType(), "errSolMuVal1", "alert('No ha seleccionado el tipo de examen que requiere sea realizado');", true);
                return;
            }

            if (!objBllHisMed.SolicitarMuestrasMedicina(this.IdHist, idExamenes, this.IdUserCurrent, medComment))
            {
                RadScriptManager.RegisterClientScriptBlock(this, this.GetType(), "errSolMu", "alert('Se ha presentado un error al procesar la información\\n\\n" + Utilidades.AjustarMensajeError(objBllHisMed.Error) + "');", true);
            }
        }
Example #11
0
        protected void rgOrdenes_InsertCommand(object sender, GridCommandEventArgs e)
        {
            OrdenesHistoriaBll objBll     = new OrdenesHistoriaBll();
            GridEditableItem   editColumn = (GridEditableItem)e.Item;
            Hashtable          newValues  = new Hashtable();

            e.Item.OwnerTableView.ExtractValuesFromItem(newValues, editColumn);

            OrdenesHistoria objEnt = new OrdenesHistoria();

            objEnt.Descripcion    = newValues["DESCRIPCION"].ToString();
            objEnt.MedicoTratante = newValues["MEDICO_TRATANTE"].ToString();
            objEnt.IdHistoria     = this.IdHist;
            objEnt.IdCreacion     = objEnt.IdUltimaModificacion = this.IdUserCurrent;
            objEnt.FechaCreacion  = objEnt.FechaUltimaModificacion = DateTime.Now;

            if (objBll.Save(objEnt))
            {
                RadScriptManager.RegisterClientScriptBlock(this, this.GetType(), "okOrdSav", "alert('Se ha almacenado la orden correctamente');", true);
            }
            else
            {
                RadScriptManager.RegisterClientScriptBlock(this, this.GetType(), "errOrdSav", "alert('Se ha presentado el siguiente error al cargar la nueva orden al sistema\\n\\n" + Utilidades.AjustarMensajeError(objBll.Error) + "');", true);
            }
        }
Example #12
0
        protected void rbtnSaveInfoRadMedGen_Click(object sender, EventArgs e)
        {
            HistoriaMedicaBll objHmBll = new HistoriaMedicaBll();
            HistoriaMedica    objHmEnt = objHmBll.Load(this.IdHist);

            objHmEnt.EstadoRevisionRadMed    = (Constants.EstadoRevision)(Convert.ToByte(this.rblEstadoRadGen.SelectedValue));
            objHmEnt.ComentarioRadMed        = this.rtxtCommentRadGen.Text.Trim();
            objHmEnt.IdUltimaModificacion    = this.IdUserCurrent;
            objHmEnt.FechaUltimaModificacion = DateTime.Now;

            if (!objHmBll.Save(objHmEnt, null))
            {
                RadScriptManager.RegisterClientScriptBlock(this, this.GetType(), "savedFailRadPart", "alert('Se ha presentado el sisguiente inconveniente al almacenar la informacion:\\n\\n" + Utilidades.AjustarMensajeError(objHmBll.Error) + "');", true);
            }
            else
            {
                RadScriptManager.RegisterClientScriptBlock(this, this.GetType(), "savedOKRadPart", "alert('Se ha almacenado la información correspondiente a radiología correctamente');", true);
            }
        }
Example #13
0
        protected void rbtnCerrarRetorno_Click(object sender, EventArgs e)
        {
            HistoriaMedicaBll objHmBll = new HistoriaMedicaBll();
            HistoriaMedica    objHmEnt = objHmBll.Load(this.IdHist);

            objHmEnt.RetornadoEmbajada       = false;
            objHmEnt.Finalizada              = false;
            objHmEnt.IdUltimaModificacion    = this.IdUserCurrent;
            objHmEnt.FechaUltimaModificacion = DateTime.Now;

            if (!objHmBll.Save(objHmEnt, null))
            {
                RadScriptManager.RegisterClientScriptBlock(this, this.GetType(), "savedFailHead", "alert('Se ha presentado el sisguiente inconveniente al almacenar la informacion:\\n\\n" + Utilidades.AjustarMensajeError(objHmBll.Error) + "');", true);
            }
            else
            {
                RadScriptManager.RegisterClientScriptBlock(this, this.GetType(), "savedOKHead", "alert('Se ha almacenado la información');", true);
            }
        }
Example #14
0
        protected void btnSaveInfo_Click(object sender, EventArgs e)
        {
            HistoriaMedicaBll objHmBll = new HistoriaMedicaBll();
            HistoriaMedica    objHmEnt = objHmBll.Load(this.IdHist);

            PacienteBll objPacBll = new PacienteBll();
            Paciente    objPacEnt = objPacBll.Load(objHmEnt.IdPaciente);

            //se cargan los datos del paciente
            objPacEnt.Nombres                 = this.rtxtNombres.Text.Trim();
            objPacEnt.Apellidos               = this.rtxtApellidos.Text.Trim();
            objPacEnt.NumeroDocumento         = this.rtxtNumDoc.Text.Trim();
            objPacEnt.Acudiente               = this.rtxtAcudiente.Text.Trim();
            objPacEnt.Correo                  = this.rtxtCorreo.Text.Trim();
            objPacEnt.Direccion               = this.rtxtDireccion.Text.Trim();
            objPacEnt.FechaNacimiento         = Convert.ToDateTime(this.rdpFecNac.SelectedDate);
            objPacEnt.Genero                  = Convert.ToBoolean(Convert.ToByte(this.rblGenero.SelectedValue));
            objPacEnt.IdTipoDocumento         = Convert.ToInt32(this.rcbxTipoDoc.SelectedValue);
            objPacEnt.Telefono                = this.rtxtTelefono.Text.Trim();
            objPacEnt.IdUltimaModificacion    = this.IdUserCurrent;
            objPacEnt.FechaUltimaModificacion = DateTime.Now;

            //Datos del cabecero de la pagina
            objHmEnt.IdTipoVisa        = Convert.ToInt32(this.rcbxTipoVisa.SelectedValue);
            objHmEnt.PerimetroCefalico = this.rntPC.Value != null?Convert.ToDecimal(this.rntPC.Value) : decimal.MinValue;

            objHmEnt.Peso     = Convert.ToDecimal(this.rntPeso.Value);
            objHmEnt.Estatura = this.rntEstatura.Value != null?Convert.ToDecimal(this.rntEstatura.Value) / 100M : decimal.MinValue;

            objHmEnt.CodigoSolicitud = this.rtxtNumVisa.Text.Trim();

            // Jun 12 2018 Abohorquez se adiciona el siguiente bloque

            /*para el momento que el usuario medico general guarde cambios para el paciente y si este no tiene asignado un medico se asignara el usuario actual
             */
            if (!(objHmEnt.IdMedico != int.MinValue))
            {
                objHmEnt.IdMedico = this.IdUserCurrent;
            }

            // si tiene revision de medicina
            if (objHmEnt.TieneRevisionMed)
            {
                objHmEnt.EstadoRevisionMed = this.rblEstado.SelectedValue != string.Empty ? (Constants.EstadoRevision)(Convert.ToByte(this.rblEstado.SelectedValue)) : Constants.EstadoRevision.SinAplicar;
                objHmEnt.ComentarioMed     = this.rtxtCommentMedGen.Text.Trim();
            }
            //objHmEnt.TieneRevisionMed = true;
            objHmEnt.IdUltimaModificacion    = this.IdUserCurrent;
            objHmEnt.FechaUltimaModificacion = DateTime.Now;

            if (objHmEnt.TieneRevisionRad)
            {
                //Datos correspondientes a la evaluacion Radiologia correspondiente al medico general
                objHmEnt.EstadoRevisionRadMed = this.rblEstadoRadGen.SelectedValue == "" ? Constants.EstadoRevision.SinAplicar : (Constants.EstadoRevision)(Convert.ToByte(this.rblEstadoRadGen.SelectedValue));
                objHmEnt.ComentarioRadMed     = this.rtxtCommentRadGen.Text.Trim();
            }

            if (!objHmBll.Save(objHmEnt, objPacEnt))
            {
                RadScriptManager.RegisterClientScriptBlock(this, this.GetType(), "savedFailHead", "alert('Se ha presentado el sisguiente inconveniente al almacenar la informacion:\\n\\n" + Utilidades.AjustarMensajeError(objHmBll.Error) + "');", true);
            }

            /*
             * else
             * {
             * RadScriptManager.RegisterClientScriptBlock(this, this.GetType(), "savedOKHead", "alert('Se ha almacenado la información');", true);
             * }
             */
        }
Example #15
0
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            if (Session["IDRED"] == null)
            {
                try
                {
                    Response.Redirect("~/SesionCaducadaModal.aspx", true);
                }
                catch (System.Threading.ThreadAbortException) { return; }
            }

            if (Request.QueryString["sD"] != null || Request.QueryString["sH"] != null)
            {
                if (Request.QueryString["sD"] != null)
                {
                    string sDesde = (Utilidades.decodpar(Request.QueryString["sD"].ToString()) != "") ? Utilidades.decodpar(Request.QueryString["sD"].ToString()) : Fechas.FechaAAnnomes(DateTime.Now).ToString();
                    cboDesde.Value = int.Parse(sDesde.Substring(4, 2)).ToString();
                    txtDesde.Text  = sDesde.Substring(0, 4);
                }
                if (Request.QueryString["sH"] != null)
                {
                    string sHasta = (Utilidades.decodpar(Request.QueryString["sH"].ToString()) != "") ? Utilidades.decodpar(Request.QueryString["sH"].ToString()) : Fechas.FechaAAnnomes(DateTime.Now).ToString();
                    cboHasta.Value = int.Parse(sHasta.Substring(4, 2)).ToString();
                    txtHasta.Text  = sHasta.Substring(0, 4);
                }
            }
            else
            {
                txtDesde.Text = DateTime.Now.Year.ToString();
                txtHasta.Text = DateTime.Now.Year.ToString();
            }
        }
        catch (Exception ex)
        {
            sErrores += Errores.mostrarError("Error al obtener los datos", ex);
        }
    }
Example #16
0
    public void RaiseCallbackEvent(string eventArg)
    {
        string sResultado = "", sMostrarBajas = "0";

        //1º Si hubiera argumentos, se recogen y tratan.
        //string MisArg = eventArg;
        string[] aArgs = Regex.Split(eventArg, "@#@");
        sResultado = aArgs[0] + @"@#@"; if (Session["IDRED"] == null)
        {
            _callbackResultado = aArgs[0] + @"@#@Error@#@SESIONCADUCADA"; return;
        }
        ;
        try
        {
            //2º Aquí realizaríamos el acceso a BD, etc,...
            switch (aArgs[0])
            {
            case ("profesionales"):
                //sResultado += "OK@#@" + Ficepi.obtenerProfesionales(Utilidades.unescape(aArgs[1]), Utilidades.unescape(aArgs[2]), Utilidades.unescape(aArgs[3]), "");
                if ((bool)Session["CVCONSULTABAJA"])
                {
                    sMostrarBajas = "1";
                }
                sResultado += "OK@#@" +
                              Ficepi.getProfConsBasicaCVT(int.Parse(Session["IDFICEPI_CVT_ACTUAL"].ToString()),
                                                          Utilidades.unescape(aArgs[1]), Utilidades.unescape(aArgs[2]),
                                                          Utilidades.unescape(aArgs[3]), sMostrarBajas);
                break;
            }

            //3º Damos contenido a la variable que se envía de vuelta al cliente.
            _callbackResultado = sResultado;
        }
        catch (Exception ex)
        {
            switch (aArgs[0])
            {
            case ("profesionales"):
                sResultado += "Error@#@" + Errores.mostrarError("Error en la búsqueda de profesionales", ex);
                break;
            }
        }
    }
Example #17
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="idHistoria"></param>
        private void LoadInfoHist(int idHistoria)
        {
            this.hfIdHist.Value = idHistoria.ToString();
            HistoriaMedicaBll objHMBll  = new HistoriaMedicaBll();
            HistoriaMedica    objEntHm  = objHMBll.Load(idHistoria);
            PacienteBll       objPBll   = new PacienteBll();
            Paciente          objEntPac = objPBll.Load(objEntHm.IdPaciente);

            EmbajadaBll      objBllEmb = new EmbajadaBll();
            TipoDocumentoBll objBllTd  = new TipoDocumentoBll();
            TipoVisaBll      objTVBll  = new TipoVisaBll();
            TipoVisa         objEntTv  = objTVBll.Load(objEntHm.IdTipoVisa);

            Utilidades.LlenarRC(this.rcbxEmbajada, objBllEmb.GetList(string.Empty, true, false), "ID", "NOMBRE", true);
            Utilidades.LlenarRC(this.rcbxTipoDoc, objBllTd.GetList(string.Empty, true, false), "ID", "NOMBRE", true);
            Utilidades.LlenarRCEnBlanco(this.rcbxTipoVisa);

            ExamenLaboratorioBll objBllExLab = new ExamenLaboratorioBll();

            Utilidades.LlenarLB(this.lstMuestras, objBllExLab.GetList(string.Empty, true, true, true, true, true, true, true, false), "ID", "NOMBRE");

            this.lstMuestras.Items.Add(new RadListBoxItem("BACILOSCOPIA", Convert.ToInt32(Constants.ExamenLab.Baciloscopia).ToString()));
            this.lstMuestras.Items.Add(new RadListBoxItem("CULTIVO", Convert.ToInt32(Constants.ExamenLab.Cultivo).ToString()));

            this.lstMuestras.DataBind();

            Utilidades.PosicionarRC(this.rcbxEmbajada, Convert.ToInt32(objEntTv.IdEmbajada).ToString());
            this.rcbxEmbajada_SelectedIndexChanged(this.rcbxEmbajada, null);
            Utilidades.PosicionarRC(this.rcbxTipoVisa, objEntHm.IdTipoVisa.ToString());

            Utilidades.PosicionarRC(rcbxTipoDoc, objEntPac.IdTipoDocumento.ToString());

            this.rdpFecha.SelectedDate = objEntHm.FechaIngreso;
            this.rtxtNombres.Text      = objEntPac.Nombres;
            this.rtxtApellidos.Text    = objEntPac.Apellidos;
            this.rtxtNumDoc.Text       = objEntPac.NumeroDocumento;
            this.rtxtPasaporte.Text    = objEntPac.NumeroPasaporte;

            this.rtxtCommentMedGen.Text = objEntHm.ComentarioMed;

            TipoVisaBll objTvBll = new TipoVisaBll();
            TipoVisa    objTvEnt = objTvBll.Load(objEntHm.IdTipoVisa);

            this.EmbajadaCurr = (Constants.Embajadas)objTvEnt.IdEmbajada;

            this.rtxtNumVisa.Text        = objEntHm.CodigoSolicitud;
            this.rblGenero.SelectedValue = Convert.ToByte(objEntPac.Genero).ToString();
            //this.rdpFecNac.SelectedDate = Convert.ToDateTime(objEntPac.FechaNacimiento.ToString("yyyy-MM-dd"));
            this.rdpFecNac.SelectedDate = objEntPac.FechaNacimiento;

            this.lblEdad.Text           = objEntPac.EdadPaciente.ToString();
            this.lblCodigo.Text         = objEntHm.CodigoSolicitud;
            this.lblEstatura.Text       = Convert.ToDouble(objEntHm.Estatura * 100M).ToString();
            this.lblNombrePaciente.Text = objEntPac.Apellidos + " " + objEntPac.Nombres;
            this.lblPeso.Text           = objEntHm.Peso.ToString();
            this.lblTipoVisa.Text       = this.rcbxTipoVisa.SelectedItem.Text;

            this.rtxtCorreo.Text    = objEntPac.Correo;
            this.rtxtDireccion.Text = objEntPac.Direccion;
            this.rtxtAcudiente.Text = objEntPac.Acudiente;
            this.rntPeso.Value      = Convert.ToDouble(objEntHm.Peso);
            this.rntEstatura.Value  = Convert.ToDouble(objEntHm.Estatura * 100M);

            try
            {
                this.rntBmi.Value = Convert.ToDouble(objEntHm.BMI);
            }
            catch
            {
                this.rntBmi.Value = null;
            }

            this.rtxtTelefono.Text = objEntPac.Telefono;
            this.rntPC.Value       = objEntHm.PerimetroCefalico != decimal.MinValue ? Convert.ToDouble(objEntHm.PerimetroCefalico) : 0d;
            this.rntPC.Enabled     = this.rfvPC.Enabled = objEntPac.FechaNacimiento > DateTime.Now.AddYears(-2);

            this.rblEstado.SelectedValue = Convert.ToByte(objEntHm.EstadoRevisionMed).ToString();

            this.chkRadTomada.Checked    = objEntHm.RadiografiaTomada;
            this.chkCargEMedical.Checked = objEntHm.RadiografiaCargadaEmedical;
            this.chkNotEnv.Checked       = objEntHm.NotificacionEnviada;
            this.chkRequiereNot.Checked  = objEntHm.RequiereNotificacion;

            this.ChkRequiereNotificacion.Enabled = false;
            this.ChkNotificado.Enabled           = false;

            this.pnlComMed.Visible = objEntHm.EstadoRevisionMed == Constants.EstadoRevision.Anormal;

            this.rtxtCommentLab.Text        = objEntHm.ComentarioLab;
            this.rblEstadoLab.SelectedValue = Convert.ToByte(objEntHm.EstadoRevisionLab).ToString();

            this.rtxtCommentRad.Text        = objEntHm.ComentarioRad;
            this.rblEstadoRad.SelectedValue = Convert.ToByte(objEntHm.EstadoRevisionRad).ToString();

            this.pnlComRad.Visible = objEntHm.EstadoRevisionRad == Constants.EstadoRevision.Anormal;

            this.rtxtCommentRadGen.Text        = objEntHm.ComentarioRadMed;
            this.rblEstadoRadGen.SelectedValue = Convert.ToByte(objEntHm.EstadoRevisionRadMed).ToString();

            this.pnlComRadMed.Visible = objEntHm.EstadoRevisionRadMed == Constants.EstadoRevision.Anormal;

            this.LoadImgPerfilPaciente(idHistoria, this.imgPrePhoto);

            this.rbtnCerrarRetorno.Enabled = this.rbtnCerrarRetorno.Visible = objEntHm.RetornadoEmbajada;
        }
Example #18
0
    protected void bAceptar_Click(object sender, EventArgs e)
    {
        string vSql            = "";
        string CodigoUsuario   = Usuario.Text.Trim();
        string ClaveEncriptada = Clave.Text.Trim();

        if (CodigoUsuario != "" && ClaveEncriptada != "")
        {
            vSql = "SELECT CAST(UsuarioActivo as VARCHAR(1))+'|'+CAST(U.UsuarioID as VARCHAR(20))+'|'+UsuarioNombre+' '+UsuarioApellido+'|'+CAST(SucursalID as VARCHAR(12))+'|'+CAST(ISNULL(ClienteID,'') as VARCHAR(20))+'|'+CAST(RolID as VARCHAR(4)) FROM dbo.Usuario U INNER JOIN dbo.UsuarioRol UR ON U.UsuarioID=UR.UsuarioID WHERE UsuarioCedula='" + CodigoUsuario + "' AND UsuarioClave='" + ClaveEncriptada + "'";
            lblValidado.ForeColor = System.Drawing.Color.Red;
            string ResUsuario = Utilidades.EjeSQL(vSql, cn, ref sErr);
            if (sErr == string.Empty && ResUsuario != "-1")
            {
                if (ResUsuario != string.Empty)
                {
                    string[] aUsuario = ResUsuario.Split('|');
                    if (aUsuario.Length == 6)
                    {
                        if (aUsuario[0] == "1") //Usuario Activo
                        {
                            string sUsuarioID = aUsuario[1];
                            string sPlanID    = "";
                            sPlanID = Utilidades.EjeSQL("SELECT TOP 1 PlanID FROM PlanAlumno WHERE UsuarioID=" + sUsuarioID, cn, ref sErr);
                            //0: UsuarioID  1:Nombre  2:SucursalID  3:ClienteID 4:PlanID
                            FormsAuthenticationTicket Tck = new FormsAuthenticationTicket(1, sUsuarioID + "|" + aUsuario[2] + "|" + aUsuario[3] + "|" + aUsuario[4] + "|" + sPlanID, DateTime.Now, new DateTime(2200, 12, 25), false, aUsuario[5], FormsAuthentication.FormsCookiePath);
                            Response.Cookies.Add(new HttpCookie(FormsAuthentication.FormsCookieName, FormsAuthentication.Encrypt(Tck)));
                            //Guardar datos del usuario...
                            if (chkRecordar.Checked)
                            {
                                ckUsuario         = new HttpCookie("Usuario", Usuario.Text.Trim());
                                ckPass            = new HttpCookie("Pass", Clave.Text.Trim());
                                ckCheck           = new HttpCookie("Check", "1");
                                ckUsuario.Expires = new DateTime(2200, 12, 25);
                                ckPass.Expires    = new DateTime(2200, 12, 25);
                                ckCheck.Expires   = new DateTime(2200, 12, 25);
                                Response.Cookies.Add(ckUsuario);
                                Response.Cookies.Add(ckPass);
                                Response.Cookies.Add(ckCheck);
                            }
                            else
                            {
                                ckUsuario.Expires = DateTime.Now;
                                Response.Cookies.Set(ckUsuario);
                                ckPass.Expires = DateTime.Now;
                                Response.Cookies.Set(ckPass);
                            }
                            string Error = string.Empty;
                            string sSQL  = "SELECT RolID FROM UsuarioRol WHERE UsuarioID = " + sUsuarioID;
                            string rol   = Utilidades.EjeSQL(sSQL, cn, ref Error, true);
                            if (rol == "2")
                            {
                                Response.Redirect("~/sistema/InicioProfesor.aspx");
                            }
                            else
                            {
                                Response.Redirect("~/sistema/inicio.aspx");
                            }
                        }
                        else
                        {
                            sErr = "Usuario no activo, consulte al Administrador";
                            MostrarMsjModal(sErr, "ERR");
                        }
                    }
                    else
                    {
                        sErr = "Error en la sentencia de búsqueda a la base de datos";
                        MostrarMsjModal(sErr, "ERR");
                    }
                }
                else
                {
                    sErr = "Usuario no existe o clave inválida";
                    MostrarMsjModal(sErr, "ERR");
                }
            }
        }
        else
        {
            MostrarMsjModal("Ingrese los datos solicitados", "ERR");
        }
    }
Example #19
0
 static void Main(string[] args)
 {
     RemotingConfiguration.Configure("Servidor.exe.config");
     Utilidades.MostrarTodosLosDatos();
     Log.EsperarParaTerminar("Presione ENTER para detener al servidor...");
 }
        public UsuarioViewModel Update(UsuarioViewModel obj)
        {
            var     usuarioContectado = Utilidades.GetCurrentUser().Id;
            Cliente entity            = new Cliente();

            entity                         = entities.Clientes.Where(e => e.Id == obj.Id).FirstOrDefault();
            entity.DateChanged             = DateTime.Now;
            entity.IdChangedby             = usuarioContectado;
            entity.Id                      = obj.Id;
            entity.TipoPersona_id          = obj.TipoPersona_id;
            entity.TipoDocumento_id        = obj.TipoDocumento_id;
            entity.Identificacion          = obj.Identificacion;
            entity.PrimerNombreRazonSocial = obj.PrimerNombres;
            entity.SegundoNombre           = obj.SegundoNombres;
            entity.PrimerApellido          = obj.PrimerApellido;
            entity.SegundoApellido         = obj.SegundoApellido;
            entity.FechaNacimiento         = obj.FechaNacimiento;
            entity.Genero_id               = obj.Genero_id;
            entity.Email                   = obj.Email;
            entity.Celular                 = obj.Celular;
            entity.TelefonoCasa            = obj.TelefonoCasa;
            entity.TelefonoOficina         = obj.TelefonoOficina;
            entity.JornadaEntrega          = obj.JornadaEntrega;
            entity.IsEmpresa               = obj.EsEmpresa;
            entity.Imagen                  = obj.imagen == null ? entity.Imagen : obj.imagen;
            entity.Activo                  = true;
            entities.SaveChanges();
            obj.Id = entity.Id;
            var idCliente = obj.Id;
            var records   = entities.DireccionesClientes.Where(e => e.Cliente_id == obj.Id).ToList();
            var nuevos    = obj.Direcciones.Where(c => c.Id < 0).ToList();
            //Borrado Direcciones
            var borrar = (from c in records
                          where obj.Direcciones.FirstOrDefault(r => r.Id == c.Id) == null
                          select c).ToList();

            var match = (from c in records
                         from d in obj.Direcciones
                         where c.Id == d.Id
                         select new
            {
                Record = c,
                Memoria = d
            }).ToList();

            foreach (var item in nuevos)
            {
                entities.Add(new DireccionesCliente
                {
                    Ubicacion    = item.Direccion,
                    CodigoPostal = item.CodigoPostal,
                    Ciudad_id    = item.Ciudad_id,
                    DateCreated  = DateTime.Now,
                    Cliente_id   = idCliente,
                    IdCreatorby  = usuarioContectado,
                    Activo       = true
                });
            }

            foreach (var item in borrar)
            {
                entities.Delete(item);
            }

            foreach (var item in match)
            {
                item.Record.Ubicacion    = item.Memoria.Direccion;
                item.Record.CodigoPostal = item.Memoria.CodigoPostal;
                item.Record.Ciudad_id    = item.Memoria.Ciudad_id;
            }

            var entityUser = new Usuario();

            entityUser = entities.Usuarios.Where(e => e.Id == obj.Id).FirstOrDefault();
            entityUser.IdClientePersona = idCliente;
            entityUser.Nombre           = obj.Usuario;
            entityUser.Email            = obj.Email;
            entityUser.Contrasena       = obj.Password == null ? entityUser.Contrasena : Utilidades.Encrypt(obj.Password);
            entityUser.IdChangedby      = usuarioContectado;
            entityUser.DateChanged      = DateTime.Now;
            entityUser.Activo           = true;
            entities.Add(entityUser);
            entities.SaveChanges();
            return(obj);
        }
 private void button1_Click(object sender, EventArgs e)
 {
     Utilidades.cerrar();
 }
    //protected void Regresar()
    //{
    //    Response.Redirect(HistorialNavegacion.Leer(), true);
    //}
    private string Grabar(string sIdPlant, string sDesPlant, string sCodUne, string sEstado, string sAmbito, string sTipo, string sObs)
    {
        string sResul = "";
        int    iPlant, iPromotor = int.Parse(Session["IDFICEPI_PC_ACTUAL"].ToString());
        //bool bInsertarPT;
        SqlConnection  oConn = null;
        SqlTransaction tr    = null;

        try
        {
            if (sCodUne == "")
            {
                sCodUne = "-1";
            }
            if (sIdPlant != "0")
            {
                PlantProy.Modificar(int.Parse(sIdPlant), sAmbito, Utilidades.unescape(sDesPlant), int.Parse(sEstado), iPromotor, int.Parse(sCodUne), Utilidades.unescape(sObs));
                sResul = "OK@#@" + sIdPlant;
            }
            else
            {
                //if (sAmbito=="T") bInsertarPT = true;
                //else bInsertarPT = false;
                try
                {
                    oConn = Conexion.Abrir();
                    tr    = Conexion.AbrirTransaccion(oConn);
                }
                catch (Exception ex)
                {
                    sResul = "Error@#@" + Errores.mostrarError("Error al abrir la conexión", ex);
                    return(sResul);
                }

                iPlant = PlantProy.Insertar(tr, sTipo, Utilidades.unescape(sDesPlant), int.Parse(sEstado), sAmbito, iPromotor, int.Parse(sCodUne), Utilidades.unescape(sObs));

                Conexion.CommitTransaccion(tr);

                this.hdnIDPlantilla.Text = iPlant.ToString();
                Session["IDPlant"]       = iPlant.ToString();
                sResul = "OK@#@" + iPlant.ToString();
            }
        }
        catch (Exception ex)
        {
            //TextBox hdnErrores = (TextBox)Master.FindControl("hdnErrores");
            //hdnErrores.Text = Errores.mostrarError("Error al grabar el detalle del calendario", ex);
            Conexion.CerrarTransaccion(tr);
            sResul = "Error@#@" + Errores.mostrarError("Error al grabar el maestro de la plantilla", ex);
        }
        finally
        {
            Conexion.Cerrar(oConn);
        }
        return(sResul);
    }
 private void button2_Click(object sender, EventArgs e)
 {
     Utilidades.minimizar(this);
 }
Example #24
0
        private void ConsultarButton_Click(object sender, RoutedEventArgs e)
        {
            var listado = new List <Prestamos>();

            if (CriterioTextBox.Text.Trim().Length > 0)
            {
                switch (FiltroComboBox.SelectedIndex)
                {
                case 0:
                    try
                    {
                        listado = PrestamosBLL.GetList(p => p.PrestamoId == Utilidades.ToInt(CriterioTextBox.Text));
                    }
                    catch (FormatException)
                    {
                        MessageBox.Show("Debes ingresar un Critero valido para aplicar este filtro.", "Advertencia", MessageBoxButton.OK, MessageBoxImage.Warning);
                    }
                    break;

                case 1:
                    try
                    {
                        listado = PrestamosBLL.GetList(p => p.AmigoId == Utilidades.ToInt(CriterioTextBox.Text));
                    }
                    catch (FormatException)
                    {
                        MessageBox.Show("Debes ingresar un Critero valido para aplicar este filtro.", "Advertencia", MessageBoxButton.OK, MessageBoxImage.Warning);
                    }
                    break;

                case 2:
                    try
                    {
                        double id = double.Parse(CriterioTextBox.Text);
                        listado = PrestamosBLL.GetList(p => p.CantidadJuegosTotal == id);
                    }
                    catch (FormatException)
                    {
                        MessageBox.Show("Debes ingresar un Critero valido para aplicar este filtro.", "Advertencia", MessageBoxButton.OK, MessageBoxImage.Warning);
                    }
                    break;
                }
            }
            else
            {
                listado = PrestamosBLL.GetList(c => true);
            }

            if (DesdeDatePicker.SelectedDate != null)
            {
                listado = PrestamosBLL.GetList(c => c.Fecha.Date >= DesdeDatePicker.SelectedDate);
            }

            if (HastaDatePicker.SelectedDate != null)
            {
                listado = PrestamosBLL.GetList(c => c.Fecha.Date <= HastaDatePicker.SelectedDate);
            }

            DatosDataGrid.ItemsSource = null;
            DatosDataGrid.ItemsSource = listado;
        }
Example #25
0
    public void RaiseCallbackEvent(string eventArg)
    {
        string sResultado = "";

        //1º Si hubiera argumentos, se recogen y tratan.
        //string MisArg = eventArg;
        string[] aArgs = Regex.Split(eventArg, "@#@");
        sResultado = aArgs[0] + @"@#@"; if (Session["IDRED"] == null)
        {
            _callbackResultado = aArgs[0] + @"@#@Error@#@SESIONCADUCADA"; return;
        }
        ;

        //2º Aquí realizaríamos el acceso a BD, etc,...
        switch (aArgs[0])
        {
        case "grabar":
            sResultado += Grabar(aArgs[1], aArgs[2], aArgs[3], aArgs[4], aArgs[5], Utilidades.unescape(aArgs[6]), aArgs[7], aArgs[8]);
            break;

        case "grabarcomo":
            sResultado += GrabarComo(aArgs[1], aArgs[2], aArgs[3], aArgs[4], aArgs[5], Utilidades.unescape(aArgs[6]), aArgs[7], aArgs[8]);
            break;

        case ("provinciasPais"):
            sResultado += cargarProvinciasPais(aArgs[1]);
            break;
        }

        //3º Damos contenido a la variable que se envía de vuelta al cliente.
        _callbackResultado = sResultado;
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        Master.TituloPagina      = "Por proveedor";
        Master.bFuncionesLocales = true;

        if (!Page.IsCallback)
        {
            lblCDP.Attributes.Add("title", "Cualificador de proyectos a nivel de " + Estructura.getDefLarga(Estructura.sTipoElem.NODO));
            lblCSN1P.Attributes.Add("title", "Cualificador de proyectos a nivel de " + Estructura.getDefLarga(Estructura.sTipoElem.SUPERNODO1));
            lblCSN2P.Attributes.Add("title", "Cualificador de proyectos a nivel de " + Estructura.getDefLarga(Estructura.sTipoElem.SUPERNODO2));
            lblCSN3P.Attributes.Add("title", "Cualificador de proyectos a nivel de " + Estructura.getDefLarga(Estructura.sTipoElem.SUPERNODO3));
            lblCSN4P.Attributes.Add("title", "Cualificador de proyectos a nivel de " + Estructura.getDefLarga(Estructura.sTipoElem.SUPERNODO4));

            if (!Utilidades.EstructuraActiva("SN4"))
            {
                fstCSN4P.Style.Add("visibility", "hidden");
            }
            if (!Utilidades.EstructuraActiva("SN3"))
            {
                fstCSN3P.Style.Add("visibility", "hidden");
            }
            if (!Utilidades.EstructuraActiva("SN2"))
            {
                fstCSN2P.Style.Add("visibility", "hidden");
            }
            if (!Utilidades.EstructuraActiva("SN1"))
            {
                fstCSN1P.Style.Add("visibility", "hidden");
            }

            hdnDesde.Text = (DateTime.Now.Year * 100 + 1).ToString();
            txtDesde.Text = mes[0] + " " + DateTime.Now.Year.ToString();
            hdnHasta.Text = (DateTime.Now.Year * 100 + DateTime.Now.Month).ToString();
            txtHasta.Text = mes[DateTime.Now.Month - 1] + " " + DateTime.Now.Year.ToString();

            string[] aCriterios = Regex.Split(cargarCriterios(int.Parse(hdnDesde.Text), int.Parse(hdnHasta.Text)), "@#@");
            if (aCriterios[0] == "OK")
            {
                sCriterios = "var js_cri = new Array();\n" + aCriterios[1];
            }
            else
            {
                Master.sErrores = aCriterios[1];
            }

            if (Utilidades.EstructuraActiva("SN4"))
            {
                nEstructuraMinima = 1;
            }
            else if (Utilidades.EstructuraActiva("SN3"))
            {
                nEstructuraMinima = 2;
            }
            else if (Utilidades.EstructuraActiva("SN2"))
            {
                nEstructuraMinima = 3;
            }
            else if (Utilidades.EstructuraActiva("SN1"))
            {
                nEstructuraMinima = 4;
            }

            strTablaHtml = "<tr id='*' class='FA'><td>&lt; Todos &gt;</td></tr>";

            lblMonedaImportes.InnerText = Session["DENOMINACION_VDC"].ToString();
            //if (User.IsInRole("DIS") || ConfigurationManager.AppSettings["MOSTRAR_SOLODIS"] == "0")
            divMonedaImportes.Style.Add("visibility", "visible");

            string[] aDatosPref = Regex.Split(getPreferencia(""), "@#@");
            #region Lectura de preferencia

            if (bHayPreferencia && aDatosPref[0] == "OK")
            {
                sHayPreferencia = "true";
                //             cboConceptoEje.SelectedValue = aDatosPref[2];
                cboCategoria.SelectedValue = aDatosPref[3];
                cboCualidad.SelectedValue  = aDatosPref[4];
                if (aDatosPref[7] == "1")
                {
                    rdbOperador.Items[0].Selected = true;
                }
                else
                {
                    rdbOperador.Items[1].Selected = true;
                }

                nUtilidadPeriodo = int.Parse(aDatosPref[8]);
                hdnDesde.Text    = aDatosPref[9];
                txtDesde.Text    = aDatosPref[10];
                hdnHasta.Text    = aDatosPref[11];
                txtHasta.Text    = aDatosPref[12];
                sSubnodos        = aDatosPref[14];

                rdbFormato.SelectedValue = aDatosPref[47];
            }
            else if (aDatosPref[0] == "Error")
            {
                Master.sErrores += Errores.mostrarError(aDatosPref[1]);
            }
            #endregion

            //1º Se indican (por este orden) la función a la que se va a devolver el resultado
            //   y la función que va a acceder al servidor

            string cbRespuesta = Page.ClientScript.GetCallbackEventReference(this, "arg", "RespuestaCallBack", "context", false);
            string cbLlamada   = "function RealizarCallBack(arg, context)" + "{" + cbRespuesta + ";" + "}";

            //2º Se "registra" la función que va a acceder al servidor.

            Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "RealizarCallBack", cbLlamada, true);
        }
    }
 protected void Button1_Click(object sender, EventArgs e)
 {
     Selecionar(Utilidades.TOINT(buscaText.Text));
 }
Example #28
0
 protected void Page_Load(object sender, EventArgs e)
 {
     util = new Utilidades();
 }
        public void Selecionar(int id)
        {
            if (DropFiltro.SelectedIndex == 0)
            {
                buscaText.Text = "";
                if (Lista.Count == 0)
                {
                    Utilidades.ShowToastr(this, "No se ha registrado Clientes", "Resultados", "error");

                    buscaText.Text = "";
                    buscaText.Focus();
                }
                else
                {
                    Lista = BLL.ClientesBLL.GetListodo();
                    ClienteGrid.DataSource = Lista;
                    Utilidades.ShowToastr(this, "Sus Resultados", "Resultados", "success");
                }
            }
            else if (DropFiltro.SelectedIndex == 1)
            {
                Lista = BLL.ClientesBLL.GetList(p => p.ClienteId == id);

                if (Lista.Count == 0)
                {
                    Utilidades.ShowToastr(this, "No se ha registrado Clientes con este ID", "Resultados", "error");

                    buscaText.Text = "";
                    buscaText.Focus();
                }
                else
                {
                    ClienteGrid.DataSource = Lista;
                    ClienteGrid.DataBind();

                    Utilidades.ShowToastr(this, "Sus Resultados", "Resultados", "success");
                }
            }
            else if (DropFiltro.SelectedIndex == 2)
            {
                if (desdeFecha.Text == "" && desdeFecha.Text == "")
                {
                    Utilidades.ShowToastr(this, "Fecha invalida", "Resultados", "error");

                    hastaFecha.Text = "";
                    desdeFecha.Text = "";
                    desdeFecha.Focus();
                }
                else
                {
                    DateTime desde = DateTime.Now;
                    DateTime hasta = DateTime.Now;
                    if (desdeFecha.Text == "")
                    {
                        Utilidades.ShowToastr(this, "Fecha invalida", "Resultados", "error");

                        hastaFecha.Text = "";
                        desdeFecha.Text = "";
                        desdeFecha.Focus();
                    }
                    else
                    {
                        desde = Convert.ToDateTime(desdeFecha.Text);
                        hasta = Convert.ToDateTime(hastaFecha.Text);
                    }


                    if (desdeFecha.Text != "" && hastaFecha.Text != "")
                    {
                        if (desde <= hasta)
                        {
                            Lista = BLL.ClientesBLL.GetList(p => p.FechaNacimiento >= desde.Date && p.FechaNacimiento <= hasta.Date);
                            ClienteGrid.DataSource = Lista;
                            ClienteGrid.DataBind();
                            Utilidades.ShowToastr(this, "Sus Resultados", "Resultados", "success");
                        }
                        else
                        {
                            Utilidades.ShowToastr(this, "Fecha debe ser menor", "Consejo", "info");

                            desdeFecha.Text = "";
                            hastaFecha.Text = "";
                            desdeFecha.Focus();
                        }
                    }
                    else
                    {
                        Utilidades.ShowToastr(this, "Ingrese Fecha", "Consejo", "info");

                        desdeFecha.Focus();
                    }
                }
            }

            else if (DropFiltro.SelectedIndex == 3)
            {
                if (buscaText.Text == "")
                {
                    Utilidades.ShowToastr(this, "Escriba descripcion", "Resultados", "info");


                    buscaText.Text = "";
                    buscaText.Focus();
                }
                else
                {
                    Lista = BLL.ClientesBLL.GetList(p => p.Nombres == buscaText.Text);
                    if (Lista.Count == 0)
                    {
                        Utilidades.ShowToastr(this, "No se ha Registrado clientes con este nombre", "Resultados", "error");

                        buscaText.Text = "";
                        buscaText.Focus();
                    }
                    else
                    {
                        ClienteGrid.DataSource = Lista;
                        ClienteGrid.DataBind();
                        Utilidades.ShowToastr(this, "Sus Resultados", "Resultados", "success");
                    }
                }
            }
        }
Example #30
0
 public BuscarFactura()
 {
     InitializeComponent();
     dataGridFacturas.DataSource = Utilidades.datasetLista("listarEncabezadoFactura").Tables[0];
 }
Example #31
0
        public ActionResult CargaMasivabackup()
        {
            Global.DeleteAllFiles();
            string RutaArchivo = "";
            string Extencion   = "";

            try
            {
                if (Request.Files["excel"] != null)
                {
                    Extencion = Path.GetExtension(Request.Files["excel"].FileName);
                    Extencion = Extencion.ToLower();
                }

                if (Extencion != ".xls" && Extencion != ".xlsx")
                {
                    return(View("CargarEmpleadosGral", da.ListEmpleado(true, 0).ToList()));
                }

                string saveDir = Server.MapPath("~/uploads/");

                if (!System.IO.Directory.Exists(saveDir))
                {
                    System.IO.Directory.CreateDirectory(saveDir);
                }

                //string appPath = Request.PhysicalApplicationPath;
                RutaArchivo = saveDir + Server.HtmlEncode(Request.Files["excel"].FileName);//saveDir + Server.HtmlEncode(Request.Files["excel"].FileName);

                if (System.IO.File.Exists(RutaArchivo))
                {
                    System.IO.File.Delete(RutaArchivo);
                }

                try
                {
                    Request.Files["excel"].SaveAs(RutaArchivo);
                }
                catch (Exception e)
                {
                    Global.setError(e.Message);
                    throw;
                }


                Excel excel = new Excel();
                using (DataSet ldsExcel = Excel.GetDataTableExcel(RutaArchivo, Extencion))
                {
                    if (!ldsExcel.Tables[0].Columns.Contains("NOMBRE"))
                    {
                        return(View("CargarEmpleadosGral", da.ListEmpleado(true, 0).ToList()));
                    }
                    if (!ldsExcel.Tables[0].Columns.Contains("DNI"))
                    {
                        return(View("CargarEmpleadosGral", da.ListEmpleado(true, 0).ToList()));
                    }
                    if (!ldsExcel.Tables[0].Columns.Contains("CUIL"))
                    {
                        return(View("CargarEmpleadosGral", da.ListEmpleado(true, 0).ToList()));
                    }
                    if (!ldsExcel.Tables[0].Columns.Contains("SUCURSAL"))
                    {
                        return(View("CargarEmpleadosGral", da.ListEmpleado(true, 0).ToList()));
                    }
                    if (!ldsExcel.Tables[0].Columns.Contains("CUENTA"))
                    {
                        return(View("CargarEmpleadosGral", da.ListEmpleado(true, 0).ToList()));
                    }
                    if (!ldsExcel.Tables[0].Columns.Contains("TIPOCUENTA"))
                    {
                        return(View("CargarEmpleadosGral", da.ListEmpleado(true, 0).ToList()));
                    }
                    if (!ldsExcel.Tables[0].Columns.Contains("TIPOACREDITACION"))
                    {
                        return(View("CargarEmpleadosGral", da.ListEmpleado(true, 0).ToList()));
                    }

                    List <string> ColQuitar = new List <string>();
                    for (int i = 0; i < ldsExcel.Tables[0].Columns.Count; i++)
                    {
                        string colname = ldsExcel.Tables[0].Columns[i].ColumnName.ToUpper();
                        if (ldsExcel.Tables[0].Columns[i].ColumnName.ToUpper() != "NOMBRE" &&
                            ldsExcel.Tables[0].Columns[i].ColumnName.ToUpper() != "DNI" &&
                            ldsExcel.Tables[0].Columns[i].ColumnName.ToUpper() != "CUIL" &&
                            ldsExcel.Tables[0].Columns[i].ColumnName.ToUpper() != "SUCURSAL" &&
                            ldsExcel.Tables[0].Columns[i].ColumnName.ToUpper() != "CUENTA" &&
                            ldsExcel.Tables[0].Columns[i].ColumnName.ToUpper() != "TIPOCUENTA" &&
                            ldsExcel.Tables[0].Columns[i].ColumnName.ToUpper() != "TIPOACREDITACION")
                        {
                            //ldsExcel.Tables[0].Columns.RemoveAt(i);
                            ColQuitar.Add(ldsExcel.Tables[0].Columns[i].ColumnName);
                        }
                    }
                    //Si hay columnas a remover
                    if (ColQuitar.ToArray().Count() > 0)
                    {
                        foreach (string colu in ColQuitar.ToArray())
                        {
                            ldsExcel.Tables[0].Columns.Remove(colu);
                        }
                    }

                    try
                    {
                        excel.InsertarDatosExcel(ldsExcel, "Micrositio_Haberes" + Global.getSession() + Global.GetEmpresa().CodEmp + Global.GetGlobalAcreditacion());
                    }
                    catch (Exception e)
                    {
                        Global.setError(e.Message);
                        return(View("CargarEmpleadosGral", da.ListEmpleado(true, 0).ToList()));

                        throw;
                    }
                }
                string CMD = string.Format("Exec SP_CargaMasiva_Empleados '{0}','{1}','{2}','{3}'", 1, Global.getSession(), Global.GetEmpresa().CodEmp, Global.GetGlobalAcreditacion());
                try
                {
                    Utilidades.Exec(CMD);
                    return(View("CargarEmpleadosGral", da.ListEmpleado(true, 0).ToList()));
                }
                catch (Exception e)
                {
                    Global.setError(e.Message);
                    //return View("Error");
                    return(View("CargarEmpleadosGral", da.ListEmpleado(true, 0).ToList()));

                    throw;
                }
            }
            catch (Exception e)
            {
                Global.setError(e.Message);
                return(View("CargarEmpleadosGral", da.ListEmpleado(true, 0).ToList()));

                throw;
            }
        }
Example #32
0
        public ActionResult UpdateMasivo()
        {
            Global.DeleteAllFiles();
            string RutaArchivo = "";
            string Extencion   = "";

            try
            {
                if (Request.Files["excel"] != null)
                {
                    Extencion = Path.GetExtension(Request.Files["excel"].FileName);
                    Extencion = Extencion.ToLower();
                }

                if (Extencion != ".xls" && Extencion != ".xlsx")
                {
                    return(View("CargarEmpleadosGral", da.ListEmpleado(true, 0).ToList()));
                }

                string saveDir = Server.MapPath("~/uploads/");
                if (!System.IO.Directory.Exists(saveDir))
                {
                    System.IO.Directory.CreateDirectory(saveDir);
                }


                string rutaDelArchivoAsubir = Server.HtmlEncode(Request.Files["excel"].FileName);

                string NombreArchivo = Path.GetFileName(rutaDelArchivoAsubir);
                //string appPath = Request.PhysicalApplicationPath;
                RutaArchivo = saveDir + NombreArchivo;//saveDir + Server.HtmlEncode(Request.Files["excel"].FileName);

                if (System.IO.File.Exists(RutaArchivo))
                {
                    System.IO.File.Delete(RutaArchivo);
                }

                Request.Files["excel"].SaveAs(RutaArchivo);
                Excel excel = new Excel();
                using (DataSet ldsExcel = Excel.GetDataTableExcel(RutaArchivo, Extencion))
                {
                    if (!ldsExcel.Tables[0].Columns.Contains("FECHA"))
                    {
                        return(RedirectToAction("CargaMasiva"));
                    }
                    if (!ldsExcel.Tables[0].Columns.Contains("DNI"))
                    {
                        return(RedirectToAction("CargaMasiva"));
                    }
                    if (!ldsExcel.Tables[0].Columns.Contains("IMPORTE"))
                    {
                        return(RedirectToAction("CargaMasiva"));
                    }

                    List <string> ColQuitar = new List <string>();
                    for (int i = 0; i < ldsExcel.Tables[0].Columns.Count; i++)
                    {
                        string colname = ldsExcel.Tables[0].Columns[i].ColumnName.ToUpper();
                        if (ldsExcel.Tables[0].Columns[i].ColumnName.ToUpper() != "FECHA" &&
                            ldsExcel.Tables[0].Columns[i].ColumnName.ToUpper() != "DNI" &&
                            ldsExcel.Tables[0].Columns[i].ColumnName.ToUpper() != "IMPORTE")
                        {
                            //ldsExcel.Tables[0].Columns.RemoveAt(i);
                            ColQuitar.Add(ldsExcel.Tables[0].Columns[i].ColumnName);
                        }
                    }
                    //Si hay columnas a remover
                    if (ColQuitar.ToArray().Count() > 0)
                    {
                        foreach (string colu in ColQuitar.ToArray())
                        {
                            ldsExcel.Tables[0].Columns.Remove(colu);
                        }
                    }

                    excel.InsertarDatosExcel(ldsExcel, "Micrositio_Haberes" + "UPDATE" + Global.getSession() + Global.GetEmpresa().CodEmp + Global.GetGlobalAcreditacion());
                }
                string CMD = string.Format("Exec SP_CargaMasiva_Empleados '{0}','{1}','{2}','{3}', '{4}'", 2, Global.getSession(), Global.GetEmpresa().CodEmp, Global.GetGlobalAcreditacion(), Global.getFecha());
                try
                {
                    DataSet d = Utilidades.Exec(CMD);

                    Global.setPreview(da.GetPreview(d));

                    return(RedirectToAction("CargaMasiva"));
                }
                catch (Exception e)
                {
                    Global.setError(e.Message);
                    log.Error(e.Message);
                    return(RedirectToAction("CargaMasiva"));

                    throw;
                }
            }
            catch (Exception e)
            {
                Global.setError(e.Message);
                log.Error(e.Message);
                return(RedirectToAction("CargaMasiva"));

                throw;
            }
        }
Example #33
0
    protected void btnEnviar_Click(object sender, EventArgs e)
    {
        bool enviar = false;
        Utilidades objUtils = new Utilidades();
        Historico his = new Historico();

        #region comprobaciones

        //Comprobamos los campos obligatorios
        if (this.txtEmail.Text != string.Empty && this.txtMensaje.Text != string.Empty)
        {
            enviar = true;
            Lacierto.Text = "Tu mensaje se ha enviado con &eacute;xito. <br/>Recibir&aacute;s noticias nuestras a la mayor brevedad posible";

            //Todo los campos obligatorios son correctos, miramos si el email es una email correcto

            #region resto comprobaciones

            if (this.txtEmail.Text != string.Empty)
            {
                if (!objUtils.ValidaEmail(txtEmail.Text))
                {
                    enviar = false;
                    //El email no es correcto, mostramos el mensaje de error
                    Lerror.Text = "Vaya! El email que nos facilitas no es un email válido. <br/>(Ej: [email protected])";
                    this.txtEmail.Focus();
                }
            }

            #endregion
        }
        else
        {
            //Alguno de los campos obligatorios no ha sido rellenado comprobamos cual y mostramos el error
            if (this.txtMensaje.Text == string.Empty)
            {
                Lerror.Text = "Uy! Parece que se te ha olvidado decirnos tu mensaje.";
                this.txtMensaje.Focus();
            }

            if (this.txtEmail.Text == string.Empty)
            {
                Lerror.Text = "Vaya! Has olvidado poner un email de contacto.<br/>Lo necesitamos para poder contestarte.";
                this.txtEmail.Focus(); ;
            }
        }

        #endregion

        #region envio

        if (enviar)
        {
            try
            {
                this.EnviarCorreo(this.txtNombre.Text,this.txtAsunto.Text,this.txtEmail.Text,this.txtMensaje.Text);

                //Vemos si quiere recibir la newsletter
                if (chkNewsletter.Checked)
                    his.anadirNewsletter(this.txtNombre.Text, this.txtEmail.Text);

                this.filaError.Visible = false;
                this.filaAcierto.Visible = true;
                this.btnEnviar.Enabled = false;
            }
            catch (Exception)
            {
                Lerror.Text = "Vaya! Se ha producido un error durante el envío. Por favor int&eacute;ntalo m&aacute;s tarde.";
                this.filaError.Visible = true;
                this.filaAcierto.Visible = false;
            }
        }
        else
        {
            this.filaError.Visible = true;
            this.filaAcierto.Visible = false;
        }

        #endregion
    }