Пример #1
0
 public async Task<IActionResult> Create([Bind("Id_IndicatorSpecificity,Id_Indicator,Specificity")] IndicatorSpecificity indicatorSpecificity)
 {
     if (ModelState.IsValid)
     {
         _context.Add(indicatorSpecificity);
         await _context.SaveChangesAsync();
         return RedirectToAction(nameof(Index));
     }
     return View(indicatorSpecificity);
 }
Пример #2
0
        public async Task <IActionResult> Create([Bind("Id_Farm,NameFarm,FirstNameFarmer,LastNameFarmer,AddressFarm,FarmExtention")] Farm farm)
        {
            if (ModelState.IsValid)
            {
                _context.Add(farm);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(farm));
        }
Пример #3
0
        public async Task <IActionResult> Create([Bind("Id_Indicator,NameIndicator,CodeIndicator")] Indicator indicator)
        {
            if (ModelState.IsValid)
            {
                _context.Add(indicator);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(indicator));
        }
Пример #4
0
        public async Task <IActionResult> Create([Bind("Id_FamSampling,Id_Farm,DateSampling,Details,Description_CFV,Value_CFV,Description_DAS," +
                                                       "Value_DAS,Description_DFS,Value_DFS,Description_MPE,Value_MPE,Description_NCS,Value_NCS,Description_NES,Value_NES,Description_NRS," +
                                                       "Value_NRS,Description_PES,Value_PES,Description_RCES,Value_RCES,Description_RCS,Value_RCS,Description_RES,Value_RES,Description_VBS," +
                                                       "Value_VBS,Description_AF,Value_AF,AnimalsAmount,IVEA")] FarmSampling farmSampling)
        {
            if (ModelState.IsValid)
            {
                farmSampling.IVEA = (float)farmSampling.IndexValue;

                _context.Add(farmSampling);

                await _context.SaveChangesAsync();

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