public async Task <IActionResult> SavePhotos(SavePhotoViewModel SavePhoto, int burialId) { if (ModelState.IsValid) { string url = await _s3storage.AddItem(SavePhoto.PhotoFile, "test"); Burial burial_to_add = context.Burial.Find(burialId); Files FileRecord = new Files { FileUrl = url, Type = SavePhoto.Type, Burial = burial_to_add, BurialId = burial_to_add.BurialId }; context.Add(FileRecord); context.SaveChanges(); return(RedirectToAction("SingleBurial", new { BurialId = burialId })); } else { return(View("ErrorBurial")); } }
public async Task <IActionResult> Create([Bind("Email,LockoutEnabled,LockoutEnd,PhoneNumber")] IdentityRole user) { if (ModelState.IsValid) { _context.Add(user); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(user)); }
public async Task <IActionResult> Create([Bind("BurialId,BoneId,BasilarSuture,VentralArc,SubpubicAngle,SciaticNotch,PubicBone,PreaurSulcus,MedialIpRamus,DorsalPitting,ForemanMagnum,FemurHead,HumerusHead,Osteophytosis,PubicSymphysis,BoneLength,MedialClavicle,IliacCrest,FemurDiameter,Humerus,FemurLength,HumerusLength,TibiaLength,Robust,SupraorbitalRidges,OrbitEdge,ParietalBossing,Gonian,NuchalCrest,ZygomaticCrest,CranialSuture,MaximumCranialLength,MaximumCranialBreadth,BasionBregmaHeight,BasionNasion,BasionProsthionLength,BizygomaticDiameter,NasionProsthion,MaximumNasalBreadth,InterorbitalBreadth,OsteologyNotes,BurialArtifactDescription,BuriedWithArtifacts,GilesGender")] Bones bones) { if (ModelState.IsValid) { _context.Add(bones); await _context.SaveChangesAsync(); return(RedirectToAction("BurialDetails", "Home", new { burialId = bones.BurialId })); } ViewData["BurialId"] = new SelectList(_context.MainTbl, "BurialId", "BurialId", bones.BurialId); return(View(bones)); }
public async Task <IActionResult> Create([Bind("BurialId,BioId,HairTaken,SoftTissueTaken,BoneTaken,ToothTaken,TextileTaken,DescriptionOfTaken,ArtifactFound,EstimateAge,EstimateLivingStature,ToothAttrition,ToothEruption,PathologyAnomalies,EpiphysealUnion,Burialsampletaken")] Biology biology) { if (ModelState.IsValid) { _context.Add(biology); await _context.SaveChangesAsync(); return(RedirectToAction("BurialDetails", "Home", new { burialId = biology.BurialId })); } ViewData["BurialId"] = new SelectList(_context.MainTbl, "BurialId", "BurialId", biology.BurialId); return(View(biology)); }
public async Task <IActionResult> Create([Bind("BurialId,SampleId,Rack,Bag,Cluster,Date,PreviouslySampled,Notes,Initials")] Samples samples) { if (ModelState.IsValid) { _context.Add(samples); await _context.SaveChangesAsync(); return(RedirectToAction("BurialDetails", "Home", new { burialId = samples.BurialId })); } ViewData["BurialId"] = samples.BurialId; return(View(samples)); }
public async Task <IActionResult> Create([Bind("SampleId,CarbonId,Rack,Tube,Description,SizeMl,Foci,C14Sample2017,Location,QuestionS,Unknown,Conventional14cAgeBp,_14cCalendarDate,Calibrated95CalendarDateMax,Calibrated95CalendarDateMin,Calibrated95CalendarDateSpan,Calibrated95CalendarDateAvg,Category,Notes")] Carbon carbon) { if (ModelState.IsValid) { _context.Add(carbon); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["SampleId"] = carbon.SampleId; double?currBurialId = _context.Samples.Where(s => s.SampleId == carbon.SampleId).First().BurialId; return(RedirectToAction("BurialDetails", "Home", new { burialId = currBurialId })); }
public IActionResult CustomCreate(FieldBook fieldNote) { if (ModelState.IsValid) { _context.Add(fieldNote); _context.SaveChanges(); return(View("RecordDetails", new FieldNotesViewModel { fieldNotes = _context.FieldBook.Where(x => x.BurialId == fieldNote.BurialId), burial = _context.Burials.Where(x => x.BurialId == fieldNote.BurialId).FirstOrDefault(), fieldNote = fieldNote })); } return(View(fieldNote)); }
// Create new carbon dating -- create is keyword with strange functions public IActionResult CustomCreate(C14 carbDateSample) { if (ModelState.IsValid) { _context.Add(carbDateSample); _context.SaveChanges(); return(View("RecordDetails", new CarbonDatingViewModel { carbDateSamples = _context.C14s.Where(x => x.BurialId == carbDateSample.BurialId), burial = _context.Burials.Where(x => x.BurialId == carbDateSample.BurialId).FirstOrDefault(), carbDateSample = carbDateSample })); } return(View(carbDateSample)); }
public async Task <IActionResult> Create([Bind("BurialId,BurialId2018,YearOnSkull,MonthOnSkull,DateOnSkull,InitialsOfDataEntryExpert,InitialsOfDataEntryChecker,ByuSample,BodyAnalysis,SkullAtMagazine,PostcraniaAtMagazine,AgeSkull2018,RackAndShelf,ToBeConfirmed,SkullTrauma,PostcraniaTrauma,CribraOrbitala,PoroticHyperostosis,PoroticHyperostosisLocations,MetopicSuture,ButtonOsteoma,PostcraniaTrauma1,OsteologyUnknownComment,TemporalMandibularJointOsteoarthritisTmjOa,LinearHypoplasiaEnamel,AreaHillBurials,Tomb,NsLowPosition,NsHighPosition,NorthOrSouth,EwLowPosition,EwHighPosition,EastOrWest,Square,BurialNumber,BurialWestToHead,BurialWestToFeet,BurialSouthToHead,BurialSouthToFeet,BurialDepth,YearExcav,MonthExcavated,DateExcavated,BurialDirection,BurialPreservation,BurialWrapping,BurialAdultChild,Sex,GenderCode,BurialGenderMethod,AgeCodeSingle,BurialDirection1,NumericMinAge,NumericMaxAge,BurialAgeMethod,HairColorCode,BurialSampleTaken,LengthM,LengthCm,Goods,Cluster,FaceBundle,OsteologyNotes,OtherNotes,SampleNumber,GenderGe,GeFunctionTotal,GenderBodyCol,BasilarSuture,VentralArc,SubpubicAngle,SciaticNotch,PubicBone,PreaurSulcus,MedialIpRamus,DorsalPitting,ForemanMagnum,FemurHead,HumerusHead,Osteophytosis,PubicSymphysis,BoneLength,MedialClavicle,IliacCrest,FemurDiameter,Humerus,FemurLength,HumerusLength,TibiaLength,Robust,SupraorbitalRidges,OrbitEdge,ParietalBossing,Gonian,NuchalCrest,ZygomaticCrest,CranialSuture,MaximumCranialLength,MaximumCranialBreadth,BasionBregmaHeight,BasionNasion,BasionProsthionLength,BizygomaticDiameter,NasionProsthion,MaximumNasalBreadth,InterorbitalBreadth,ArtifactsDescription,PreservationIndex,HairTaken,SoftTissueTaken,BoneTaken,ToothTaken,TextileTaken,DescriptionOfTaken,ArtifactFound,EstimateLivingStature,ToothAttrition,ToothEruption,PathologyAnomalies,EpiphysealUnion,SsmaTimeStamp")] Burial burials) { burials.BurialId = burials.NorthOrSouth + " " + burials.NsLowPosition + "/" + burials.NsHighPosition + " " + burials.EastOrWest + " " + burials.EwLowPosition + "/" + burials.EwHighPosition + " " + burials.Square + " #" + burials.BurialNumber; if (ModelState.IsValid) { _context.Add(burials); await _context.SaveChangesAsync(); return(View("Details", burials)); } ViewData["AgeCodeSingle"] = new SelectList(_context.AgeCodes, "AgeCode1", "AgeCode1", burials.AgeCodeSingle); ViewData["BurialAdultChild"] = new SelectList(_context.BurialAdultChildren, "BurialAdultChild1", "BurialAdultChild1", burials.BurialAdultChild); ViewData["BurialWrapping"] = new SelectList(_context.BurialWrappings, "BurialWrapping1", "BurialWrapping1", burials.BurialWrapping); return(View(burials)); }
public IActionResult CustomCreate([Bind("BurialId,Rack,F3,Bag,LowNs,HighNs,NorthOrSouth,LowEw,HighEw,EastOrWest,Area,BurialNumber,ClusterNumber,Date,PreviouslySampled,Notes,Initials,Id")] BiologicalSample bio) { if (ModelState.IsValid) { _context.Add(bio); _context.SaveChanges(); return(View("RecordSpecificIndex", new BioSampleViewModel { biologicalSamples = _context.BiologicalSamples.Where(x => x.BurialId == bio.BurialId), burial = _context.Burials.Where(x => x.BurialId == bio.BurialId).FirstOrDefault(), bioSample = bio })); } ViewData["BurialId"] = new SelectList(_context.Burials, "BurialId", "BurialId", bio.BurialId); return(View(bio)); }
public IActionResult CustomCreate(Cranial cranialSample) { if (_context.Cranials.Where(x => x.BurialId == cranialSample.BurialId).FirstOrDefault() != null) { return(View("No")); } if (ModelState.IsValid) { _context.Add(cranialSample); _context.SaveChanges(); return(View("RecordDetails", new CranialViewModel { cranialSamples = _context.Cranials.Where(x => x.BurialId == cranialSample.BurialId), burial = _context.Burials.Where(x => x.BurialId == cranialSample.BurialId).FirstOrDefault(), cranialSample = cranialSample })); } return(View(cranialSample)); }