예제 #1
0
        public void SaoKeTaiKhoan_Load()
        {
            Application.OpenForms[1].Close();//đóng form hiện tại đang mở
            this.pnMaster.Controls.Clear();
            SaoKeTaiKhoan saoKeTaiKhoan = new SaoKeTaiKhoan();

            saoKeTaiKhoan.TopLevel = false;
            this.pnMaster.Controls.Add(saoKeTaiKhoan);
            saoKeTaiKhoan.Show();
            nameForm = "SaoKeTaiKhoan";
            var   Form     = Application.OpenForms[1];
            Label lbl_sodu = Form.Controls["lbl_sodu"] as Label;

            lbl_sodu.Text = AccountBUS.getByAccountNo(SoThe).Balance.ToString("0,000");
            DataGridView gridview = Form.Controls["grtest"] as DataGridView;

            gridview.DataSource            = LogBUS.get5Row(SoThe);
            gridview.Columns[0].Visible    = false;
            gridview.Columns[1].Visible    = false;
            gridview.Columns[2].Visible    = false;
            gridview.Columns[3].Visible    = false;
            gridview.Columns[7].Visible    = false;
            gridview.Columns[4].HeaderText = "Ngày giao dịch";
            gridview.Columns[4].Width      = 130;
            gridview.Columns[5].HeaderText = "Số tiền giao dịch";
            gridview.Columns[5].Width      = 130;
            gridview.Columns[6].HeaderText = "Nội dung giao dịch";
            gridview.Columns[6].Width      = 190;
        }
예제 #2
0
 private void btphai2_Click(object sender, EventArgs e)
 {
     if (nameForm == "GiaoDienChinh")
     {
         NhapTaiKhoanChuyenDen_Load();
     }
     else if (nameForm == "RutTien")
     {
         //rút 1.500.000 VNĐ
         var account = AccountBUS.getByAccountNo(SoThe);     //lấy thông tin account từ số thẻ chuyển tiền
         if ((account.Balance - 1550000) > 0)                //kiểm tra số tiền sau khi rút còn đủ 50.000 duy trì thẻ hay không
         {
             //thực hiện giao dịch
             if (AccountBUS.RutTien(SoThe, 1500000)) //thực hiện rút tiền
             {
                 InHoaDon_Load();                    //thành công
             }
             else
             {
                 GiaoDienChinh_Load();
             }
         }
         else
         {
             GiaoDienChinh_Load();
         }
     }
     else if (nameForm == "ThongTinChuyenKhoan")
     {
         //thực hiện giao dịch
         if (AccountBUS.ChuyenTien(SoThe, sothechuyenden, sotienchuyenden) && LogBUS.ChuyenTien(SoThe, sothechuyenden, sotienchuyenden, details))
         {
             //nếu giao dịch thành công và lưu lại lịch sử giao dịch thành công thì trở về giao diện chính
             ChuyenKhoanThanhCong_Load();
         }
     }
     else if (nameForm == "SaoKeTaiKhoan")
     {
         //in sao kê
         //var Form = Application.OpenForms[1];
         //DataGridView grid = Form.Controls["Grid_saoke"] as DataGridView;
         //exportExcel(grid);
         //btHoaDon.BackColor = Color.White;
         btHoaDon.BackColor = Color.Gray;
         // btHoaDon.BackColor = Color.White;
     }
     else if (nameForm == "SoDuTaiKhoan")
     {
         //in sao kê
         //var Form = Application.OpenForms[1];
         //DataGridView grid = Form.Controls["Grid_saoke"] as DataGridView;
         //exportExcel(grid);
         //btHoaDon.BackColor = Color.White;
         btHoaDon.BackColor = Color.Gray;
         // btHoaDon.BackColor = Color.White;
     }
     return;
 }