Example #1
0
 protected void btnNuevo_Click(object sender, EventArgs e)
 {
     try
     {
         Grupo grupo = new Grupo();
         grupo.idGrupo      = 0;
         grupo.nombreUnidad = nombreUnidad.Text;
         LugarAtencion lugarAtencion = new LugarAtencion();
         lugarAtencion.id_lugarAtencion = Convert.ToInt32(DropDownListlugarAtencion.SelectedValue);
         grupo.lugarAtencion            = lugarAtencion;
         TipoEstable tipoEstable = new TipoEstable();
         tipoEstable.id_tipoEstable = Convert.ToInt32(DropDownListTipoEstablecimiento.SelectedValue);
         grupo.tipoEstable          = tipoEstable;
         InstitucionSistema institucionSistema = new InstitucionSistema();
         institucionSistema.id_institucionSistema = Convert.ToInt32(DropDownListInstituciondelSistema.SelectedValue);
         grupo.institucionSistema = institucionSistema;
         grupo.profecional        = profecional;
         LNGrupo ln = new LNGrupo();
         ln.Insertar(grupo);
         //Response.Write("<script>alert(' Ingreso Correcto')</script>");
         ScriptManager.RegisterStartupScript(this, GetType(), "Popup", "AlertReload('Creación!','Se Realizo Correctamente','success','OK');", true);
         // Response.Redirect(GetRouteUrl("GruposRoute", null));
     }
     catch (Exception ex)
     {
         Response.Write("<script>alert('" + ex.Message + "')</script>");
     }
 }
Example #2
0
 protected void btnEditarPanel_Click(object sender, EventArgs e)
 {
     //editar
     try
     {
         Grupo item = grupoEdit;
         item.nombreUnidad = nombreUnidadEdit.Text;
         LugarAtencion lugarAtencion = new LugarAtencion();
         lugarAtencion.id_lugarAtencion = Convert.ToInt32(DropDownListlugarAtencionEdit.SelectedValue);
         item.lugarAtencion             = lugarAtencion;
         TipoEstable tipoEstable = new TipoEstable();
         tipoEstable.id_tipoEstable = Convert.ToInt32(DropDownListTipoEstablecimientoEdit.SelectedValue);
         item.tipoEstable           = tipoEstable;
         InstitucionSistema institucionSistema = new InstitucionSistema();
         institucionSistema.id_institucionSistema = Convert.ToInt32(DropDownListInstituciondelSistemaEdit.SelectedValue);
         item.institucionSistema = institucionSistema;
         item.profecional        = profecional;
         LNGrupo ln = new LNGrupo();
         ln.UpdateG(grupoEdit);
         ScriptManager.RegisterStartupScript(this, GetType(), "Popup", "AlertReload('Actualización!','Se Realizo Correctamente','success','OK');", true);
         //Response.Redirect(GetRouteUrl("GruposRoute", null));
     }
     catch (Exception ex)
     {
         System.Diagnostics.Debug.WriteLine("Error.." + ex.Message);
         Response.Write("<script>alert('" + ex.Message + "')</script>");
     }
 }
Example #3
0
        public TipoEstable TipoEstableId(TipoEstable TipoEstable)
        {
            TipoEstable grup = null;
            BaseDatos   bd   = new BaseDatos();

            bd.Conectar();
            bd.CrearComandoStrSql("select * from TipoEstable where id_TipoEstable=@id_TipoEstable");
            bd.AsignarParametroInt("@id_TipoEstable", TipoEstable.id_tipoEstable);

            foreach (TipoEstable item in Mapear(bd.EjecutarConsulta()))
            {
                grup = item;
            }
            bd.Desconectar();

            return(grup);
        }
Example #4
0
        private List <TipoEstable> Mapear(System.Data.Common.DbDataReader Datos)
        {
            List <TipoEstable> list = new List <TipoEstable>();


            while (Datos.Read())
            {
                TipoEstable item = new TipoEstable();

                item.id_tipoEstable = Convert.ToInt32(Datos.GetValue(0));
                item.codigo         = Convert.ToInt32(Datos.GetValue(1));
                item.descrpcion     = Convert.ToString(Datos.GetValue(2));

                list.Add(item);
            }
            return(list);
        }