Beispiel #1
0
        public ActionResult Addmark(StudentMarks modelobj2)
        {
            Student_Mark tableobj = new Student_Mark();

            tableobj.Mark1  = modelobj2.Mark1;
            tableobj.Mark2  = modelobj2.Mark2;
            tableobj.Std_Id = modelobj2.Std_Id;
            entityobj.Student_Mark.Add(tableobj);
            entityobj.SaveChanges();

            return(RedirectToAction("ShowMark"));
        }
Beispiel #2
0
        public ActionResult Addmark()
        {
            Student_Mark tableobj = new Student_Mark();
            var          obj3     = entityobj.Student_Detail.Select(s => s).ToList();
            var          obj4     = entityobj.Student_Detail.Select(s => s).ToList();

            tableobj.Std_Id = obj3.Where(e => e.Std_Id == tableobj.Std_Id).Select(e => e.Std_Id).SingleOrDefault();
            var dropdownlistname = obj4.Select(x => new SelectListItem
            {
                Value = x.Std_Id.ToString(),
                Text  = x.Name
            }).ToList();

            ViewBag.project = dropdownlistname;

            return(View());
        }