private void LoadCTHD()
        {
            try
            {
                using (var k = new AppCode.QuanCafe())
                {
                    List <CTHoaDon> dscthd = new List <CTHoaDon>();

                    var tthd = k.TimHoaDon(AppCode.STHoaDon.idHoaDon);
                    dscthd = k.TimDSCTHD(tthd.IDHoaDon);
                    //Set data
                    lblSoban.Text       = k.TimBan(tthd.IDBan).TenBan;
                    lblNhanVienLap.Text = k.TimNV(tthd.IDNhanVienLap).TenNV;
                    lblNgayLap.Text     = DateTime.Now.ToString("dd/MM/yyyy");
                    grvCTHD.DataSource  = dscthd;
                    lblGiamGia.Text     = TinhTien.giamgia.ToString() + "%";

                    //Tong tien
                    double t = 0;
                    foreach (var item in dscthd)
                    {
                        t += ((item.SoLuong * item.GiaBan));
                    }
                    lblTongTien.Text = (t - (t * TinhTien.giamgia / 100)).ToString() + " VNĐ";
                }
            }
            catch
            {
                return;
            }
        }
Exemple #2
0
 private void fThongTinTaiKhoan_Load(object sender, EventArgs e)
 {
     try
     {
         using (var k = new AppCode.QuanCafe())
         {
             NhanVien kq = k.TimNV(AppCode.STNhanVien.idNhanVien);
             txtTenDN.Text       = kq.TenDN;
             txtTenNhanVien.Text = kq.TenNV;
             txtMatKhau.Text     = kq.MatKhau;
             // Image img = Image.FromFile("loginimg.png");
             bmp           = new Bitmap(kq.DuongDanHinh);
             picHinh.Image = bmp;
         }
     }
     catch
     {
     }
 }