Пример #1
0
        private void btnTroVe_Click(object sender, EventArgs e)
        {
            this.Hide();
            frmQuanLyXeMay fTrangChu = new frmQuanLyXeMay();

            fTrangChu.Show();
        }
Пример #2
0
        private void btnQLXM_Click(object sender, EventArgs e)
        {
            frmQuanLyXeMay f = new frmQuanLyXeMay();

            this.Hide();
            f.Show();
        }
Пример #3
0
        private void btnTroVe_Click(object sender, EventArgs e)
        {
            frmQuanLyXeMay fQuaLy = new frmQuanLyXeMay();

            this.Hide();
            fQuaLy.Show();
        }
Пример #4
0
        private void btnSua_Click(object sender, EventArgs e)
        {
            string sMaXe     = txtMaXe.Text;
            string sTenXe    = txtTenXe.Text;
            string sPhanKhoi = cbbPhanKhoi.Text;
            string sMauXe    = cbbMauXe.Text;
            string sHangXe   = cbbHangXe.Text;
            string sNgaySX   = mskNgaySX.Text;
            string sGiaXe    = txtGia.Text;

            try
            {
                if (sMaXe != string.Empty && sTenXe != string.Empty && sPhanKhoi != string.Empty && sMauXe != string.Empty && sHangXe != string.Empty && sNgaySX != string.Empty && txtGia.Text != string.Empty)
                {
                    if (kiemTraSo(sGiaXe) == true && kiemTraSo(sPhanKhoi) == true)
                    {
                        sGiaXe    = int.Parse(txtGia.Text).ToString();
                        sPhanKhoi = int.Parse(cbbPhanKhoi.Text).ToString();
                        if (xlCSDL.updateXeMay(sMaXe, sTenXe, sHangXe, sPhanKhoi, sMauXe, sGiaXe, sNgaySX) > 0)
                        {
                            MessageBox.Show("Sửa xe: " + sTenXe + " thành công !");
                            this.Hide();
                            frmQuanLyXeMay fTrangChu = new frmQuanLyXeMay();
                            fTrangChu.Show();
                        }
                        else
                        {
                            MessageBox.Show("Sửa không thành công !");
                        }
                    }
                    else
                    {
                        MessageBox.Show("Không được nhập giá xe và 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);
            }
        }
Пример #5
0
        private void btnXoa_Click(object sender, EventArgs e)
        {
            string sTenXe = txtTenXe.Text;

            if (sTenXe != string.Empty)
            {
                if (xlCSDL.deleteXeMay(sTenXe) > 0)
                {
                    MessageBox.Show("Xóa xe: " + sTenXe + " thành công !");
                    this.Hide();
                    frmQuanLyXeMay fTrangChu = new frmQuanLyXeMay();
                    fTrangChu.Show();
                }
                else
                {
                    MessageBox.Show("Không tồn tại xe: " + sTenXe);
                }
            }
        }