public ActionResult Add()
        {
            requisitionForm.Suppliers   = supplierRepository.GetAll();
            requisitionForm.Departments = departmentRepository.GetAll();
            requisitionForm.Status      = statusRepository.GetAll();
            requisitionForm.Periods     = periodRepository.GetAll();
            requisitionForm.Priorities  = priorityRepository.GetAll();

            return(View(requisitionForm));
        }
Exemple #2
0
        public JsonResult ShowStudentCreate(int studentId, string isEnrollment)
        {
            var controlToLoad = isEnrollment == "N"? "_addStudent.cshtml": "_enrollment.cshtml";

            try
            {
                var allowedStattus = new[] { 1, 3 };
                ViewBag.Period = _periodRepository.GetAll().Data
                                 .Where(m => allowedStattus.Contains(m.PeriodStatusTypeModel.PeriodStatusTypeId))
                                 .Select(i => new SelectListItem()
                {
                    Text  = i.YearFrom + ' ' + i.YearTo,
                    Value = i.PeriodId.ToString()
                });

                ViewBag.Grade = _gradeRepository.GetAll(0).Data
                                .Select(i => new SelectListItem()
                {
                    Text  = i.GradeDescription,
                    Value = i.GradeId.ToString()
                });



                ViewBag.TransactionType = _transactionTypeRepository.GetAll().Data;


                if (isEnrollment == "N")
                {
                    ViewBag.Cities = _cityRepository.GetAll().Data
                                     .Select(i => new SelectListItem()
                    {
                        Text  = i.CityDescription,
                        Value = i.CityId.ToString()
                    });

                    ViewBag.Gender = _genderRepository.GetAll().Data
                                     .Select(i => new SelectListItem()
                    {
                        Text  = i.GenderDescription,
                        Value = i.GenderId.ToString()
                    });
                }


                // Get Student Info
                var studentResponse = new ServiceResponseModel <StudentModel>();
                if (studentId != 0)
                {
                    studentResponse = _studentRepository.GetById(studentId);

                    if (studentResponse.Response == Model.Enumerator.Enum.ServiceResponses.Failure)
                    {
                        throw new Exception(studentResponse.Reason);
                    }
                }

                return(Json(new
                {
                    //Html = RenderPartial.RenderPartialView(this, "~/Views/Student/_addStudent.cshtml", studentResponse.Model),
                    Html = RenderPartial.RenderPartialView(this, "~/Views/Student/" + controlToLoad, studentResponse.Model),
                    Message = "",
                    Status = "OK"
                }, JsonRequestBehavior.AllowGet));
            }
            catch (Exception ex)
            {
                return(Json(new
                {
                    Message = ex.Message,
                    Status = "ERROR"
                }, JsonRequestBehavior.AllowGet));
            }
        }
Exemple #3
0
        public IActionResult GetAll()
        {
            var list = _repoPeriod.GetAll();

            return(Ok(list));
        }
Exemple #4
0
 public IEnumerable <Period> GetAll()
 {
     return(periodRepo.GetAll());
 }
Exemple #5
0
 private void InitDataSource()
 {
     startEntryPeriodkryptonComboBox1.DataSource = r_period.GetAll();
 }
Exemple #6
0
        public JsonResult GetAll()
        {
            var result = _repository.GetAll();

            return(Json(result, JsonRequestBehavior.AllowGet));
        }