public void ShearhName(DataGridView dgv, string nombre) { MotivoModel objMod = new MotivoModel(); MotivoEntity objEnt = new MotivoEntity(); objEnt.Nombre = nombre; objMod.BuscarMotivo(dgv, nombre); }
public void Update(MotivoEntity objEnt) { con = objCon.Conectar(); con.Open(); SqlCommand cmd = new SqlCommand(); cmd.CommandText = "SP_UPD_MOTIVO"; cmd.CommandType = CommandType.StoredProcedure; cmd.Connection = con; cmd.Parameters.Add("@ID", SqlDbType.Int).Value = objEnt.IdMotivo; cmd.Parameters.Add("@NOMBRE", SqlDbType.VarChar, 50).Value = objEnt.Nombre; try { cmd.ExecuteNonQuery(); } catch (Exception) { throw; } }
public DataTable ListDetMotPorIdMotivo(MotivoEntity objEnt) { con = objCon.Conectar(); con.Open(); DataTable dt = new DataTable(); try { SqlDataAdapter da = new SqlDataAdapter("SP_LIST_DET_MOT_POR_ID_MOTIVO", con); da.SelectCommand.CommandType = CommandType.StoredProcedure; da.SelectCommand.Parameters.Add("@ID", SqlDbType.Int).Value = objEnt.IdMotivo; da.Fill(dt); } catch (Exception) { dt = null; } return(dt); }
public void Delete(MotivoEntity objEnt) { MotivoModel objMod = new MotivoModel(); objMod.Delete(objEnt); }
public void Update(MotivoEntity objEnt) { MotivoModel objMod = new MotivoModel(); objMod.Update(objEnt); }
public void Add(MotivoEntity objEnt) { MotivoModel objMod = new MotivoModel(); objMod.Insert(objEnt); }
public void ListOficina(DataGridView dgv, MotivoEntity objEnt) { var tabla = this.ListDetMotPorIdMotivo(objEnt); this.LIstarGrid(dgv, tabla); }
public void ListDetMotPorIdMot(DataGridView dgv, MotivoEntity objEnt) { objDetMot.ListOficina(dgv, objEnt); }