Example #1
0
        private void orderToolStripMenuItem_Click(object sender, EventArgs e)
        {
            ListViewItem item = listviewitem.SelectedItems[0];

            cId = int.Parse(item.SubItems[0].Text);

            Bill bill = new Bill();

            bill.ComputerId = cId;


            billBLL.GetBillId(bill);
            Order order = new Order();

            order.lblBillID.Text = StaticClass.BillID.ToString();

            using (var con = SQLfunctions.GetConnection())
            {
                using (var cmd = SQLfunctions.Command(con, cmdText: "GetProduct", cmdType: CommandType.StoredProcedure))
                {
                    using (SqlDataReader dr = cmd.ExecuteReader())
                    {
                        while (dr.Read())
                        {
                            order.cmbProduct.Items.Add(dr[0]);
                        }
                    }
                }
            }
            order.ShowDialog();
        }
 public void BindData()
 {
     using (var con = SQLfunctions.GetConnection())
     {
         using (var cmd = SQLfunctions.Command(con, cmdText: "GetClient", cmdType: CommandType.StoredProcedure))
         {
             using (SqlDataReader dr = cmd.ExecuteReader())
             {
                 while (dr.Read())
                 {
                     cmbClientID.Items.Add(dr[0]);
                 }
             }
         }
     }
 }