public async Task <IActionResult> OnPostAsync()
        {
            NuvAdUser user = await GetCurrentUserAsync();

            var sturecord = from s in _context.Student select s;

            sturecord = sturecord.Where(ab => ab.userID.Equals(user.Id));
            int sid = sturecord.FirstOrDefault().StudentID;

            AcademicRecord.CalcPer = AcademicRecord.CalcPer.Replace("%", "");

            AcademicRecord.StudentID = sid;
            if (!ModelState.IsValid)
            {
                return(Page());
            }

            _context.Attach(AcademicRecord).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!AcademicRecordExist(AcademicRecord.AcademicRecordID))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(RedirectToPage("../../Index"));
        }
Beispiel #2
0
        public async Task <IActionResult> OnPostAsync()
        {
            ApplicationList.StudentID  = Convert.ToInt32(Request.Form["sid"]);
            ApplicationList.ProgramsID = Request.Form["pid"].ToString();

            if (ApplicationList.AdmissionConfirmed == true)
            {
                ApplicationList.Status = "Admission Confirmed";
            }
            else if (ApplicationList.ConfirmFeesPayment)
            {
                ApplicationList.Status = "Fees Paid";
            }
            else if (ApplicationList.AttendInterview == true)
            {
                ApplicationList.Status = "Interview Done";
            }
            else if (ApplicationList.CounsellingDone == true)
            {
                ApplicationList.Status = "Counselling Done";
            }
            else if (ApplicationList.FormVerified)
            {
                ApplicationList.Status = "Form Verified";
            }

            //if (ApplicationList.AdmissionConfirmed==true)
            //{
            //    ApplicationList.Status = "Admission Confirmed";
            //    ApplicationList.AttendInterview = true;
            //    ApplicationList.CounsellingDone = true;
            //    ApplicationList.FormVerified = true;
            //    ApplicationList.ConfirmFeesPayment = true;
            //}
            //if (ApplicationList.FormVerified == true)
            //{
            //    ApplicationList.Status = "Form Verified";

            //}
            //if(ApplicationList.CounsellingDone==true)
            //{
            //    ApplicationList.Status = "Counselling Done";
            //    ApplicationList.FormVerified = true;
            //}
            //if (ApplicationList.AttendInterview == true)
            //{
            //    ApplicationList.Status = "Interview Done";
            //    ApplicationList.CounsellingDone = true;
            //    ApplicationList.FormVerified = true;
            //}
            //if (ApplicationList.ConfirmFeesPayment == true)
            //{
            //    ApplicationList.Status = "Fees Paid";
            //    ApplicationList.CounsellingDone = true;
            //    ApplicationList.FormVerified = true;
            //    ApplicationList.AttendInterview = true;
            //}
            if (!ModelState.IsValid)
            {
                return(Page());
            }

            _context.Attach(ApplicationList).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!ApplicationListExists(ApplicationList.ApplicationListID))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }
            await notificationAsync();

            return(RedirectToPage("./Index"));
        }