//////////////Голова окружної комісії //обрати чи змiнити голiв дiльничних комiсiй (до початку виборiв); //INSERT INTO chief_house_officer(election_id, virtual_house_id, citizen_id) // VALUES(,,); //UPDATE chief_house_officer //SET citizen_id = id //WHERE chief_house_officer=1; public static void AddChiefHouseOfficer(Election election, VirtualHouse VirtualHouse, Citizen citizen) { using (ElectionContext db = new ElectionContext()) { var ChiefHouseOfficer = new ChiefHouseOfficer { ElectionId = election.ElectionId, VirtualHouseId = VirtualHouse.VirtualHouseId, CitizenId = citizen.CitizenId }; db.ChiefHouseOfficer.Add(ChiefHouseOfficer); db.SaveChanges(); } }
////////////Голова ЦВК //обрати чи змiнити голiв окружних комiсiй (до початку виборiв); //database.Add(chief_region_officer); //var id = 1; //var virtual_house = database.First(cro => cro.chief_region_officer_id == id); public static void AddChiefRegionOfficer(Election election, VirtualRegion virtualRegion, Citizen citizen) { using (ElectionContext db = new ElectionContext()) { var chiefRegionOfficer = new ChiefRegionOfficer { ElectionId = election.ElectionId, VirtulRegionId = virtualRegion.VirtualRegionId, CitizenId = citizen.CitizenId }; db.ChiefRegionOfficer.Add(chiefRegionOfficer); db.SaveChanges(); } }