Esempio n. 1
0
 public bool Delete(string empresaid, tb_banco BE)
 {
     using (SqlConnection cnx = new SqlConnection(conex.empConexion(empresaid))){
         using (SqlCommand cmd = new SqlCommand("gspTbBanco_DELETE", cnx))
         {
             {
                 cmd.CommandType = CommandType.StoredProcedure;
                 cmd.Parameters.Add("@bancoid", SqlDbType.Char, 2).Value = BE.bancoid;
             }
             try
             {
                 cnx.Open();
                 if (cmd.ExecuteNonQuery() > 0)
                 {
                     return true;
                 }
                 else
                 {
                     return false;
                 }
             }
             catch (Exception ex)
             {
                 throw new Exception(ex.Message);
             }
         }
     }
 }
Esempio n. 2
0
 public DataSet GetAll(string empresaid, tb_banco BE)
 {
     using (SqlConnection cnx = new SqlConnection(conex.empConexion(empresaid))){
         using (SqlCommand cmd = new SqlCommand("gspTbBanco_SEARCH", cnx))
         {
             DataSet ds = new DataSet();
             {
                 cmd.CommandType = CommandType.StoredProcedure;
                 cmd.Parameters.Add("@bancoid", SqlDbType.Char, 2).Value = BE.bancoid;
                 cmd.Parameters.Add("@banconame", SqlDbType.VarChar, 50).Value = BE.banconame;
             }
             try
             {
                 cnx.Open();
                 using (SqlDataAdapter da = new SqlDataAdapter(cmd))
                 {
                     da.Fill(ds);
                 }
                 return ds;
             }
             catch (Exception ex)
             {
                 throw new Exception(ex.Message);
             }
         }
     }
 }
Esempio n. 3
0
 public bool Update(string empresaid, tb_banco BE)
 {
     return tablaDA.Update(empresaid, BE);
 }
Esempio n. 4
0
 public bool Insert(string empresaid, tb_banco BE)
 {
     return tablaDA.Insert(empresaid, BE);
 }
Esempio n. 5
0
 public DataSet GetAll(string empresaid, tb_banco BE)
 {
     return tablaDA.GetAll(empresaid, BE);
 }
Esempio n. 6
0
 public bool Delete(string empresaid, tb_banco BE)
 {
     return tablaDA.Delete(empresaid, BE);
 }
        private BindingSource NewMethodoa()
        {
            var BL = new bancoBL();
            var BE = new tb_banco();

            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;
        }