Ejemplo n.º 1
0
        public ActionResult Create(ResourcesVM resourcevm)
        {
            if (!ModelState.IsValid)
            {
                RedirectToAction("Create");
            }

            Resources res = new Resources
            {
                TypeResource  = resourcevm.TypeResource,
                Date_Location = resourcevm.Date_Location,
                Longitude     = double.Parse(resourcevm.Longitude, System.Globalization.CultureInfo.InvariantCulture),
                Latitude      = double.Parse(resourcevm.Latitude, System.Globalization.CultureInfo.InvariantCulture),
                Description   = resourcevm.Description
            };

            ResourcesService.Add(res);
            ResourcesService.Commit();


            return(RedirectToAction("Index"));
        }