Example #1
0
        public ActionResult Edit([Bind(Include = "Id,first_name,middle_name,last_name,gender,DOB,screen_name,permanent_address,permanent_city,permanent_state,permanent_country,permanent_zip_code,present_address,present_city,present_state,present_country,present_zip_code,paediatrician_details,allergic,blood_group,Email,UserName,admission_number,admission_date,transfer_date,father_guardian_phone_no,father_guardian_first_name,father_guardian_last_name,father_guardian_email,father_guardian_occupation,mother_name,mother_phone_no,mother_email,mother_occupation,photo_url")] DomainModel.BusinessLayer.Student student)
        {
            try
            {
                DomainModel.BusinessLayer.Student std = new DomainModel.BusinessLayer.Student();
                var qrystd = std.GetStudentdetails(student.Id, UserDetails.Current.SchoolId);
                LoadEditDropdowns(qrystd);

                if (ModelState.IsValid)
                {
                    Boolean blnFlg = std.SaveStudent(student, UserDetails.Current.SchoolId);
                    if (blnFlg == true)
                    {
                        return(RedirectToAction("Index"));
                    }
                    else
                    {
                        return(View());
                    }
                }
                return(View());
            }
            catch
            {
                return(View());
            }
        }
Example #2
0
        // GET: Student/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            DomainModel.BusinessLayer.Student studentfactory = new DomainModel.BusinessLayer.Student();
            var stu = studentfactory.GetStudentdetails(Convert.ToInt32(id), UserDetails.Current.SchoolId);

            return(View(stu));
        }