add missionary forms and update db conn strings
parent
fb854ac830
commit
8a85e8014a
|
|
@ -0,0 +1,46 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.Extensions.Options;
|
||||
using OFBButte.Application.Configuration;
|
||||
using OFBButte.Application.Database;
|
||||
using OFBButte.Application.Missionary;
|
||||
using OFBButte.Entities;
|
||||
|
||||
namespace OFBButte.Api.Controllers
|
||||
{
|
||||
[Route("api/[controller]")]
|
||||
[ApiController]
|
||||
public class MissionaryController : ControllerBase
|
||||
{
|
||||
private readonly AppSettings appSettings;
|
||||
private readonly IOFBContext context;
|
||||
public MissionaryController(IOptions<AppSettings> options, IOFBContext context)
|
||||
{
|
||||
this.appSettings = options.Value;
|
||||
this.context = context;
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
public ActionResult<MissionarySupport> Post([FromBody] MissionarySupport value)
|
||||
{
|
||||
var adder = new AddMissionarySupportForm(context);
|
||||
var result = adder.Handle(value);
|
||||
return result;
|
||||
}
|
||||
|
||||
[HttpGet("{id}")]
|
||||
public ActionResult<MissionarySupport> Get(int id)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
var getter = new GetMissionarySupportForm(context);
|
||||
var result = getter.Handle(id);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -5,9 +5,20 @@
|
|||
<AspNetCoreHostingModel>InProcess</AspNetCoreHostingModel>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Content Remove="missionary_sample.json" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="missionary_sample.json">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.AspNetCore.App" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Razor.Design" Version="2.2.0" PrivateAssets="All" />
|
||||
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="2.2.3" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
|
|||
|
|
@ -10,6 +10,6 @@
|
|||
"Environment": "Dev"
|
||||
},
|
||||
"ConnectionStrings": {
|
||||
"OFBContext": "server=localhost;database=ofbtest;user=ofbapi;password=87hjdusiodksyeunsjkdis7"
|
||||
"OFBContext": "server=localhost;database=ofb2_test;user=ofbapi2_test;password=Look to the LORD and his strength seek his face always"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
"App": {
|
||||
"Environment": "Prod"
|
||||
},
|
||||
"ConnectionStrings": {
|
||||
"OFBContext": "server=localhost;database=ofb2;user=ofbapi2;password=Set your minds on things above not on earthly things;"
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,81 @@
|
|||
{
|
||||
"id": 0,
|
||||
"name": "John Smith",
|
||||
"homePhone": "4063330989",
|
||||
"cellPhone": "4068749384",
|
||||
"fieldPhone": "28398736",
|
||||
"wifesName": "Cathy Smith",
|
||||
"children": [
|
||||
{
|
||||
"id": 0,
|
||||
"name": "Michael Smith"
|
||||
},
|
||||
{
|
||||
"id": 1,
|
||||
"name": "Melanie Smith"
|
||||
}
|
||||
],
|
||||
"testimony": "The testimony of how I got saved",
|
||||
"callToField": "my call to the field",
|
||||
"sendingChurch": "Sent by Old Fashion Baptist Church",
|
||||
"fieldOfService": "My field of service",
|
||||
"plans": "Start churches and train national pastors",
|
||||
"evaluationOfNationals": "Very receptive to the Word of God",
|
||||
"timeInCountry": "2 years",
|
||||
"correctWrongOfAnotherMissionary": "Prayer and support",
|
||||
"financialStatementPrevYear": "28,000",
|
||||
"currentMonthlySupport": 1000,
|
||||
"monthlySupportNeeded": 2000,
|
||||
"restAndRelaxation": "Once a week",
|
||||
"aloneOrTeam": "Alone",
|
||||
"childrenSchool": 0,
|
||||
"dance": false,
|
||||
"worldlyMusic": false,
|
||||
"movieTheaters": false,
|
||||
"alcohol": false,
|
||||
"smoking": false,
|
||||
"maleHair": false,
|
||||
"femaleSlacks": 0,
|
||||
"femaleShorts": 0,
|
||||
"femaleDressStandard": false,
|
||||
"swimmingClothing": null,
|
||||
"television": null,
|
||||
"dailyBible": 0,
|
||||
"numberLedToChrist": 0.0,
|
||||
"numberWitnessedTo": 0.0,
|
||||
"numberWeeklyTracts": 0.0,
|
||||
"rateOfSuccess": "Somewhat successful",
|
||||
"predestination": "All have the choice to accept or reject Jesus Chris",
|
||||
"fellowshipAssociation": "None",
|
||||
"collegeRecommendations": [
|
||||
{
|
||||
"id": 0,
|
||||
"name": "Pensacola Christian College"
|
||||
},
|
||||
{
|
||||
"id": 1,
|
||||
"name": "Bible Baptist University"
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"name": "Bible School"
|
||||
}
|
||||
],
|
||||
"admittedWrong": "All the time",
|
||||
"divorced": false,
|
||||
"groundsForRemarry": false,
|
||||
"marryADivorcee": false,
|
||||
"masonicLodge": false,
|
||||
"bibleVersionsUsed": "KVJ",
|
||||
"bibleVersionOpinion": "KJV is for the english speaking people",
|
||||
"contemporaryMusic": false,
|
||||
"charasmaticism": "Do not agree with it",
|
||||
"tongues": false,
|
||||
"repentanceNecessary": true,
|
||||
"repentanceDefinition": "Change of heart towards sin",
|
||||
"fundamentalist": false,
|
||||
"billsOnTime": "Never been late",
|
||||
"lateBills": "NA",
|
||||
"lateBillActionTaken": "NA",
|
||||
"potentialHarvest": "The harvest is plentyous"
|
||||
}
|
||||
|
|
@ -17,6 +17,14 @@ namespace OFBButte.Application.Missionary
|
|||
public MissionarySupport Handle(MissionarySupport support)
|
||||
{
|
||||
support.Id = 0;
|
||||
foreach (var child in support.Children)
|
||||
{
|
||||
child.Id = 0;
|
||||
}
|
||||
foreach(var school in support.CollegeRecommendations)
|
||||
{
|
||||
school.Id = 0;
|
||||
}
|
||||
context.MissionarySupportForms.Add(support);
|
||||
context.SaveChanges();
|
||||
return support;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
using OFBButte.Application.Database;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using OFBButte.Application.Database;
|
||||
using OFBButte.Entities;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
|
@ -17,7 +18,10 @@ namespace OFBButte.Application.Missionary
|
|||
|
||||
public MissionarySupport Handle(int id)
|
||||
{
|
||||
return context.MissionarySupportForms.FirstOrDefault(m => m.Id == id);
|
||||
return context.MissionarySupportForms
|
||||
.Include(m => m.Children)
|
||||
.Include(m => m.CollegeRecommendations)
|
||||
.FirstOrDefault(m => m.Id == id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ namespace OFBButte.Entities
|
|||
public string CellPhone { get; set; }
|
||||
public string FieldPhone { get; set; }
|
||||
public string WifesName { get; set; }
|
||||
public MissionaryChild[] Children { get; set; }
|
||||
public ICollection<MissionaryChild> Children { get; set; }
|
||||
public string Testimony { get; set; }
|
||||
public string CallToField { get; set; }
|
||||
public string SendingChurch { get; set; }
|
||||
|
|
@ -45,7 +45,7 @@ namespace OFBButte.Entities
|
|||
public string RateOfSuccess { get; set; }
|
||||
public string Predestination { get; set; }
|
||||
public string FellowshipAssociation { get; set; }
|
||||
public MissionaryCollegeRecommendation[] CollegeRecommendations { get; set; }
|
||||
public ICollection<MissionaryCollegeRecommendation> CollegeRecommendations { get; set; }
|
||||
public string AdmittedWrong { get; set; }
|
||||
public bool Divorced { get; set; }
|
||||
public bool GroundsForRemarry { get; set; }
|
||||
|
|
|
|||
Loading…
Reference in New Issue