Example #1
0
        public ActionResult Details(long code, string dates)
        {
            try
            {
                SchoolId = USession.School_Id;

                DropDownList("%");
                HomeWorkModel TModel = new HomeWorkModel();

                tblAssignmentHeader TCtable = Connection.tblAssignmentHeaders.SingleOrDefault(x => x.AssignmentNo == code);
                TModel.SubjectId = TCtable.SubjectId;
                TModel.GradeId   = TCtable.GradeId;
                TModel.ClassId   = TCtable.ClassId;
                tblClass TClass = Connection.tblClasses.SingleOrDefault(x => x.ClassId == TCtable.ClassId && x.GradeId == TCtable.GradeId && x.SchoolId == SchoolId);
                TModel.Class = TClass.ClassName;
                tblGrade TGrade = Connection.tblGrades.SingleOrDefault(x => x.GradeId == TCtable.GradeId);
                TModel.Grade = TGrade.GradeName;
                tblSubject TSubject = Connection.tblSubjects.SingleOrDefault(x => x.SubjectId == TCtable.SubjectId);
                TModel.Subject               = TSubject.SubjectName;
                TModel.stringDueDate         = dates;
                TModel.AssignmentDescription = TCtable.AssignmentDescription;
                TModel.BatchNo               = TCtable.BatchNo;
                TModel.BatchDescription      = TCtable.BatchDescription;
                TModel.FilePath              = TCtable.FilePath;
                TModel.AssignmentNo          = TCtable.AssignmentNo;
                return(PartialView("DetailView", TModel));
            }
            catch (Exception ex)
            {
                Errorlog.ErrorManager.LogError(ex);
                return(View());
            }
        }
        //public ActionResult Index()
        //{
        //    var student = Connection.SMGTGetStudent();

        //    List<SMGTGetStudent_Result> Categorylist = student.ToList();
        //    StudentModel schl = new StudentModel();
        //    List<StudentModel> tcmlist = Categorylist.Select(x => new StudentModel
        //    {

        //        SchoolId = x.SchoolId,
        //        SchoolName = x.SchoolName,
        //        DateOfBirth = x.DateofBirth,
        //        CreatedDate = x.CreatedDate,
        //        StudentId = x.StudentId,
        //        StudentName = x.studentName,



        //        IsActive = x.IsActive,
        //        ModifiedBy = x.ModifiedBy,
        //        ModifiedDate = x.ModifiedDate

        //    }).ToList();



        //    return View(tcmlist);
        //}

        //
        // GET: /Student/Details/5

        public ActionResult Details(string StudentId, string SchoolId)
        {
            Authentication("STCF");
            StudentModel TModel = new StudentModel();

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


            //  TModel.IsActive = TCtable.IsActive;


            TModel.StudentId     = TCtable.StudentId;
            TModel.StudentName   = TCtable.studentName;
            TModel.DateOfBirth   = TCtable.DateofBirth;
            TModel.ClassId       = TCtable.ClassId;
            TModel.Gender        = TCtable.Gender;
            TModel.Gender        = TCtable.Gender;
            TModel.ImagePathname = TCtable.ImgUrl;
            TModel.GradeId       = TCtable.GradeId;
            TModel.HouseId       = TCtable.HouseId;

            tblClass sclrank = Connection.tblClasses.SingleOrDefault(x => x.ClassId == TModel.ClassId && x.GradeId == TModel.GradeId && x.SchoolId == SchoolId);

            TModel.ClassId = sclrank.ClassName;
            tblGrade sclgrade = Connection.tblGrades.SingleOrDefault(x => x.GradeId == TModel.GradeId);

            TModel.GradeId = sclgrade.GradeName;
            tblHouse sclhouse = Connection.tblHouses.SingleOrDefault(x => x.SchoolId == SchoolId && x.HouseId == TModel.HouseId);

            TModel.HouseId = sclhouse.HouseName;
            return(View("Detail", TModel));
        }
Example #3
0
        public void ChecktblGrade()
        {
            tblGrade grade = new tblGrade();

            grade.gradeID = 20;

            Assert.IsNotNull(grade);
            Assert.AreEqual(20, grade.gradeID);
        }
