コード例 #1
0
 public DataSet GetAll_Consulta(string empresaid, tb_plla_pdt_tabla12 BE)
 {
     using (SqlConnection cnx = new SqlConnection(conex.empConexion(empresaid)))
     {
         using (SqlCommand cmd = new SqlCommand("gspTbPllaPdtTabla12_CONSULTA", cnx))
         {
             DataSet ds = new DataSet();
             {
                 cmd.CommandType = CommandType.StoredProcedure;
                 cmd.Parameters.AddWithValue("@tipcontratoid", string.IsNullOrEmpty(BE.tipcontratoid) ? (object)DBNull.Value : BE.tipcontratoid);
                 cmd.Parameters.AddWithValue("@relcodigotipo", string.IsNullOrEmpty(BE.relcodigotipo) ? (object)DBNull.Value : BE.relcodigotipo);
                 cmd.Parameters.AddWithValue("@descriplike1", string.IsNullOrEmpty(BE.descriplike1) ? (object)DBNull.Value : BE.descriplike1);
                 cmd.Parameters.AddWithValue("@descriplike2", string.IsNullOrEmpty(BE.descriplike2) ? (object)DBNull.Value : BE.descriplike2);
                 cmd.Parameters.AddWithValue("@descriplike3", string.IsNullOrEmpty(BE.descriplike3) ? (object)DBNull.Value : BE.descriplike3);
                 cmd.Parameters.Add("@norden", SqlDbType.Int).Value = BE.norden;
                 cmd.Parameters.Add("@incluir_blanco", SqlDbType.Int).Value = BE.incluir_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);
             }
         }
     }
 }
コード例 #2
0
 public bool Delete(string empresaid, tb_plla_pdt_tabla12 BE)
 {
     using (SqlConnection cnx = new SqlConnection(conex.empConexion(empresaid)))
     {
         using (SqlCommand cmd = new SqlCommand("gspTbPllaPdtTabla12_DELETE", cnx))
         {
             {
                 cmd.CommandType = CommandType.StoredProcedure;
                 cmd.Parameters.Add("@tipcontratoid", SqlDbType.Char, 2).Value = BE.tipcontratoid;
             }
             try
             {
                 cnx.Open();
                 if (cmd.ExecuteNonQuery() > 0)
                 {
                     return true;
                 }
                 else
                 {
                     return false;
                 }
             }
             catch (Exception ex)
             {
                 Sql_Error = ex.Message;
                 throw new Exception(ex.Message);
             }
         }
     }
 }
コード例 #3
0
 public DataSet GetAll(string empresaid, tb_plla_pdt_tabla12 BE)
 {
     using (SqlConnection cnx = new SqlConnection(conex.empConexion(empresaid)))
     {
         using (SqlCommand cmd = new SqlCommand("gspTbPllaPdtTabla12_SEARCH", cnx))
         {
             DataSet ds = new DataSet();
             {
                 cmd.CommandType = CommandType.StoredProcedure;
                 cmd.Parameters.Add("@tipcontratoid", SqlDbType.Char, 2).Value = BE.tipcontratoid;
                 cmd.Parameters.Add("@tipcontratoname", SqlDbType.VarChar, 50).Value = BE.tipcontratoname;
             }
             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);
             }
         }
     }
 }
コード例 #4
0
 void llenar_TipoContrato()
 {
     tb_plla_pdt_tabla12BL BL = new tb_plla_pdt_tabla12BL();
     tb_plla_pdt_tabla12 BE = new tb_plla_pdt_tabla12();
     BE.norden = 1;
     BE.incluir_blanco = 1;
     cmbtipcontrato.ValueMember = "tipcontratoid";
     cmbtipcontrato.DisplayMember = "descripcion";
     cmbtipcontrato.DataSource = BL.GetAll_Consulta(VariablesPublicas.EmpresaID, BE).Tables[0];
 }