public DataSet GetAll(string empresaid, tb_plla_pdt_tabla10 BE) { using (SqlConnection cnx = new SqlConnection(conex.empConexion(empresaid))) { using (SqlCommand cmd = new SqlCommand("gspTbPllaPdtTabla10_SEARCH", cnx)) { DataSet ds = new DataSet(); { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add("@ocupaid", SqlDbType.Char, 6).Value = BE.ocupaid; cmd.Parameters.Add("@ocupaname", SqlDbType.VarChar, 90).Value = BE.ocupaname; } 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 DataSet GetAll_Consulta(string empresaid, tb_plla_pdt_tabla10 BE) { using (SqlConnection cnx = new SqlConnection(conex.empConexion(empresaid))) { using (SqlCommand cmd = new SqlCommand("gspTbPllaPdtTabla10_CONSULTA", cnx)) { DataSet ds = new DataSet(); { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@ocupaid", string.IsNullOrEmpty(BE.ocupaid) ? (object)DBNull.Value : BE.ocupaid); cmd.Parameters.AddWithValue("@relcodigotipo", string.IsNullOrEmpty(BE.relcodigotipo) ? (object)DBNull.Value : BE.relcodigotipo); cmd.Parameters.AddWithValue("@nomlike1", string.IsNullOrEmpty(BE.nomlike1) ? (object)DBNull.Value : BE.nomlike1); cmd.Parameters.AddWithValue("@nomlike2", string.IsNullOrEmpty(BE.nomlike2) ? (object)DBNull.Value : BE.nomlike2); cmd.Parameters.AddWithValue("@nomlike3", string.IsNullOrEmpty(BE.nomlike3) ? (object)DBNull.Value : BE.nomlike3); cmd.Parameters.Add("@norden", SqlDbType.Int).Value = BE.norden; cmd.Parameters.Add("@ver_blanco", SqlDbType.Int).Value = BE.ver_blanco; } 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_tabla10 BE) { using (SqlConnection cnx = new SqlConnection(conex.empConexion(empresaid))) { using (SqlCommand cmd = new SqlCommand("gspTbPllaPdtTabla10_DELETE", cnx)) { { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add("@ocupaid", SqlDbType.Char, 6).Value = BE.ocupaid; } 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_tabla10 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_tabla10 BE) { //return tablaDA.GetAll_Consulta(empresaid, BE); DataSet xreturn = null; xreturn = tablaDA.GetAll_Consulta(empresaid, BE); Sql_Error = tablaDA.Sql_Error; return xreturn; }
private void Filtrar() { var sorted = default(SortOrder); var xnomcolumna = string.Empty; if ((dgProveedor.SortedColumn != null)) { xnomcolumna = dgProveedor.Columns[dgProveedor.SortedColumn.Index].Name; sorted = dgProveedor.SortOrder; } var xpalabra1 = string.Empty; var xpalabra2 = string.Empty; var xpalabra3 = string.Empty; if (txtdescripcion.Enabled) { xpalabra1 = VariablesPublicas.Palabras(txtdescripcion.Text, 1); xpalabra2 = VariablesPublicas.Palabras(txtdescripcion.Text, 2); xpalabra3 = VariablesPublicas.Palabras(txtdescripcion.Text, 3); } dgProveedor.DataSource = null; dgProveedor.AutoGenerateColumns = false; var BL = new tb_plla_pdt_tabla10BL(); var BE = new tb_plla_pdt_tabla10(); BE.nomlike1 = xpalabra1; BE.nomlike2 = xpalabra2; BE.nomlike3 = xpalabra3; BE.norden = 1; BE.ver_blanco = 0; dgProveedor.DataSource = BL.GetAll_Consulta(VariablesPublicas.EmpresaID, BE).Tables[0]; if (xnomcolumna.Trim().Length > 0) { if (sorted == SortOrder.Ascending) { dgProveedor.Sort(dgProveedor.Columns[xnomcolumna], System.ComponentModel.ListSortDirection.Ascending); } else { dgProveedor.Sort(dgProveedor.Columns[xnomcolumna], System.ComponentModel.ListSortDirection.Descending); } } else { dgProveedor.Sort(dgProveedor.Columns["ocupaid"], System.ComponentModel.ListSortDirection.Ascending); } VariablesPublicas.PintaEncabezados(dgProveedor); }
private void txtcodrtps_LostFocus(object sender, System.EventArgs e) { if (!(j_Cargo == txtcodrtps.Text) & u_n_opsel > 0) { if (txtcodrtps.Text.Trim().Length == 0) { txtdrtps.Text = ""; txtcodrtps.Text = ""; } else { string xnomlike1 = VariablesPublicas.Palabras(txtdrtps.Text, 1); string xnomlike2 = VariablesPublicas.Palabras(txtdrtps.Text, 2); string xnomlike3 = VariablesPublicas.Palabras(txtdrtps.Text, 3); tb_plla_pdt_tabla10BL BL = new tb_plla_pdt_tabla10BL(); tb_plla_pdt_tabla10 BE = new tb_plla_pdt_tabla10(); BE.ocupaid = txtcodrtps.Text.Trim(); //BE.nomlike1 = xnomlike1; //BE.nomlike2 = xnomlike2; //BE.nomlike3 = xnomlike3; BE.norden = 1; BE.ver_blanco = 0; tmptabla = BL.GetAll_Consulta(VariablesPublicas.EmpresaID, BE).Tables[0]; if (BL.Sql_Error.Length == 0) { if (tmptabla.Rows.Count == 0) { AyudaccostoRPTS(""); } else { if (tmptabla.Rows.Count > 0) { txtcodrtps.Text = tmptabla.Rows[0]["ocupaid"].ToString().Trim(); txtdrtps.Text = tmptabla.Rows[0]["ocupaname"].ToString(); } else { AyudaccostoRPTS(txtcodrtps.Text); } } } } } }