예제 #1
0
        private void button2_Click(object sender, EventArgs e)
        {
            HDXK.insertData(txt_MaHD.Text, txt_Kho.Text, cmb_CH.SelectedValue.ToString(), date(), cmb_NgQuanLy.SelectedValue.ToString());
            for (int i = 0; i < dataGridView1.RowCount - 1; i++)
            {
                //MessageBox.Show(" " + dataGridView1.Rows[i].Cells[0]);
                string MaHDBan    = txt_MaHD.Text;
                string GiaNhap    = dataGridView1.Rows[i].Cells[4].Value.ToString();
                string cotMaSP    = dataGridView1.Rows[i].Cells[0].Value.ToString();
                string cotSoLuong = dataGridView1.Rows[i].Cells[3].Value.ToString();
                CTHDXK.insertData(MaHDBan, cotMaSP, cotSoLuong);
                if (SPTCH.CheckMaSP(cotMaSP, cmb_CH.SelectedValue.ToString()) == 0)
                {
                    SPTK.BoSP(cmb_CH.SelectedValue.ToString(), cotMaSP, cotSoLuong);
                    SPTCH.insertData(cmb_CH.SelectedValue.ToString(), cotMaSP, cotSoLuong);
                }
                else
                {
                    SPTK.BoSP(cmb_CH.SelectedValue.ToString(), cotMaSP, cotSoLuong);
                    SPTCH.ThemSP(cmb_CH.SelectedValue.ToString(), cotMaSP, cotSoLuong);
                }
            }

            kho.load();
            this.Close();
        }
예제 #2
0
 private void bt_Them_Click(object sender, EventArgs e)
 {
     K.insertData(txt_MaKho.Text, txt_TenKho.Text, Rtxt_DiaChi.Text, txt_SDT.Text, cmb_NgQuanLy.SelectedValue.ToString());
     if (fNK != null)
     {
         fNK.load();
     }
     ;
     if (fK != null)
     {
         fK.load();
     }
     ;
     //fK.load();
     this.Close();
 }
예제 #3
0
 private void bt_sua_Click(object sender, EventArgs e)
 {
     K.updatetData(txt_MaKho.Text, txt_TenKho.Text, Rtxt_DiaChi.Text, txt_SDT.Text, cmb_NgQuanLy.SelectedValue.ToString());
     fK.load();
     this.Close();
 }