public ActionResult Index(Modelss.Model.KhachHang kh) { QLTCDataContext qltc = new QLTCDataContext(); qltc.KhachHangs.InsertOnSubmit(kh); qltc.SubmitChanges(); ViewBag.thanhcong = "Chúc mừng bạn đã đăng kí thành công!"; ThucDonKHChon tdkh = new ThucDonKHChon(); tdkh.MaKhachHang = kh.MaTaiKhoan; tdkh.TenThucDon = kh.TenKhachHang; qltc.ThucDonKHChons.InsertOnSubmit(tdkh); GoiDichVuKHChon gdv = new GoiDichVuKHChon(); gdv.MaKhachHang = kh.MaTaiKhoan; gdv.TenGoi = kh.TenKhachHang; qltc.GoiDichVuKHChons.InsertOnSubmit(gdv); qltc.SubmitChanges(); return(RedirectToAction("Index", "DangNhap")); }
// // GET: /Default1/ public ActionResult Index(int madattiec) { QLTCDataContext qltc = new QLTCDataContext(); DatTiec dt = qltc.DatTiecs.Where(d => d.MaDacTiec == madattiec).FirstOrDefault(); return(View(dt)); }
public ActionResult laykhachhang() { QLTCDataContext qltc = new QLTCDataContext(); var session = (Modelss.Common.UserLogin)Session[Modelss.Common.CommonConstans.TENDANGNHAP_SESSTION]; KhachHang kh = qltc.KhachHangs.Where(d => d.MaTaiKhoan == session.id).FirstOrDefault(); return(PartialView("View1", kh)); }
public ActionResult laydanhsachmonan() { QLTCDataContext qltc = new QLTCDataContext(); var session = (Modelss.Common.UserLogin)Session[Modelss.Common.CommonConstans.TENDANGNHAP_SESSTION]; string matd = qltc.ThucDonKHChons.Where(d => d.MaKhachHang == session.id).SingleOrDefault().ToString(); List <Modelss.Model.Mon_An> list = (from a in qltc.ChiTietThucDonKHChons from b in qltc.ThucDonKHChons from c in qltc.Mon_Ans where a.MaThucDon == b.MaThucDon && a.MaMonAn == c.MaMonAn && b.MaThucDon == int.Parse(matd) select c).ToList(); return(PartialView("View2", list)); }