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 async Task <IActionResult> SavePhoto(BurialListViewModel photo) { // magic happens here // check if model is not empty //Photo uploadPhoto = (Photo)photo.ImageUpload; var x = photo.ImageUpload; string id = x.BurialId; string fileName = x.file.FileName; if (ModelState.IsValid) { // create new entity await _s3Storage.AddItem(photo.ImageUpload.file, "ForFun"); Photo PhotoTable = new Photo { BurialId = x.BurialId, PhotoId = fileName, Burial = _context.Burials.Where(x => x.BurialId == id).FirstOrDefault() }; Burial bur = _context.Burials.Where(x => x.BurialId == id).FirstOrDefault(); _context.Photos.Add(PhotoTable); await _context.SaveChangesAsync(); return(View("Details", new PhotosViewModel() { Photos = _context.Photos .Where(x => x.BurialId == id), Burial = _context.Burials .Where(x => x.BurialId == id).FirstOrDefault() })); } else { return(View("Home")); } }
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 async Task <IActionResult> DeleteConfirmed(int id) { var fieldNote = _context.FieldBook .Where(x => x.Id == id).FirstOrDefault(); _context.FieldBook.Remove(fieldNote); await _context.SaveChangesAsync(); return(View("RecordDetails", new FieldNotesViewModel() { fieldNotes = _context.FieldBook .Where(x => x.BurialId == fieldNote.BurialId), burial = _context.Burials .Where(x => x.BurialId == fieldNote.BurialId).FirstOrDefault() })); }
// Delete a specific bio sample related to a burial id public async Task <IActionResult> DeleteConfirmed(int id) { var biologicalSample = _context.BiologicalSamples .Where(x => x.Id == id).FirstOrDefault(); _context.BiologicalSamples.Remove(biologicalSample); await _context.SaveChangesAsync(); return(View("RecordSpecificIndex", new BioSampleViewModel() { biologicalSamples = _context.BiologicalSamples .Where(x => x.BurialId == biologicalSample.BurialId), burial = _context.Burials .Where(x => x.BurialId == biologicalSample.BurialId).FirstOrDefault() })); }
// Delete a specific carbon sample record public async Task <IActionResult> DeleteConfirmed(int id) { var carbDateSample = _context.C14s .Where(x => x.Id == id).FirstOrDefault(); _context.C14s.Remove(carbDateSample); await _context.SaveChangesAsync(); return(View("RecordDetails", new CarbonDatingViewModel() { carbDateSamples = _context.C14s .Where(x => x.BurialId == carbDateSample.BurialId), burial = _context.Burials .Where(x => x.BurialId == carbDateSample.BurialId).FirstOrDefault() })); }
// Delete speific cranial data public async Task <IActionResult> DeleteConfirmed(string id) { string newid = id.Replace("%2F", "/"); if (newid == null) { return(NotFound()); } var cranialSample = _context.Cranials .Where(x => x.BurialId == newid).FirstOrDefault(); _context.Cranials.Remove(cranialSample); await _context.SaveChangesAsync(); return(View("RecordDetails", new CranialViewModel() { cranialSamples = _context.Cranials .Where(x => x.BurialId == cranialSample.BurialId), burial = _context.Burials .Where(x => x.BurialId == cranialSample.BurialId).FirstOrDefault() })); }