Beispiel #1
0
        public async Task <IActionResult> Create([Bind("BurialSquareId,BurialLocationNs,BurialLocationEw,LowPairNs,HighPairNs,LowPairEw,HighPairEw")] BurialSquare burialSquare)
        {
            string strLowNS  = burialSquare.LowPairNs.ToString();
            string strHighNS = burialSquare.HighPairNs.ToString();
            string strLowEW  = burialSquare.LowPairEw.ToString();
            string strHighEW = burialSquare.HighPairEw.ToString();


            burialSquare.BurialSquareId = burialSquare.BurialLocationNs + " " + strLowNS + "/" + strHighNS + " " + burialSquare.BurialLocationEw + " " + strLowEW + "/" + strHighEW;

            if (ModelState.IsValid)
            {
                _context.Add(burialSquare);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }

            var role = (mummyContext.UserRoles
                        .Where(r => r.UserId == userManager.GetUserId(User))
                        .FirstOrDefault());

            if (!(role is null))
            {
                ViewBag.Role = Int32.Parse(role.RoleId);
            }
            return(View(burialSquare));
        }
        public async Task <IActionResult> Create([Bind("ImageId,BurialId,BurialSquareId,BurialSubplot,CranialId,Image1,ImageDescription")] Image image)
        {
            if (ModelState.IsValid)
            {
                _context.Add(image);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }

            var role = (mummyContext.UserRoles
                        .Where(r => r.UserId == userManager.GetUserId(User))
                        .FirstOrDefault());



            if (!(role is null))
            {
                ViewBag.Role = Int32.Parse(role.RoleId);
            }
            ViewData["BurialId"]       = new SelectList(_context.Burial, "BurialId", "BurialWrapping", image.BurialId);
            ViewData["BurialSubplot"]  = new SelectList(_context.BurialQuadrant, "BurialSubplot", "BurialSubplot", image.BurialSubplot);
            ViewData["BurialSquareId"] = new SelectList(_context.BurialSquare, "BurialSquareId", "BurialSquareId", image.BurialSquareId);
            ViewData["CranialId"]      = new SelectList(_context.CranialSample, "CranialId", "CranialId", image.CranialId);
            return(View(image));
        }
        public async Task <IActionResult> Create([Bind("BurialSquareId,BurialSubplot")] BurialQuadrant burialQuadrant)
        {
            if (ModelState.IsValid)
            {
                _context.Add(burialQuadrant);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }

            var role = (mummyContext.UserRoles
                        .Where(r => r.UserId == userManager.GetUserId(User))
                        .FirstOrDefault());

            if (!(role is null))
            {
                ViewBag.Role = Int32.Parse(role.RoleId);
            }
            return(View(burialQuadrant));
        }
        public async Task <IActionResult> Create([Bind("CranialId,BurialId,SampleNumber,RackShelf,RackNumber,MaxCranialLength,MaxCranialBreadth,BasionBregmaHeight,BasionNasion,BasionProsthionLength,BizgomaticDiameter,NasionProsthion,MaxNasalBreadth,InterobitalBreadth")] CranialSample cranialSample)
        {
            if (ModelState.IsValid)
            {
                _context.Add(cranialSample);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }

            var role = (mumContext.UserRoles
                        .Where(r => r.UserId == userManager.GetUserId(User))
                        .FirstOrDefault());

            if (!(role is null))
            {
                ViewBag.Role = Int32.Parse(role.RoleId);
            }
            ViewData["BurialId"]  = new SelectList(_context.Burial, "BurialId", "BurialWrapping", cranialSample.BurialId);
            ViewData["RackShelf"] = new SelectList(_context.RackSample, "RackShelf", "RackShelf", cranialSample.RackShelf);
            return(View(cranialSample));
        }
Beispiel #5
0
        public async Task <IActionResult> Create([Bind("RackShelf,RackNumber,IsBag,BurialId,TubeNumber,RankDescription,MlSize,Foci,LocationNotes,Questions,Conventional14cAgeBp,_14cCalendarDay,Calibrated95CalendarDateMax,Calibrated95CalendarDateMin,Calibrated95CalendarDateSpan,Calibrated95CalendarDateAvg,Category,Notes")] RackSample rackSample)
        {
            if (ModelState.IsValid)
            {
                _context.Add(rackSample);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }

            var role = (mummyContext.UserRoles
                        .Where(r => r.UserId == userManager.GetUserId(User))
                        .FirstOrDefault());



            if (!(role is null))
            {
                ViewBag.Role = Int32.Parse(role.RoleId);
            }
            ViewData["BurialId"] = new SelectList(_context.Burial, "BurialId", "BurialWrapping", rackSample.BurialId);
            return(View(rackSample));
        }