Ejemplo n.º 1
0
        public IActionResult New()
        {
            var item = new RainfallDataEntryModel();

            item.Calendar = _model.GetLookup();
            return(View("Form", item));
        }
Ejemplo n.º 2
0
        public IActionResult Edit(int id)
        {
            var item = new RainfallDataEntryModel
            {
                Rainfall = _model.GetById(id),
                Calendar = _model.GetLookup()
            };

            return(View("Form", item));
        }
Ejemplo n.º 3
0
 public IActionResult Save(RainfallDataEntryModel item)
 {
     if (item.Rainfall.Id == 0)
     {
         _model.New(item.Rainfall);
     }
     else
     {
         _model.Update(item.Rainfall);
     }
     return(View("Index", _model.GetAll()));
 }