Beispiel #1
0
        private void btnLuu_Click(object sender, EventArgs e)
        {
            CapDoDao cdd = new CapDoDao();

            try
            {
                if (txtMaCD.Text == "" || txtTenCD.Text == "")
                {
                    XtraMessageBox.Show("Bạn chưa điền đầy đủ thông tin", "Thông báo");
                }
                else
                {
                    if (cdd.kiemtratontai(txtMaCD.Text) == 0)
                    {
                        CapDoDao cd = new CapDoDao();
                        cd.ThemCD(txtMaCD.Text, txtTenCD.Text);
                        XtraMessageBox.Show("Thêm thành công", "Thông báo");
                        this.Close();
                    }
                    else
                    {
                        XtraMessageBox.Show("Mã bạn nhập đã có sẵn!");
                    }
                }
            }
            catch (Exception ex)
            {
                XtraMessageBox.Show("Có lỗi xảy ra", "Thông báo");
            }
        }
 private void btnLuu_Click(object sender, EventArgs e)
 {
     try
     {
         if (txtMaKH.Text == "" || txtCMND.Text == "" || txtDiaChi.Text == "" || cboGioiTinh.Text == "" || dtmNgaySinh.Text == "" || txtSdt.Text == "" || cboTenCD.Text == "" || txtTenKH.Text == "")
         {
             XtraMessageBox.Show("Mời Nhập Đủ Thông Tin", "Thông Báo");
         }
         else
         {
             string       MaCD;
             KhachHangDao kh = new KhachHangDao();
             CapDoDao     cd = new CapDoDao();
             MaCD = cd.MaCD(cboTenCD.Text);
             kh.suakhachhang(txtMaKH.Text, txtTenKH.Text, MaCD, dtmNgaySinh.DateTime, cboGioiTinh.Text, txtDiaChi.Text, txtSdt.Text, txtCMND.Text, ima);
             XtraMessageBox.Show("Sửa Thành Công", "Thông Báo");
             this.refresh();
         }
     }
     catch (Exception ex)
     {
         string   loi      = ex.InnerException.ToString();
         string[] loichia  = loi.Split('\n');
         string[] loichinh = loichia[0].Split(':');
         XtraMessageBox.Show(loichinh[2]);
     }
 }
Beispiel #3
0
        private void btnThem_Click(object sender, EventArgs e)
        {
            ThemCapDo tcd = new ThemCapDo();

            tcd.ShowDialog();
            CapDoDao cd = new CapDoDao();

            capDoesBindingSource.DataSource = cd.Load();
        }
        public SuaCapDoKH(string MaKH, string TenKH, string MaCD, string TenCD, ucQuanLyCapDoKH ff)
        {
            InitializeComponent();
            CapDoDao cd = new CapDoDao();

            capDoesBindingSource.DataSource = cd.Load();
            txtMaKH.Text  = MaKH;
            txtTenKH.Text = TenKH;
            txtMaCD.Text  = MaCD;
            txtTenCD.Text = TenCD;
            f             = ff;
        }
Beispiel #5
0
        private void btnRefresh_Click(object sender, EventArgs e)
        {
            CapDoDao cd = new CapDoDao();

            capDoesBindingSource.DataSource = cd.Load();

            txtMaCD.Text     = "";
            txtTenCD.Text    = "";
            txtTenCD.Enabled = false;
            btnLuu.Visible   = false;
            btnHuy.Visible   = false;
        }
        public ThemKH(ucQuanLyThongTinKhachHang ff)
        {
            InitializeComponent();
            CapDoDao cd = new CapDoDao();

            foreach (var item in cd.GetCapDo())
            {
                comboBoxEdit1.Properties.Items.Add(item);
            }
            f = ff;
            KhachHangDao kh = new KhachHangDao();

            txtMaKH.Text = kh.getlastkhachhang();
        }
        public ucQuanLyCapDoKH()
        {
            InitializeComponent();
            KhachHangDao kh = new KhachHangDao();

            khachHangsBindingSource.DataSource = kh.Load();
            refresh();
            CapDoDao cd = new CapDoDao();

            foreach (var item in cd.GetCapDo())
            {
                cboMaCV.Properties.Items.Add(item);
            }
        }
