Пример #1
0
        private void btnQLPK_Click(object sender, EventArgs e)
        {
            frmQuanLyPhanKhoi f = new frmQuanLyPhanKhoi();

            this.Hide();
            f.Show();
        }
Пример #2
0
        private void btnXoa_Click(object sender, EventArgs e)
        {
            string sSoPK = txtSoPK.Text;

            if (sSoPK != string.Empty)
            {
                if (xlCSDL.deletePhanKhoi(sSoPK) > 0)
                {
                    MessageBox.Show("Xóa phân khối: " + sSoPK + " thành công !");
                    this.Hide();
                    frmQuanLyPhanKhoi fTrangChu = new frmQuanLyPhanKhoi();
                    fTrangChu.Show();
                }
                else
                {
                    MessageBox.Show("Không tồn tại phân khối: " + sSoPK);
                }
            }
        }
Пример #3
0
        private void btnSua_Click(object sender, EventArgs e)
        {
            string sMaPK = txtMaPK.Text;
            string sSoPK = txtSoPK.Text;

            try
            {
                if (sMaPK != string.Empty && sSoPK != string.Empty)
                {
                    if (kiemTraSo(sSoPK) == true)
                    {
                        sSoPK = int.Parse(txtSoPK.Text).ToString();
                        if (xlCSDL.updatePhanKhoi(sMaPK, sSoPK) > 0)
                        {
                            MessageBox.Show("Sửa phân khối: " + sSoPK + " thành công !");
                            this.Hide();
                            frmQuanLyPhanKhoi fTrangChu = new frmQuanLyPhanKhoi();
                            fTrangChu.Show();
                        }
                        else
                        {
                            MessageBox.Show("Sửa không thành công !");
                        }
                    }
                    else
                    {
                        MessageBox.Show("Không được nhập phân khối xe là chữ ! ");
                    }
                }
                else
                {
                    MessageBox.Show("Không được để các trường trống !");
                }
            }
            catch (Exception ex)
            {
                System.Windows.Forms.MessageBox.Show("Lỗi: " + ex);
            }
        }
Пример #4
0
        private void btnThem_Click(object sender, EventArgs e)
        {
            string sPhanKhoi = txtSoPK.Text;

            try
            {
                if (sPhanKhoi != string.Empty)
                {
                    if (kiemTraSo(sPhanKhoi) == true)
                    {
                        sPhanKhoi = int.Parse(txtSoPK.Text).ToString();
                        if (xlCSDL.insertPhanKhoi(sPhanKhoi) > 0)
                        {
                            MessageBox.Show("Thêm phân khối: " + sPhanKhoi + " thành công !");
                            this.Hide();
                            frmQuanLyPhanKhoi fTrangChu = new frmQuanLyPhanKhoi();
                            fTrangChu.Show();
                        }
                        else
                        {
                            MessageBox.Show("Thêm phân khối không thành công !");
                        }
                    }
                    else
                    {
                        MessageBox.Show("Không được nhập phân khối là chữ ! ");
                    }
                }
                else
                {
                    MessageBox.Show("Không được để các trường trống !");
                }
            }
            catch (Exception ex)
            {
                System.Windows.Forms.MessageBox.Show("Lỗi: " + ex);
            }
        }