Exemplo n.º 1
0
        public void GetFiscalYearByDateTime()
        {
            var firstDate  = new DateTime(2017, 1, 28);
            var secondDate = new DateTime(2017, 12, 28);
            var fy1        = FiscalYear.GetFiscalYearByDateTime(firstDate);
            var fy2        = FiscalYear.GetFiscalYearByDateTime(secondDate);

            Assert.AreEqual(fy1, "20162017");
            Assert.AreEqual(fy2, "20172018");
        }
Exemplo n.º 2
0
        public async Task <IActionResult> PostProject([FromBody] Project project)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }
            FiscalYear.GetFiscalYearByDateTime(project.ExternalCreatedOn);
            _unitOfWork.Projects.Add(project);

            await _unitOfWork.SaveChangesAsync();

            return(CreatedAtAction("GetProject", new { id = project.ProjectId }, project));
        }