示例#1
0
        public async Task <IActionResult> Create([Bind("ProductCategoryId,ProductCategoryName")] PtsProductCategory ptsProductCategory)
        {
            if (ModelState.IsValid)
            {
                _context.Add(ptsProductCategory);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(ptsProductCategory));
        }
        public async Task <IActionResult> Create([Bind("FieldBlockId,BlockChar,YearCreated,BlockDescription")] PtsFieldBlock ptsFieldBlock)
        {
            if (ModelState.IsValid)
            {
                _context.Add(ptsFieldBlock);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(ptsFieldBlock));
        }
        public async Task <IActionResult> Create([Bind("TreatmentTypeId,TreatmentTypeName")] PtsTreatmentType ptsTreatmentType)
        {
            if (ModelState.IsValid)
            {
                _context.Add(ptsTreatmentType);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(ptsTreatmentType));
        }
        public async Task <IActionResult> Create([Bind("UserId,Username,UserPassword,Firstname,Lastname,EmailAddress")] PtsUser ptsUser)
        {
            if (ModelState.IsValid)
            {
                _context.Add(ptsUser);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(ptsUser));
        }
        public async Task <IActionResult> Create([Bind("ProductId,ProductName,ProductOwner,ProductCategoryId")] PtsProduct ptsProduct)
        {
            if (ModelState.IsValid)
            {
                _context.Add(ptsProduct);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["ProductCategoryId"] = new SelectList(_context.PtsProductCategory, "ProductCategoryId", "ProductCategoryName", ptsProduct.ProductCategoryId);
            return(View(ptsProduct));
        }
示例#6
0
        public async Task <IActionResult> Create([Bind("PlantId,PlantName,PlantTypeId")] PtsPlant ptsPlant)
        {
            if (ModelState.IsValid)
            {
                _context.Add(ptsPlant);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["PlantTypeId"] = new SelectList(_context.PtsPlantType, "PlantTypeId", "PlantTypeName", ptsPlant.PlantTypeId);
            return(View(ptsPlant));
        }
示例#7
0
        public async Task <IActionResult> Create([Bind("TreatmentImageId,ImagePath,Caption,TreatmentId")] PtsTreatmentImage ptsTreatmentImage)
        {
            if (ModelState.IsValid)
            {
                _context.Add(ptsTreatmentImage);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["TreatmentId"] = new SelectList(_context.PtsTreatment, "TreatmentId", "TreatmentId", ptsTreatmentImage.TreatmentId);
            return(View(ptsTreatmentImage));
        }
示例#8
0
        public async Task <IActionResult> Create([Bind("TreatmentCommentId,TreatmentId,CommentId")] PtsTreatmentComment ptsTreatmentComment)
        {
            if (ModelState.IsValid)
            {
                _context.Add(ptsTreatmentComment);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["CommentId"]   = new SelectList(_context.PtsComment, "CommentId", "CommentText", ptsTreatmentComment.CommentId);
            ViewData["TreatmentId"] = new SelectList(_context.PtsTreatment, "TreatmentId", "TreatmentId", ptsTreatmentComment.TreatmentId);
            return(View(ptsTreatmentComment));
        }
        public async Task <IActionResult> Create([Bind("TrialGroupId,TrialGroupNr,PlantId,FieldBlockId")] PtsTrialGroup ptsTrialGroup)
        {
            if (ModelState.IsValid)
            {
                _context.Add(ptsTrialGroup);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["FieldBlockId"] = new SelectList(_context.PtsFieldBlock, "FieldBlockId", "BlockChar", ptsTrialGroup.FieldBlockId);
            ViewData["PlantId"]      = new SelectList(_context.PtsPlant, "PlantId", "PlantName", ptsTrialGroup.PlantId);
            return(View(ptsTrialGroup));
        }
        public async Task <IActionResult> Create([Bind("ResultFormatId,ResultFormatTitle,ResultFormatDescription,TrialBlockId,UnitTypeId")] PtsResultFormat ptsResultFormat)
        {
            if (ModelState.IsValid)
            {
                _context.Add(ptsResultFormat);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["TrialBlockId"] = new SelectList(_context.PtsTrialBlock, "TrialBlockId", "TrialBlockId", ptsResultFormat.TrialBlockId);
            ViewData["UnitTypeId"]   = new SelectList(_context.PtsUnitType, "UnitTypeId", "UnitTypeName", ptsResultFormat.UnitTypeId);
            return(View(ptsResultFormat));
        }
        public async Task <IActionResult> Create([Bind("TrialTypeDosageTypeId,TrialTypeId,DosageTypeId")] PtsTrialTypeDosageType ptsTrialTypeDosageType)
        {
            if (ModelState.IsValid)
            {
                _context.Add(ptsTrialTypeDosageType);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["DosageTypeId"] = new SelectList(_context.PtsDosageType, "DosageTypeId", "DosageTypeId", ptsTrialTypeDosageType.DosageTypeId);
            ViewData["TrialTypeId"]  = new SelectList(_context.PtsTrialType, "TrialTypeId", "TrialTypeId", ptsTrialTypeDosageType.TrialTypeId);
            return(View(ptsTrialTypeDosageType));
        }
        public async Task <IActionResult> Create([Bind("TrialBlockId,TrialBlockDescription,TrialEnd,TrialTypeId,FieldBlockId")] PtsTrialBlock ptsTrialBlock)
        {
            if (ModelState.IsValid)
            {
                _context.Add(ptsTrialBlock);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["FieldBlockId"] = new SelectList(_context.PtsFieldBlock, "FieldBlockId", "BlockChar", ptsTrialBlock.FieldBlockId);
            ViewData["TrialTypeId"]  = new SelectList(_context.PtsTrialType, "TrialTypeId", "TrialTypeId", ptsTrialBlock.TrialTypeId);
            return(View(ptsTrialBlock));
        }
示例#13
0
        public async Task <IActionResult> Create([Bind("DosageAmountId,ResultValue,UnitTypeId,DosageTypeId")] PtsDosageAmount ptsDosageAmount)
        {
            if (ModelState.IsValid)
            {
                _context.Add(ptsDosageAmount);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["DosageTypeId"] = new SelectList(_context.PtsDosageType, "DosageTypeId", "DosageTypeId", ptsDosageAmount.DosageTypeId);
            ViewData["UnitTypeId"]   = new SelectList(_context.PtsUnitType, "UnitTypeId", "UnitTypeName", ptsDosageAmount.UnitTypeId);
            return(View(ptsDosageAmount));
        }
示例#14
0
        public async Task <IActionResult> Create([Bind("ResultEntryId,ResultValue,ResultFormatId,DosageAmountId,TrialGroupId")] PtsResultEntry ptsResultEntry)
        {
            if (ModelState.IsValid)
            {
                _context.Add(ptsResultEntry);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["DosageAmountId"] = new SelectList(_context.PtsDosageAmount, "DosageAmountId", "DosageAmountId", ptsResultEntry.DosageAmountId);
            ViewData["ResultFormatId"] = new SelectList(_context.PtsResultFormat, "ResultFormatId", "ResultFormatDescription", ptsResultEntry.ResultFormatId);
            ViewData["TrialGroupId"]   = new SelectList(_context.PtsTrialGroup, "TrialGroupId", "TrialGroupId", ptsResultEntry.TrialGroupId);
            return(View(ptsResultEntry));
        }