private void button2_Click(object sender, EventArgs e)
        {
            String MaCH = fCH.layMaCH();

            HDBan.insertData(txt_MaHD.Text, MaCH, cmb_MaKH.SelectedValue.ToString(), date(), txt_ThongTin.Text, cmb_MaNV.SelectedValue.ToString());
            for (int i = 0; i < dataGridView1.RowCount - 1; i++)
            {
                //MessageBox.Show(" " + dataGridView1.Rows[i].Cells[0]);
                string MaHDBan    = txt_MaHD.Text;
                string cotMaSP    = dataGridView1.Rows[i].Cells[0].Value.ToString();
                string cotSoLuong = dataGridView1.Rows[i].Cells[3].Value.ToString();
                CTHDBan.insertData(MaHDBan, cotMaSP, cotSoLuong);
                SPTCH.BoSP(macuahang, cotMaSP, cotSoLuong);
            }

            fCH.load();
            this.Close();

            //CTHDBan.insertData()
        }
Esempio n. 2
0
 private void Form1_Load(object sender, EventArgs e)
 {
     Cmb_QuanLy.DataSource    = QL.getData();
     Cmb_QuanLy.DisplayMember = "TenQuanLy";
     Cmb_QuanLy.ValueMember   = "MaNgQuanLy";
     textBox1.Text            = CH2.layMaCH();
     textBox2.Text            = CH2.layTenCH();
     textBox3.Text            = CH2.laySDTCH();
     richTextBox1.Text        = CH2.layDiaChiCH();
     Cmb_QuanLy.DisplayMember = CH2.layNgQLCH();
 }
 public HoaDonBan(CuaHang fCH1)
 {
     InitializeComponent();
     fCH       = fCH1;
     macuahang = fCH1.layMaCH();
 }