public void WhenIncludingBackouts_AllActiveRecordsInResults() { var context = this.context; var repository = new TransactionTypeRepository(context); var allTypes = repository.GetAll(excludeBackouts: false); Assert.Equal(2, allTypes.Count()); }
public void BasicUsage() { var context = this.context; var repository = new TransactionTypeRepository(context); var allTypes = repository.GetAll(); Assert.Equal(1, allTypes.Count()); }
public void WhenIncludingBackouts_AllActiveRecordsInResults() { var context = this.factory.Create(); context.Database.Log = this.output.WriteLine; var repository = new TransactionTypeRepository(context); var allTypes = repository.GetAll(excludeBackouts: false); context.Dispose(); Assert.Equal(4, allTypes.Count()); }
public void BasicUsage() { var context = this.factory.Create(); context.Database.Log = this.output.WriteLine; var repository = new TransactionTypeRepository(context); var allTypes = repository.GetAll(); context.Dispose(); Assert.Equal(2, allTypes.Count()); }
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)); } }
public ActionResult Index() { var getList = Repo.GetAll(); return(View(getList == null ? new List <TransactionType>() : getList)); }
public ICollection<TransactionType> GetTransactionTypes() { var repository = new TransactionTypeRepository(_db); return repository.GetAll().ToList(); }