예제 #1
0
        protected void EditarRegistro(object sender, EventArgs e)
        {
            string ruta = string.Empty;

            if (flpArchivoEdit.HasFile)
            {
                ruta = Utilidades.GuardarArchivo(flpArchivoEdit, txtNombreEdit.Text, "~/archivos/ico_tipo_epp/");
            }

            GrupoLiEntities contexto  = new GrupoLiEntities();
            int             idTipoEpp = Convert.ToInt32(hdfIdEppEdit.Value);
            tipo_epp        Edit      = contexto.tipo_epp.SingleOrDefault(b => b.id_tipo_epp == idTipoEpp);

            int IdEmpresa = Mgr_Empresa.Set_IdEmpresaDDl(ObjUsuario, ddlEmpresaEdit);

            if (Edit != null)
            {
                Edit.nombre       = txtNombreEdit.Text;
                Edit.nombre_senal = txtNombreSenalEdit.Text;
                if (ruta.Length > 0)
                {
                    Edit.url_senal = ruta;
                }
            }
            ObjUsuario.Error = CRUD.Edit_Fila(contexto);

            Modal.MostrarAlertaEdit(phAlerta, divAlerta, lbAlerta, ObjUsuario.Error, txtBuscar);
            LlenarGridView();
        }
예제 #2
0
        protected void EliminarRegistro(object sender, EventArgs e)
        {
            tipo_epp tabla = new tipo_epp();

            ObjUsuario.Error = CRUD.Delete_Fila(tabla, Convert.ToInt32(hdfIDEppDel.Value));
            Modal.MostrarAlertaDelete(phAlerta, divAlerta, lbAlerta, ObjUsuario.Error, txtBuscar);
            LlenarGridView();
        }
예제 #3
0
        protected void AgregarRegistro(object sender, EventArgs e)
        {
            string ruta      = Utilidades.GuardarArchivo(flpArchivo, txtNombreEdit.Text, "~/archivos/ico_tipo_epp/");
            int    IdEmpresa = Mgr_Empresa.Set_IdEmpresaDDl(ObjUsuario, ddlEmpresaAdd);

            tipo_epp nuevo = new tipo_epp()
            {
                nombre       = txtNombreAdd.Text,
                nombre_senal = txtNombreSenalAdd.Text,
                url_senal    = ruta
            };

            ObjUsuario.Error = CRUD.Add_Fila(nuevo);

            Modal.MostrarAlertaAdd(phAlerta, divAlerta, lbAlerta, ObjUsuario.Error, txtBuscar);
            LlenarGridView();
        }