Beispiel #8
0
        public ucQuanLyThongTinKhachHang(string manvhientai1)
        {
            InitializeComponent();
            KhachHangDao kh = new KhachHangDao();

            khachHangsBindingSource.DataSource = kh.Load();
            manvhientai = manvhientai1;
            CapDoDao cd = new CapDoDao();

            foreach (var item in cd.GetTenCD())
            {
                cboTenCD.Properties.Items.Add(item);
            }
            checkxemaidangsudung(manvhientai);
        }
Beispiel #9
0
 private void btnXoa_Click(object sender, EventArgs e)
 {
     if (txtMaCD.Text == "")
     {
         XtraMessageBox.Show("Bạn chưa chọn dòng!!");
     }
     else
     {
         DialogResult dialogResult = XtraMessageBox.Show("Xác nhận", "Bạn thực sự muốn xóa?", MessageBoxButtons.YesNo);
         if (dialogResult == DialogResult.Yes)
         {
             CapDoDao cd = new CapDoDao();
             cd.XoaCD(txtMaCD.Text);
             XtraMessageBox.Show("Xóa thành công!!");
             capDoesBindingSource.DataSource = cd.Load();
             reset();
         }
     }
 }
 private void btnLuu_Click(object sender, EventArgs e)
 {
     try
     {
         if (txtMaCD.Text == "" || txtTenCD.Text == "")
         {
             XtraMessageBox.Show("Điền đầy đủ thông tin", "Thông báo");
         }
         else
         {
             CapDoDao cd = new CapDoDao();
             cd.ThemCD(txtMaCD.Text, txtTenCD.Text);
             XtraMessageBox.Show("Thêm thành công", "Thông báo");
         }
     }
     catch (Exception ex)
     {
         XtraMessageBox.Show("Có lỗi xảy ra", "Thông báo");
     }
 }
Beispiel #11
0
 private void btnLuu_Click(object sender, EventArgs e)
 {
     try
     {
         if (txtMaCD.Text == "" || txtTenCD.Text == "")
         {
             XtraMessageBox.Show("Điền Đầy Đủ Thông Tin", "Thông báo");
         }
         else
         {
             CapDoDao cd = new CapDoDao();
             cd.SuaCD(txtMaCD.Text, txtTenCD.Text);
             XtraMessageBox.Show("Sửa thành công", "Thông báo");
             capDoesBindingSource.DataSource = cd.Load();
         }
     }
     catch (Exception ex)
     {
         XtraMessageBox.Show("Có lỗi xảy ra", "Thông báo");
     }
 }
Beispiel #12
0
 private void btnLuu_Click(object sender, EventArgs e)
 {
     try
     {
         if (txtMaKH.Text == "" || txtCMND.Text == "" || txtDiaChi.Text == "" || cboGioiTinh.Text == "" || dtmNgaySinh.Text == "" || txtSdt.Text == "" || cboTenCD.Text == "" || txtTenKH.Text == "")
         {
             MessageBox.Show("Mời Nhập Đủ Thông Tin");
         }
         else
         {
             string       MaCD;
             KhachHangDao kh = new KhachHangDao();
             CapDoDao     cd = new CapDoDao();
             MaCD = cd.MaCD(cboTenCD.Text);
             kh.suakhachhang(txtMaKH.Text, txtTenKH.Text, MaCD, dtmNgaySinh.DateTime, cboGioiTinh.Text, txtDiaChi.Text, txtSdt.Text, txtCMND.Text, ima);
             MessageBox.Show("Sửa Thành Công");
             this.refresh();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("Chọn Khách Hàng Cần Sửa");
     }
 }
        private void comboBoxEdit1_SelectedIndexChanged(object sender, EventArgs e)
        {
            CapDoDao cd = new CapDoDao();

            txtTenCV.Text = cd.TenCD(cboMaCV.Text);
        }
Beispiel #14
0
        private void btnRefresh_Click(object sender, EventArgs e)
        {
            CapDoDao cd = new CapDoDao();

            capDoesBindingSource.DataSource = cd.Load();
        }