Пример #1
0
        public void ProcessRequest(HttpContext context)
        {
            Account  user = (Account)context.Session["sid"];
            Student = LabDB.StudentInfo.SingleOrDefault(d => d.AccountId == user.Id);

            PackageBookInfo bookInfo = new PackageBookInfo
            {
                StudentInfo=Student,
                PackageArrangeId = Convert.ToInt32(context.Request.QueryString["arrangeid"].Trim()),
                BookTime = DateTime.Now,
                UserAgent = context.Request.UserAgent.ToString(),
            };

            context.Response.ContentType = "text/plain";

            try
            {
                if (LabDB.PackageBookInfo.FirstOrDefault(d => d.PackageArrangeId == bookInfo.PackageArrangeId && d.StudentId == bookInfo.StudentId) != null)
                {
                    throw (new Exception("已经预约!不能再次预约!"));
                }

                LabDB.PackageBookInfo.InsertOnSubmit(bookInfo);
                LabDB.SubmitChanges();
                context.Response.Write("1");

            }

            catch (Exception ex)
            {
                context.Response.Write("预约失败!请联系管理员!" );
            }
        }
Пример #2
0
 partial void DeletePackageBookInfo(PackageBookInfo instance);
Пример #3
0
 partial void UpdatePackageBookInfo(PackageBookInfo instance);
Пример #4
0
 partial void InsertPackageBookInfo(PackageBookInfo instance);
Пример #5
0
		private void detach_PackageBookInfo(PackageBookInfo entity)
		{
			this.SendPropertyChanging();
			entity.StudentInfo = null;
		}
Пример #6
0
		private void detach_PackageBookInfo(PackageBookInfo entity)
		{
			this.SendPropertyChanging();
			entity.PackageArrange = null;
		}