Example #4
0
        public ActionResult Details(string StudentId, string SchoolId)
        {
            StudentModel TModel = new StudentModel();

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


            //  TModel.IsActive = TCtable.IsActive;

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



            TModel.DateOfBirth = TCtable.DateofBirth;

            if (TCtable.DateofBirth == null)
            {
            }
            else
            {
                string   a = TCtable.DateofBirth.ToString();
                DateTime b = DateTime.Parse(a);
                TModel.datetimestring = b.ToShortDateString();
            }

            TModel.ClassId       = TCtable.ClassId;
            TModel.Gender        = TCtable.Gender;
            TModel.Gender        = TCtable.Gender;
            TModel.ImagePathname = TCtable.ImgUrl;
            TModel.GradeId       = TCtable.GradeId;
            TModel.HouseId       = TCtable.HouseId;
            if (TCtable.ImgUrl == null || TCtable.ImgUrl == "")
            {
                TModel.ImagePathname = "~/Uploads/Student/Photo/no_image.jpg";
            }
            else
            {
                TModel.ImagePathname = TCtable.ImgUrl;
            }
            tblClass sclrank = Connection.tblClasses.SingleOrDefault(x => x.ClassId == TModel.ClassId && x.GradeId == TModel.GradeId && x.SchoolId == SchoolId);

            TModel.ClassId = sclrank.ClassName;
            tblGrade sclgrade = Connection.tblGrades.SingleOrDefault(x => x.GradeId == TModel.GradeId);

            TModel.GradeId = sclgrade.GradeName;
            if (TModel.HouseId == null)
            {
            }
            else
            {
                tblHouse sclhouse = Connection.tblHouses.SingleOrDefault(x => x.SchoolId == SchoolId && x.HouseId == TModel.HouseId);
                TModel.HouseId = sclhouse.HouseName;
            }
            return(View("Detail", TModel));
        }
        public ActionResult Detail(string GradeId, string ClassId, string AcedamicYear)
        {
            try
            {
                SchoolId = USession.School_Id;
                tblAccadamicYear Ttable = Connection.tblAccadamicYears.SingleOrDefault(x => x.SchoolId == SchoolId);

                Dropdownlistdata(SchoolId);

                if (GradeId == null)
                {
                    return(RedirectToAction("Index"));
                }


                ViewBag.CurentYear = AcedamicYear;
                tblGrade TCtable = Connection.tblGrades.SingleOrDefault(x => x.GradeId == GradeId);
                ViewBag.CurentGrade = TCtable.GradeName;

                tblClass classtable = Connection.tblClasses.SingleOrDefault(x => x.ClassId == ClassId && x.GradeId == GradeId && x.SchoolId == SchoolId);
                ViewBag.CurentClass = classtable.ClassName;


                ViewBag.ParameterAcedamicYear = Ttable.AccadamicYear;
                if (Ttable.AccadamicYear != AcedamicYear)
                {
                    ViewBag.ErrorMsg = false;
                }
                else
                {
                    ViewBag.ErrorMsg = true;
                }
                List <StudentGradeAdvanceModel> tcmlist = getdataForTable(AcedamicYear, GradeId, ClassId);
                if (tcmlist.Count == 0)
                {
                    return(RedirectToAction("Index"));
                }
                return(View(tcmlist));
            }
            catch (Exception ex)
            {
                Errorlog.ErrorManager.LogError(ex);

                return(View());
            }
        }
Example #6
0
        public ActionResult Create(tblGrade Model)
        {
            UserId = USession.User_Id;
            try
            {
                Connection.GDsetGrade(Model.GradeId, Model.GradeName, UserId, "Y");
                Connection.SaveChanges();

                //return View();
                return(Json("Success", JsonRequestBehavior.AllowGet));
                //return RedirectToAction("Index");
            }
            catch (Exception ex)
            {
                Errorlog.ErrorManager.LogError(ex);
                return(Json("Exist", JsonRequestBehavior.AllowGet));
            }
        }
