public int bajaPuesto(Puestos p) { Command.CommandText = "update puestos set estatus = 0 where id = @id"; Command.Parameters.Clear(); Command.Parameters.AddWithValue("id", p.idpuesto); return Command.ExecuteNonQuery(); }
public int bajaPuesto(Puestos p) { Command.CommandText = "update puestos set estatus = @estatus where id = @id"; Command.Parameters.Clear(); Command.Parameters.AddWithValue("id", p.id); Command.Parameters.AddWithValue("estatus", p.descripcion); return(Command.ExecuteNonQuery()); }
public int actualizaPuesto(Puestos p) { Command.CommandText = "update puestos set descripcion = @descripcion where id = @id"; Command.Parameters.Clear(); Command.Parameters.AddWithValue("id", p.id); Command.Parameters.AddWithValue("descripcion", p.descripcion); return(Command.ExecuteNonQuery()); }
public int insertaPuesto(Puestos p) { Command.CommandText = "insert into puestos (descripcion, estatus) values (@descripcion,@estatus)"; Command.Parameters.Clear(); Command.Parameters.AddWithValue("descripcion", p.descripcion); Command.Parameters.AddWithValue("estatus", p.estatus); return(Command.ExecuteNonQuery()); }
public int actualizaPuesto(Puestos p) { Command.CommandText = "update puestos set descripcion = @descripcion where id = @id"; Command.Parameters.Clear(); Command.Parameters.AddWithValue("id",p.idpuesto); Command.Parameters.AddWithValue("descripcion", p.nombre); return Command.ExecuteNonQuery(); }
public int insertaPuesto(Puestos p) { Command.CommandText = "insert into puestos (descripcion, estatus, idempresa) values (@descripcion,@estatus,@idempresa)"; Command.Parameters.Clear(); Command.Parameters.AddWithValue("descripcion", p.nombre); Command.Parameters.AddWithValue("estatus",p.estatus); Command.Parameters.AddWithValue("idempresa", p.idempresa); return Command.ExecuteNonQuery(); }
public List <Puestos> obtenerPuestos() { DataTable dtPuestos = new DataTable(); List <Puestos> lstPuestos = new List <Puestos>(); Command.CommandText = "select id, descripcion from puestos"; Command.Parameters.Clear(); dtPuestos = SelectData(Command); for (int i = 0; i < dtPuestos.Rows.Count; i++) { Puestos p = new Puestos(); p.id = int.Parse(dtPuestos.Rows[i]["id"].ToString()); p.descripcion = dtPuestos.Rows[i]["descripcion"].ToString(); lstPuestos.Add(p); } return(lstPuestos); }
public List<Puestos> obtenerPuestos(Puestos puesto) { DataTable dtPuestos = new DataTable(); List<Puestos> lstPuestos = new List<Puestos>(); Command.CommandText = "select id, descripcion from puestos where estatus = 1 and idempresa = @idempresa"; Command.Parameters.Clear(); Command.Parameters.AddWithValue("idempresa", puesto.idempresa); dtPuestos = SelectData(Command); for (int i = 0; i < dtPuestos.Rows.Count; i++) { Puestos p = new Puestos(); p.idpuesto = int.Parse(dtPuestos.Rows[i]["id"].ToString()); p.nombre = dtPuestos.Rows[i]["descripcion"].ToString(); lstPuestos.Add(p); } return lstPuestos; }