Exemple #1
0
        private void toolStripSửa_Click(object sender, EventArgs e)
        {
            try
            {
                DataGridViewRow r  = datagridviewKH.SelectedRows[0];
                KhachHang_DTO   kh = new KhachHang_DTO();
                kh.MaKH     = (int)r.Cells["MaKH"].Value;
                kh.TenKh    = r.Cells["TenKh"].Value.ToString();
                kh.DiaChi   = r.Cells["DiaChi"].Value.ToString();
                kh.SDT      = r.Cells["SDT"].Value.ToString();
                kh.NgaySinh = r.Cells["NgaySinh"].Value.ToString();

                M_KhachHangEdit form = new M_KhachHangEdit(kh);
                form.Text = "CHỈNH SỬA THÔNG TIN KHÁCH HÀNG";

                DialogResult dr = form.ShowDialog();
                if (dr == DialogResult.OK)
                {
                    loaddatagridview(this.kh.SelectTop(0));
                }
            }
            catch (Exception)
            {
                //MessageBox.Show(e.ToString() + "\nNếu chưa chọn dòng nào hãy chọn 1 dòng");
            }
        }
        private void btnThemKhachHang_Click(object sender, EventArgs e)
        {
            M_KhachHangEdit them = new M_KhachHangEdit();

            them.ShowDialog();
            if (them.DialogResult == DialogResult.OK)
            {
                cbbKH.DataSource    = mh.LayKH();
                cbbKH.DisplayMember = "TenKh";
                cbbKH.ValueMember   = "MaKh";
            }
        }
        private void btnThemKhachHang_Click(object sender, EventArgs e)
        {
            M_KhachHangEdit them = new M_KhachHangEdit();

            them.ShowDialog();
            if (them.DialogResult == DialogResult.OK)
            {
                comboBox_MaKhachHang.DataSource    = phiedichvu_bus.LayDSMaKhachHang();
                comboBox_MaKhachHang.DisplayMember = "TenKh";
                comboBox_MaKhachHang.ValueMember   = "MaKh";
            }
        }
Exemple #4
0
        private void buttonThemKH_Click(object sender, EventArgs e)
        {
            M_KhachHangEdit form = new M_KhachHangEdit();
            DialogResult    dr   = form.ShowDialog();

            if (dr == DialogResult.OK)
            {
                var x = KhachHang.SelectTop(0);
                comboBoxKhachHang.DataSource    = x;
                comboBoxKhachHang.SelectedValue = x.Last().MaKH;
            }
        }
Exemple #5
0
        private void toolstripThem_Click(object sender, EventArgs e)
        {
            M_KhachHangEdit form = new M_KhachHangEdit();

            form.Text = "THÊM THÔNG TIN KHÁCH HÀNG";

            DialogResult dr = form.ShowDialog();

            if (dr == DialogResult.OK)
            {
                loaddatagridview(this.kh.SelectTop(0));
            }
        }