Esempio n. 1
0
        private void NewUserNavCde()
        {
            inscription w = new inscription();

            w.Show();
            iWindow.Close();
        }
        public JsonResult inscrire()
        {
            inscription i = new inscription();

            i.cours   = int.Parse(Request["cours"].ToString());
            i.student = Request["pw"].ToString();

            try
            {
                student e1 = (from el in db.students
                              where el.Id == Session["id"].ToString() && el.pw == i.student
                              select el).Single <student>();

                cours cc = (from el in db.cours where el.Id == i.cours select el).Single <cours>();

                inscription validatesubs = new inscription();
                validatesubs.cours   = i.cours;
                validatesubs.student = Session["id"].ToString();

                db.inscriptions.InsertOnSubmit(validatesubs);
                db.SubmitChanges();
            }
            catch (System.InvalidOperationException ex)
            {
                return(Json("false", JsonRequestBehavior.AllowGet));
            }
            return(Json("true", JsonRequestBehavior.AllowGet));
        }