Exemplo n.º 1
0
        public ActionResult DeleteStudentexcactivities(StudentExtraCModel Model)
        {
            try
            {
                tblStudentExtraCurricularActivity Tble = Connection.tblStudentExtraCurricularActivities.Find(Model.StudentId, Model.SchoolId, Model.ActivityCode);
                Connection.tblStudentExtraCurricularActivities.Remove(Tble);
                Connection.SaveChanges();


                var item = Connection.tblStudentExtraCurricularActivities.FirstOrDefault(i => i.SchoolId == Model.SchoolId && i.ActivityCode == Model.ActivityCode);

                //tblStudentExtraCurricularActivity Tblew = Connection.tblStudentExtraCurricularActivities.Find(item.ActivityCode);

                //Connection.tblStudentExtraCurricularActivities.Remove(Tblew);
                //  Connection.SaveChanges();

                string s = Model.SchoolId + "!" + Model.StudentId;
                return(Json(s, JsonRequestBehavior.AllowGet));
                //return RedirectToAction("Index");
            }
            catch
            {
                return(Json("Error", JsonRequestBehavior.AllowGet));
            }
        }
Exemplo n.º 2
0
        public ActionResult Deletescexc(string SchoolId, string StudentId, string ActivityCode)
        {
            StudentExtraCModel Model = new StudentExtraCModel();

            Model.ActivityCode = ActivityCode;
            Model.SchoolId     = SchoolId;
            Model.StudentId    = StudentId;


            return(PartialView("DeleteStudentEXactvity", Model));
        }
Exemplo n.º 3
0
        public JsonResult AddStudentExcActivity(StudentExtraCModel Model)
        {
            try
            {
                string result = "Error";
                //    var count2 = Connection.tblStudentExtraCurricularActivities.Count();
                // Model.HouseId = count2.ToString();
                if (Model.ActivityCode != null && Model.SchoolIdE != null && Model.StudentIdE != null)
                {
                    var count = Connection.tblStudentExtraCurricularActivities.Count(u => u.ActivityCode == Model.ActivityCode && u.SchoolId == Model.SchoolIdE && u.StudentId == Model.StudentIdE);
                    if (count == 0)
                    {
                        // Model.SchoolId = Schoold;
                        tblStudentExtraCurricularActivity newscg = new tblStudentExtraCurricularActivity();

                        newscg.CreatedBy    = USession.User_Id;
                        newscg.CreatedDate  = DateTime.Now;
                        newscg.SchoolId     = Model.SchoolIdE;
                        newscg.StudentId    = Model.StudentIdE;
                        newscg.ActivityCode = Model.ActivityCode;
                        newscg.IsActive     = "Y";


                        Connection.tblStudentExtraCurricularActivities.Add(newscg);

                        Connection.SaveChanges();

                        result = "sessioncheck" + "!" + Model.SchoolIdE + "!" + Model.StudentIdE;

                        //  ViewBag.SchoolId = Model.SchoolId;
                    }
                    else
                    {
                        result = "Exits";
                    }
                }
                else
                {
                    result = "fill";
                }
                //ShowTeacherQualificatoin();

                return(Json(result, JsonRequestBehavior.AllowGet));
            }
            catch (Exception Ex)
            {
                Errorlog.ErrorManager.LogError("Teacher Controller - AddQualification(QualificationModel Model)", Ex);
                return(Json("Exception", JsonRequestBehavior.AllowGet));
            }
        }
Exemplo n.º 4
0
        public ActionResult ShowEditExtra(string StudentId, string SchoolId)
        {
            StudentExtraCModel TModel = new StudentExtraCModel();

            tblStudent TCtable = Connection.tblStudents.SingleOrDefault(x => x.StudentId == StudentId && x.SchoolId == SchoolId);

            tblSchool schl = Connection.tblSchools.SingleOrDefault(x => x.SchoolId == SchoolId);
            //  TModel.IsActive = TCtable.IsActive;

            string SchoolName = schl.SchoolName;

            TModel.StudentId   = TCtable.StudentId;
            TModel.StudentName = TCtable.studentName;
            TModel.SchoolName  = SchoolName;


            var StudentSextra = Connection.SMGTloadScholExtraCadd(SchoolId, "%").ToList();



            List <tblExtraCurricularActivity> result = StudentSextra.Select(x => new tblExtraCurricularActivity
            {
                ActivityCode = x.ActivityCode,
                ActivityName = x.ActivityName
            }).ToList();

            ViewBag.studentextrac = new SelectList(StudentSextra, "ActivityCode", "ActivityName");



            TModel.SchoolId = TCtable.SchoolId;



            return(PartialView("EditStudentEXtra", TModel));
        }