Пример #1
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            tt    = 0;
            stt   = 1;
            hdBus = new HoadonBUS();

            HoadonDTO hd = new HoadonDTO();

            load_TenBN();
            load_data(mapkb.Text);
            string tthuoc = hdBus.tienthuoc(hd, mapkb.Text).ToString();

            System.Globalization.CultureInfo culture = new System.Globalization.CultureInfo("en-US");
            decimal value = decimal.Parse(tthuoc, System.Globalization.NumberStyles.AllowThousands);

            tienthuoc.Text = String.Format(culture, "{0:N0}", value);
            tienthuoc.Select(tienthuoc.Text.Length, 0);
            decimal value1 = decimal.Parse(PhieukhambenhDTO.TienKham.ToString(), System.Globalization.NumberStyles.AllowThousands);

            tienkham.Text = String.Format(culture, "{0:N0}", value1);
            tienkham.Select(tienkham.Text.Length, 0);
            string ttien = (float.Parse(tthuoc) + PhieukhambenhDTO.TienKham).ToString();

            tt = float.Parse(tthuoc) + tkham;
            decimal value2 = decimal.Parse(ttien, System.Globalization.NumberStyles.AllowThousands);

            tongtien.Text = String.Format(culture, "{0:N0}", value2);
            tongtien.Select(tongtien.Text.Length, 0);
        }
Пример #2
0
        public void LapHoaDon()
        {
            HoadonDTO hd = new HoadonDTO();

            hdbus  = new HoadonBUS();
            pkbbus = new PhieukhambenhBUS();
            pkbbus.tk();
            hd.MaHd     = hdbus.autogenerate_mahd().ToString();
            hd.TongTien = hdbus.tienthuoc(hd, "2") + PhieukhambenhDTO.TienKham;
            hd.MaPkb    = "2";
            hd.NgayHd   = DateTime.UtcNow.Date;
            //Assert.AreEqual(true, hdbus.them(hd));
            Assert.AreEqual(100000, hd.TongTien);
        }