Пример #1
0
        protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
        {
            GridViewRow           row      = GridView1.SelectedRow;
            int                   maHoaDon = int.Parse(((Label)row.FindControl("maHoaDon")).Text);
            List <PhieuHdChiTiet> list     = PhieuHdChiTiet_BUS.GetAll().Where(m => m.MaPhieuHd == maHoaDon).ToList();

            GridView2.DataSource = list;
            GridView2.DataBind();
        }
Пример #2
0
        public int total()
        {
            int maPhieuHd = PhieuHd_BUS.GetAll().ToList().Last().MaPhieuHd;
            int ck;

            if (tbxCK.Text == "")
            {
                ck = 0;
            }
            else
            {
                ck = Convert.ToInt32(tbxCK.Text);
            }
            int m = PhieuHdChiTiet_BUS.GetAll().ToList().Where(p => p.MaPhieuHd == maPhieuHd).Sum(p => Convert.ToInt32(p.ThanhTien)) * (100 - ck) / 100;

            return(m);
        }