public DataSet GetAll_Consulta(string empresaid, tb_plla_pdt_tabla06 BE) { using (SqlConnection cnx = new SqlConnection(conex.empConexion(empresaid))) { using (SqlCommand cmd = new SqlCommand("gspTbPllaPdtTabla06_CONSULTA", cnx)) { DataSet ds = new DataSet(); { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add("@zonaid", SqlDbType.Char, 2).Value = BE.zonaid; cmd.Parameters.Add("@zonaname", SqlDbType.VarChar, 50).Value = BE.zonaname; } 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 Update(string empresaid, tb_plla_pdt_tabla06 BE) { //return tablaDA.Update(empresaid, BE); bool zreturn = tablaDA.Update(empresaid, BE); Sql_Error = tablaDA.Sql_Error; return zreturn; }
public bool Delete(string empresaid, tb_plla_pdt_tabla06 BE) { using (SqlConnection cnx = new SqlConnection(conex.empConexion(empresaid))) { using (SqlCommand cmd = new SqlCommand("gspTbPllaPdtTabla06_DELETE", cnx)) { { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add("@zonaid", SqlDbType.Char, 2).Value = BE.zonaid; } 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 DataSet GetAll_Consulta(string empresaid, tb_plla_pdt_tabla06 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 NewMethodoZona() { var BL = new tb_plla_pdt_tabla06BL(); var BE = new tb_plla_pdt_tabla06(); 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; }