public bool Delete(string empresaid, tb_pt_botapie BE) { using (SqlConnection cnx = new SqlConnection(conex.empConexion(empresaid))) { using (SqlCommand cmd = new SqlCommand("gspTbPtBotapie_DELETE", cnx)) { { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add("@botapieid", SqlDbType.Char, 2).Value = BE.botapieid; } try { cnx.Open(); if (cmd.ExecuteNonQuery() > 0) { return true; } else { return false; } } catch (Exception ex) { throw new Exception(ex.Message); } } } }
public DataSet GetAll_paginacion(string empresaid, tb_pt_botapie BE) { using (SqlConnection cnx = new SqlConnection(conex.empConexion(empresaid))) { using (SqlCommand cmd = new SqlCommand("gspTbPtBotapie_SEARCH_paginacion", cnx)) { DataSet ds = new DataSet(); { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add("@botapieid", SqlDbType.Char, 2).Value = BE.botapieid; cmd.Parameters.Add("@posicion", SqlDbType.Char, 10).Value = BE.posicion; } try { cnx.Open(); using (SqlDataAdapter da = new SqlDataAdapter(cmd)) { da.Fill(ds); } return ds; } catch (Exception ex) { throw new Exception(ex.Message); } } } }
private void cmb_botapieid_SelectedIndexChanged(object sender, EventArgs e) { if (ssModo == "EDIT" || ssModo == "NEW") { if (cmb_botapieid.SelectedIndex >= 0) { var BE = new tb_pt_botapie(); var BL = new tb_pt_botapieBL(); var dt = new DataTable(); BE.botapieid = cmb_botapieid.SelectedValue.ToString(); dt = BL.GetAll(EmpresaID, BE).Tables[0]; foreach (DataRow fila in dt.Rows) { _xbotapiedescort = fila["botapiedescort"].ToString().Trim(); _GenerarNombre(); } } } }
private void Cargar_cmbBotapie() { var BE = new tb_pt_botapie(); var BL = new tb_pt_botapieBL(); var dt = new DataTable(); dt = BL.GetAll(EmpresaID, BE).Tables[0]; if (dt.Rows.Count > 0) { cmb_botapieid.DataSource = dt; cmb_botapieid.ValueMember = "botapieid"; cmb_botapieid.DisplayMember = "botapiename"; } }
public bool Insert(string empresaid, tb_pt_botapie BE) { using (SqlConnection cnx = new SqlConnection(conex.empConexion(empresaid))) { using (SqlCommand cmd = new SqlCommand("gspTbPtBotapie_INSERT", cnx)) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add("@botapieid", SqlDbType.Char, 2).Value = BE.botapieid; cmd.Parameters.Add("@botapiename", SqlDbType.VarChar, 30).Value = BE.botapiename; cmd.Parameters.Add("@botapiedescort", SqlDbType.Char, 10).Value = BE.botapiedescort; cmd.Parameters.Add("@usuar", SqlDbType.Char, 15).Value = BE.usuar; try { cnx.Open(); if (cmd.ExecuteNonQuery() > 0) { return true; } else { return false; } } catch (Exception ex) { throw new Exception(ex.Message); } } } }
public bool Update(string empresaid, tb_pt_botapie BE) { return tablaDA.Update(empresaid, BE); }
public bool Insert(string empresaid, tb_pt_botapie BE) { return tablaDA.Insert(empresaid, BE); }
public DataSet GetAll_paginacion(string empresaid, tb_pt_botapie BE) { return tablaDA.GetAll_paginacion(empresaid, BE); }
public bool Delete(string empresaid, tb_pt_botapie BE) { return tablaDA.Delete(empresaid, BE); }