public DataSet GetAll_Consulta(string empresaid, tb_plla_pdt_tabla13 BE) { using (SqlConnection cnx = new SqlConnection(conex.empConexion(empresaid))) { using (SqlCommand cmd = new SqlCommand("gspTbPllaPdtTabla13_CONSULTA", cnx)) { DataSet ds = new DataSet(); { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add("@periremid", SqlDbType.Char, 1).Value = BE.periremid; cmd.Parameters.Add("@periremname", SqlDbType.VarChar, 60).Value = BE.periremname; } try { cnx.Open(); using (SqlDataAdapter da = new SqlDataAdapter(cmd)) { da.Fill(ds); } return ds; } catch (Exception ex) { Sql_Error = ex.Message; throw new Exception(ex.Message); } } } }
public bool Delete(string empresaid, tb_plla_pdt_tabla13 BE) { using (SqlConnection cnx = new SqlConnection(conex.empConexion(empresaid))) { using (SqlCommand cmd = new SqlCommand("gspTbPllaPdtTabla13_DELETE", cnx)) { { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add("@periremid", SqlDbType.Char, 1).Value = BE.periremid; } try { cnx.Open(); if (cmd.ExecuteNonQuery() > 0) { return true; } else { return false; } } catch (Exception ex) { Sql_Error = ex.Message; throw new Exception(ex.Message); } } } }
public bool Update(string empresaid, tb_plla_pdt_tabla13 BE) { //return tablaDA.Update(empresaid, BE); bool zreturn = tablaDA.Update(empresaid, BE); Sql_Error = tablaDA.Sql_Error; return zreturn; }
public DataSet GetAll_Consulta(string empresaid, tb_plla_pdt_tabla13 BE) { //return tablaDA.GetAll_Consulta(empresaid, BE); DataSet xreturn = null; xreturn = tablaDA.GetAll_Consulta(empresaid, BE); Sql_Error = tablaDA.Sql_Error; return xreturn; }
private BindingSource NewMethodoP() { var BL = new tb_plla_pdt_tabla13BL(); var BE = new tb_plla_pdt_tabla13(); var table = BL.GetAll(VariablesPublicas.EmpresaID.ToString(), BE).Tables[0]; var rows = table.Rows; object[] cell; var dic = new Dictionary<string, string>(); var binding = new BindingSource(); foreach (DataRow item in rows) { cell = item.ItemArray; dic.Add(cell[0].ToString(), cell[0].ToString() + " - " + cell[1].ToString()); cell = null; } binding.DataSource = dic; return binding; }