protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (Session["accSession"] == null) { btnAccount.ImageUrl = "~/images/unknowPerson.PNG"; } else { btnAccount.ImageUrl = "~/images/person.PNG"; } AccountModel acc = Session["accSession"] as AccountModel; ten.Text = acc.Ten; GiaVeCuaGhe giaVe = Session["giaVe"] as GiaVeCuaGhe; phim.Text = giaVe.Phim; rap.Text = giaVe.Rap; suatchieu.Text = giaVe.Suat; khandai.Text = giaVe.KhanDai; tien.Text = giaVe.TongTien; string ghe = ""; Dictionary <string, int> lstGheDangChon = Session["lstGheDangChon"] as Dictionary <string, int>; foreach (KeyValuePair <string, int> item in lstGheDangChon) { ghe += " " + item.Key; } dsGhe.Text = ghe; series.Text = DAOdonHangVe.GetSeries().Rows[0][0].ToString(); } }
void InsertOrder() { AccountModel acc = Session["accSession"] as AccountModel; GiaVeCuaGhe giaGhe = Session["giaVe"] as GiaVeCuaGhe; DAOdonHangVe.Insert(acc.Ten, acc.Email, giaGhe.TongTien, giaGhe.Rap); Dictionary <string, int> lstGheDangChon = Session["lstGheDangChon"] as Dictionary <string, int>; DateTime ngay = Convert.ToDateTime(Session["ngay"]); foreach (KeyValuePair <string, int> item in lstGheDangChon) { DAOGiaVeCuaGhe.ChuyenTrangThaiDa(item.Key, giaGhe.Rap, giaGhe.KhanDai, giaGhe.Suat, ngay); } InsertVe(); }