Example #1
0
        //Create new burial WITH a subplot
        public IActionResult CreateWith(string SelectedSquareId)
        {
            if (SelectedSquareId == "0")
            {
                return(NotFound());
            }

            SelectedSquareId    = SelectedSquareId.Replace("%2F", "/");
            ViewBag.Sid         = SelectedSquareId;
            ViewBag.CreateParam = "NoAdditional";
            BurialInformationViewModel viewModel = new BurialInformationViewModel
            {
                BurialSquare        = _context.BurialSquare.ToList(),
                BurialQuadrantsList = _context.BurialQuadrant.ToList(),
                Burial = new Burial {
                },
            };
            var role = (wantContext.UserRoles
                        .Where(r => r.UserId == userManager.GetUserId(User))
                        .FirstOrDefault());

            if (!(role is null))
            {
                ViewBag.Role = Int32.Parse(role.RoleId);
            }
            return(View(viewModel));
        }
Example #2
0
        //on get for create1 (will be deleteing Create Actions and using Create1,2,3 etc)
        public IActionResult Create1()
        {
            BurialInformationViewModel viewModel = new BurialInformationViewModel
            {
                BurialSquare        = _context.BurialSquare.ToList(),
                BurialQuadrantsList = _context.BurialQuadrant.ToList(),
                Burial = new Burial {
                },
            };

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

            if (!(role is null))
            {
                ViewBag.Role = Int32.Parse(role.RoleId);
            }

            return(View(viewModel));
        }
Example #3
0
        // GET: Burials/Edit/5
        public async Task <IActionResult> Edit(int id, string BurialSquareId)
        {
            if (id == null)
            {
                return(NotFound());
            }
            ViewBag.BurialId = id;

            BurialInformationViewModel viewModel = new BurialInformationViewModel
            {
                BurialSquare        = _context.BurialSquare.ToList(),
                BurialQuadrantsList = _context.BurialQuadrant.Where(x => x.BurialSquareId == BurialSquareId).ToList(),
                Burial = await _context.Burial.FindAsync(id),
            };

            var burial = await _context.Burial.FindAsync(id);

            //if (burial == null)
            //{
            //    return NotFound();
            //}

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

            if (!(role is null))
            {
                ViewBag.Role = Int32.Parse(role.RoleId);
            }

            ViewData["BurialSubplot"]  = new SelectList(_context.BurialQuadrant, "BurialSubplot", "BurialSubplot", burial.BurialSubplot);
            ViewData["BurialSquareId"] = new SelectList(_context.BurialSquare, "BurialSquareId", "BurialSquareId", burial.BurialSquareId);
            //ViewBag.Subplot = burial.BurialSubplot;
            return(View(viewModel));
        }
Example #4
0
        public IActionResult CreateAdditional(string SelectedSquareId, string BurialSubplot, int BurialNumber,
                                              int BurialDepth, int SouthToHead, int SouthToFeet, int WestToHead, int WestToFeet, string BurialSituation,
                                              string BurialWrapping, string BurialWrappingMaterial, bool BurialAdult, int LengthOfRemains, int SampleNumber,
                                              string GenderGe, bool SexMethodSkull, double GeFunctionTotal, string HeadDirection)
        {
            ViewBag.CreateParam = "Additional";

            SelectedSquareId               = SelectedSquareId.Replace("%2F", "/");
            ViewBag.BurialSquareId         = SelectedSquareId;
            ViewBag.BurialSubplot          = BurialSubplot;
            ViewBag.BurialNumber           = BurialNumber;
            ViewBag.BurialDepth            = BurialDepth;
            ViewBag.SouthToHead            = SouthToHead;
            ViewBag.SouthToFeet            = SouthToFeet;
            ViewBag.WestToHead             = WestToHead;
            ViewBag.WestToFeet             = WestToFeet;
            ViewBag.BurialSituation        = BurialSituation;
            ViewBag.BurialWrapping         = BurialWrapping;
            ViewBag.BurialWrappingMaterial = BurialWrappingMaterial;
            ViewBag.BurialAdult            = BurialAdult;
            ViewBag.LengthOfRemains        = LengthOfRemains;
            ViewBag.SampleNumber           = SampleNumber;
            ViewBag.GenderGe               = GenderGe;
            ViewBag.SexMethodSkull         = SexMethodSkull;
            ViewBag.GeFunctionTotal        = GeFunctionTotal;
            ViewBag.HeadDirection          = HeadDirection;

            BurialInformationViewModel viewModel = new BurialInformationViewModel
            {
                BurialSquare        = _context.BurialSquare.ToList(),
                BurialQuadrantsList = _context.BurialQuadrant.ToList(),
                Burial                 = new Burial {
                },
                SelectedSquareId       = SelectedSquareId,
                BurialSubplot          = BurialSubplot,
                BurialNumber           = BurialNumber,
                BurialDepth            = BurialDepth,
                SouthToHead            = SouthToHead,
                SouthToFeet            = SouthToFeet,
                WestToHead             = WestToHead,
                WestToFeet             = WestToFeet,
                BurialSituation        = BurialSituation,
                BurialWrapping         = BurialWrapping,
                BurialWrappingMaterial = BurialWrappingMaterial,
                BurialAdult            = BurialAdult,
                LengthOfRemains        = LengthOfRemains,
                SampleNumber           = SampleNumber,
                GenderGe               = GenderGe,
                SexMethodSkull         = SexMethodSkull,
                GeFunctionTotal        = GeFunctionTotal,
                HeadDirection          = HeadDirection,
            };
            var role = (wantContext.UserRoles
                        .Where(r => r.UserId == userManager.GetUserId(User))
                        .FirstOrDefault());

            if (!(role is null))
            {
                ViewBag.Role = Int32.Parse(role.RoleId);
            }
            return(View(viewModel));
        }