Example #7
0
        public ActionResult Edit(GradeModel Model)
        {
            UserId = USession.User_Id;
            try
            {
                tblGrade TCtable = Connection.tblGrades.SingleOrDefault(x => x.GradeId == Model.GradeId);

                Connection.GDModifyGrade(Model.GradeName, Model.GradeId, UserId);
                Connection.SaveChanges();

                return(RedirectToAction("Index"));
            }
            catch (Exception ex)
            {
                Errorlog.ErrorManager.LogError(ex);
                return(View());
            }
        }
Example #8
0
        public ActionResult Edit(string Code)
        {
            try
            {
                GradeModel TModel = new GradeModel();

                tblGrade TCtable = Connection.tblGrades.SingleOrDefault(x => x.GradeId == Code);
                TModel.IsActive = TCtable.IsActive;

                TModel.GradeId   = TCtable.GradeId;
                TModel.GradeName = TCtable.GradeName;

                return(PartialView("EditView", TModel));
            }
            catch (Exception ex)
            {
                Errorlog.ErrorManager.LogError(ex);
                return(View());
            }
        }
        public ActionResult Edit(string AcademicYear, string GradeId, string SubjectId, string SubjectCategoryId, string Optional)
        {
            Dropdownlistdata(AcademicYear, GradeId);
            int suid = Convert.ToInt32(SubjectId);
            Grade_SubjectModel TModel  = new Grade_SubjectModel();
            tblSubject         TCtable = Connection.tblSubjects.SingleOrDefault(x => x.SubjectId == suid);

            TModel.AcademicYear      = AcademicYear;
            TModel.GradeId           = GradeId;
            TModel.SubjectName       = TCtable.SubjectName;
            TModel.ShortName         = TCtable.ShortName;
            TModel.SubjectId         = Convert.ToInt32(SubjectId);
            TModel.SubjectCategoryId = Convert.ToInt32(SubjectCategoryId);
            TModel.Optional          = Optional;


            tblGrade TGtable = Connection.tblGrades.SingleOrDefault(x => x.GradeId == GradeId);

            TModel.GradeName = TGtable.GradeName;
            return(PartialView("Edit", TModel));
        }
Example #10
0
        public ActionResult Edit(long Code, string dates)
        {
            try
            {
                SchoolId = USession.School_Id;

                HomeWorkModel TModel = new HomeWorkModel();

                tblAssignmentHeader TCtable = Connection.tblAssignmentHeaders.SingleOrDefault(x => x.AssignmentNo == Code);
                TModel.SubjectId = TCtable.SubjectId;
                TModel.GradeId   = TCtable.GradeId;
                TModel.ClassId   = TCtable.ClassId;
                tblClass TClass = Connection.tblClasses.SingleOrDefault(x => x.ClassId == TCtable.ClassId && x.GradeId == TCtable.GradeId && x.SchoolId == SchoolId);
                TModel.Class = TClass.ClassName;
                tblGrade TGrade = Connection.tblGrades.SingleOrDefault(x => x.GradeId == TCtable.GradeId);
                TModel.Grade = TGrade.GradeName;
                tblSubject TSubject = Connection.tblSubjects.SingleOrDefault(x => x.SubjectId == TCtable.SubjectId);
                TModel.Subject               = TSubject.SubjectName;
                TModel.stringDueDate         = dates;
                TModel.AssignmentDescription = TCtable.AssignmentDescription;
                TModel.BatchNo               = TCtable.BatchNo;
                TModel.BatchDescription      = TCtable.BatchDescription;
                TModel.FilePath              = TCtable.FilePath;
                TModel.AssignmentNo          = TCtable.AssignmentNo;


                DropDownList(TCtable.GradeId);
                var Subject = Connection.GDgetGradeActiveSubject(SchoolId, TCtable.GradeId, "Y");;
                List <GDgetGradeActiveSubject_Result> Subjectlist = Subject.ToList();
                ViewBag.SubjectId    = new SelectList(Subjectlist, "SubjectId", "SubjectName");
                ViewBag.SubjectIdtxt = TCtable.SubjectId;
                return(PartialView("EditView", TModel));
            }
            catch (Exception ex)
            {
                Errorlog.ErrorManager.LogError(ex);
                return(View());
            }
        }