Exemple #1
0
        private void eliminadoFisicoRolesXUser(DataTable dt, int indexAEliminar)
        {
            DaoSP dao = new DaoSP();

            foreach (DataRow row in dt.Rows)
            {
                dao.EjecutarConQuery("DELETE FROM dropeadores.RolXUsuario WHERE rolId=" + indexAEliminar + " AND usuarioId=" + row["usuarioId"]);
            }
        }
Exemple #2
0
        public void realizarModificacion(int idRol, List <int> idsFuncionalidades, string nombreRolSeleccionado, int habilitado)
        {
            DaoSP    dao      = new DaoSP();
            RolXFunc rolxfunc = new RolXFunc();

            dao.EjecutarConQuery("UPDATE dropeadores.Rol SET nombre= '" + nombreRolSeleccionado + "', estado= " + habilitado + " WHERE Id_Rol =" + idRol);

            dao.EjecutarConQuery("delete dropeadores.FuncionalidadXRol where rolId=" + idRol);

            foreach (int unId in idsFuncionalidades)
            {
                if (dao.EjecutarSP("dropeadores.AltaRolPorFuncionalidad", idRol, unId) < 0)
                {
                    MessageBox.Show("Ha ocurrido un error..", "Error al crear el Rol",
                                    MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }
Exemple #3
0
        public void realizarModificacion(int idRol, List <int> idsFuncionalidades, string nombreRolSeleccionado)
        {
            DaoSP dao = new DaoSP();

            dao.EjecutarConQuery("UPDATE TABLE dropeadores.Rol SET nombre=" + nombreRolSeleccionado);

            //dao.EjecutarConQuery("UPDATE TABLE dropeadores.FuncionalidaXRol SET rolId=" + idRol);
            foreach (int unId in idsFuncionalidades)
            {
                //dao.EjecutarConQuery("UPDATE TABLE dropeadores.FuncionalidaXRol SET rolId=" + idRol);
            }
        }
Exemple #4
0
        public bool eliminadoLogico(int indexAEliminar)
        {
            try
            {
                DaoSP dao = new DaoSP();
                int   nroFilasAfectadas = dao.EjecutarConQuery(@"UPDATE dropeadores.Rol SET estado=0 WHERE Id_Rol =" + indexAEliminar);
                return(nroFilasAfectadas > 0 ? true : false);
            }

            catch (Exception ex)
            {
                throw ex;
            }
        }
Exemple #5
0
 public int actualizarEstado(int codigoPublicacion, int estado)
 {
     try
     {
         int   cantAfectadas = 0;
         DaoSP dao           = new DaoSP();
         //DataTable dt = new DataTable();
         string query = "update dropeadores.Publicacion set estado= " + estado +
                        " WHERE id= " + codigoPublicacion;
         cantAfectadas = dao.EjecutarConQuery(query);
         //DataRow row = dt.Rows[0];
         //id = int.Parse(row["Id"].ToString());
         return(cantAfectadas);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Exemple #6
0
 public int editarPublicacion()
 {
     try
     {
         int   cantAfectadas = 0;
         DaoSP dao           = new DaoSP();
         //DataTable dt = new DataTable();
         string query = "UPDATE DROPEADORES.PUBLICACION set gradoId= " + this.gradoId + ", rubroId= " + this.rubroId + " ,stock= " + this.stock + ",fechaEspectaculo= '" + this.fechaEspectaculo +
                        "' ,fechaPublicacion = '" + this.fechaPublicacion + "' , descripcion = '" + this.descripcion +
                        "' , direccion = '" + this.direccion + "' WHERE estado= " + this.estado + " and empresaId = '" + this.empresaId + "' and id= " + this.codigo;
         cantAfectadas = dao.EjecutarConQuery(query);
         //DataRow row = dt.Rows[0];
         //id = int.Parse(row["Id"].ToString());
         return(cantAfectadas);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }