Example #1
0
        private void btnThoat_Click(object sender, EventArgs e)
        {
            frmSoDoChinh SoDoChinh = new frmSoDoChinh();

            SoDoChinh.Show();
            this.Close();
        }
Example #2
0
        private void btnSoDoChinh_Click(object sender, EventArgs e)
        {
            this.Close();
            frmSoDoChinh FromSoDoChinh;

            FromSoDoChinh = new frmSoDoChinh();
            FromSoDoChinh.Show();
        }
Example #3
0
 private void btnThoat_Click(object sender, EventArgs e)
 {
     if (gbThongTin.Visible == false && dataGridViewCTOrder.Visible == false)
     {
         this.Close();
         frmSoDoChinh formchinh = new frmSoDoChinh();
         formchinh.Show();
     }
     else
     {
         frmSoDoChinh SoDoChinh = new frmSoDoChinh();
         string       maban     = txtMaBan.Text;
         //FromSoDoChinh = new frmSoDoChinh();
         BanCoKhach bck  = getBanCoKhach();
         Oder       od   = getOder();
         CTOder     ctod = getCTOder();
         HoaDon     hd   = getHD();
         CTHoaDon   cthd = getCTHD();
         BanSDNhieu bsd  = getBanSDNhieu();
         bck.MaBan = txtMaBan.Text;
         int i = int.Parse(txtMaOder.Text);
         od.MaOder = i;
         hd.MaOder = i;
         string maHD = hoadon.layMaHD(i);
         int    mahd = 0;
         Int32.TryParse(maHD, out mahd);
         string luotsd = bansd.layLuotSD(txtMaBan.Text);
         int    lsd    = 0;
         Int32.TryParse(luotsd, out lsd);
         if (ctorder.kiemTraGoiMon(i) == false)
         {
             hoadon.XoaHD(hd);
             bancokhach.XoaBanCoKhach(bck);
             orderr.XoaOder(od);
             int luotsddung = lsd - 1;
             bsd.LuotSD = luotsddung;
             bansd.SuaLuotSD(bsd);
         }
         this.Close();
         SoDoChinh.Show();
     }
 }
Example #4
0
        private void btnThoat_Click(object sender, EventArgs e)
        {
            frmSoDoChinh SoDoChinh = new frmSoDoChinh();
            string       maban     = txtMaBan.Text;
            //FromSoDoChinh = new frmSoDoChinh();
            BanCoKhach bck  = getBanCoKhach();
            Oder       od   = getOder();
            CTOder     ctod = getCTOder();
            HoaDon     hd   = getHD();
            CTHoaDon   cthd = getCTHD();
            BanSDNhieu bsd  = getBanSDNhieu();

            bck.MaBan = txtMaBan.Text;
            int i = int.Parse(txtMaOder.Text);

            od.MaOder = i;
            hd.MaOder = i;
            string maHD = hdBO.layMaHD(i);
            int    mahd = 0;

            Int32.TryParse(maHD, out mahd);
            string luotsd = bsdBO.layLuotSD(txtMaBan.Text);
            int    lsd    = 0;

            Int32.TryParse(luotsd, out lsd);
            if (ctBO.kiemTraGoiMon(i) == false)
            {
                hdBO.XoaHD(hd);
                bckBO.XoaBanCoKhach(bck);
                odBO.XoaOder(od);
                int luotsddung = lsd - 1;
                bsd.LuotSD = luotsddung;
                bsdBO.SuaLuotSD(bsd);
            }
            this.Close();
            SoDoChinh.Show();
        }