Exemplo n.º 1
0
        //修改地球化学信息
        public ActionResult EditGeochemical(string id)
        {
            var model = new GeochemicalView();
            var m     = geochemicalSer.FirstOrDefault(x => x.G_ID == id);

            model.CopyFrom(m);
            return(View(model));
        }
Exemplo n.º 2
0
        //
        // GET: /Geochemical/
        public ActionResult Details(string id)
        {
            var model     = geochemicalSer.Find(id);
            var viewModel = new GeochemicalView();

            viewModel.CopyFrom(model);
            return(View(viewModel));
        }
Exemplo n.º 3
0
        public ActionResult AddGeochemiacal(GeochemicalView model)
        {
            if (!ModelState.IsValid)
            {
                return(WriteStatusError(ModelState));
            }
            Geochemical geochemicalmodel = new Geochemical();

            geochemicalmodel.CopyFrom(model);
            geochemicalSer.Add(geochemicalmodel);
            geochemicalmodel.G_ID = Guid.NewGuid().ToString();
            geochemicalSer.SaveChanges();
            return(WriteSuccess("添加成功"));
        }