Пример #1
0
        public ActionResult GenerateTestimonial(FormCollection data)
        {
            if ((string)Session["user"] == null)
            {
                return(Redirect(Url.Action("Index", "Home")));
            }

            string regNum   = data["regNum"];
            int    degreeId = System.Convert.ToInt32(data["degreeId"]);
            int    appId    = System.Convert.ToInt32(data["appId"]);

            StudentVerifierService.StudentVerifierService studentVerifier = new StudentVerifierService.StudentVerifierService();
            StudentVerifierService.Student student = studentVerifier.getStudentInfo(regNum);

            ResultService.ResultService resultService = new ResultService.ResultService();
            ResultService.Result        result        = resultService.getUpdatedResult(regNum, degreeId);

            ViewData["appId"]         = appId;
            ViewData["name"]          = student.name;
            ViewData["fatherName"]    = student.fatherName;
            ViewData["motherName"]    = student.motherName;
            ViewData["gender"]        = student.gender;
            ViewData["regNum"]        = student.regNum;
            ViewData["session"]       = student.session;
            ViewData["degree"]        = result.degree;
            ViewData["semester"]      = result.semester;
            ViewData["totalSemester"] = result.totalSemester;
            ViewData["cgpa"]          = result.cgpa;

            return(View("Testimonial"));
        }
Пример #2
0
        public ActionResult Apply()
        {
            TestimonialWebApp.ResultService.ResultService resultService = new ResultService.ResultService();
            TestimonialWebApp.ResultService.Degree[]      degreeList    = resultService.getDegreeList();

            Dictionary <int, string> degrees = new Dictionary <int, string>();

            for (int i = 0; i < degreeList.Length; i++)
            {
                degrees[degreeList[i].id] = degreeList[i].degree;
            }

            ViewData["dict"] = degrees;

            return(View("Apply"));
        }
Пример #3
0
        public ActionResult Submit(FormCollection data)
        {
            string regNum     = data["regNum"];
            string transacNum = data["transacNum"];
            int    degreeId   = Int32.Parse(data["degree"]);
            string email      = data["email"];

            TempData["regNum"] = regNum;

            TestimonialWebApp.ResultService.ResultService resultService = new ResultService.ResultService();
            bool checkResult = resultService.checkStudentInResult(regNum, degreeId);

            if (checkResult == false)
            {
                TempData["error_program"] = "There is no result under the selected degree program for the student";
                return(Redirect(Url.Action("Apply", "Home")));
            }

            TestimonialWebApp.PaymentService.PaymentService paymentService = new PaymentService.PaymentService();
            float transAmount = (float)paymentService.getPayment(transacNum);

            if (transAmount < 100.00)
            {
                TempData["error"] = "Given Transaction number is not applicable!";
                return(Redirect(Url.Action("Apply", "Home")));
            }

            TestimonialWebApp.ApplicationService.ApplicationService applicationService = new ApplicationService.ApplicationService();
            long appId = (long)applicationService.apply(regNum, transacNum, degreeId, email);

            if (appId == -1)
            {
                TempData["error"] = "There is already an application with given transaction number!";
                return(Redirect(Url.Action("Apply", "Home")));
            }


            TempData["success"] = "Your Application for testimonial has been successfully sent and your application id is " + appId + ".";
            return(Redirect(Url.Action("Index", "Home")));
        }