Beispiel #1
0
        // GET: Student
        public ActionResult Index()
        {
            DomainModel.BusinessLayer.Student std = new DomainModel.BusinessLayer.Student();
            var qrystd = std.getstudents(UserDetails.Current.SchoolId);

            return(View(qrystd.ToList()));
        }
Beispiel #2
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());
            }
        }
Beispiel #3
0
        public ActionResult getParentDetails(string phone_no)
        {
            string strRes = "";

            DomainModel.BusinessLayer.Student sa = new DomainModel.BusinessLayer.Student();
            strRes = sa.GetParentDetails(phone_no);
            return(Content(strRes));
        }
Beispiel #4
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));
        }
Beispiel #5
0
        public ActionResult chkAdmnNo(int admn_no, int sch_id, int?std_id)
        {
            string strRes = string.Empty;

            DomainModel.BusinessLayer.Student sa = new DomainModel.BusinessLayer.Student();
            int qry = sa.CheckAdmissionNumber(admn_no, sch_id, std_id);

            if (qry > 0)
            {
                strRes = "<font color='red'>Duplicate Admission Number</font>";
            }

            return(Content(strRes));
        }
Beispiel #6
0
        void LoadEditDropdowns(DomainModel.BusinessLayer.Student std)
        {
            List <string> lstcountry = new List <string>();
            List <string> lststate   = new List <string>();

            DomainModel.BusinessLayer.ListCollection LC = new DomainModel.BusinessLayer.ListCollection();
            lstcountry               = LC.LoadCountry();
            lststate                 = LC.LoadState();
            ViewBag.PresentCountry   = new SelectList(lstcountry, std.present_country);
            ViewBag.PresentStates    = new SelectList(lststate, std.present_state);
            ViewBag.PermanentCountry = new SelectList(lstcountry, std.permanent_country);
            ViewBag.PermanentStates  = new SelectList(lststate, std.permanent_state);
            var lstGender = LC.LoadGender();

            ViewBag.GenderCd = new SelectList(lstGender, "lstValue", "lstText", std.gender);
        }
Beispiel #7
0
 public ActionResult Delete(int?id, FormCollection collection)
 {
     try
     {
         DomainModel.BusinessLayer.Student std = new DomainModel.BusinessLayer.Student();
         Boolean blnFlg = std.deleteStudent((int)id);
         if (blnFlg == true)
         {
             return(RedirectToAction("Index"));
         }
         else
         {
             return(View());
         };
     }
     catch
     {
         return(View());
     }
 }