Esempio n. 1
0
        public JsonResult DatHang(List <HoaDonCT_Model> data)
        {
            var session_acc = SessionHelper.GetSession();

            if (session_acc != null)
            {
                ViewBag.taikhoan = session_acc.TaiKhoan1;
            }

            //create hoadon
            var daohd    = new HoaDonDAO();
            int resulthd = daohd.CreateHoaDon(session_acc.id_khachhang, session_acc.hoten); //id_hoadon

            //create hoadonct
            var daoct  = new HoaDonCTDAO();
            var result = daoct.CreateHoaDonCTs(data, session_acc.id_khachhang, resulthd);

            return(Json(result, JsonRequestBehavior.AllowGet));
        }