Exemple #1
0
        //添加剖面
        public ActionResult AddSection(SectionView model, string RID11, string RID22, string RID33, double?Altitude1)
        {
            model.Altitude = Altitude1;
            model.RID1     = RID11;
            model.RID2     = RID22;
            model.RID3     = RID33;
            ModelState.Remove("Altitude1");
            if (!ModelState.IsValid)
            {
                return(WriteStatusError(ModelState));
            }
            if (sectionSer.Any(x => x.SectionName == model.SectionName))
            {
                return(WriteError("剖面名称" + model.SectionName + "已经存在,请确认!"));
            }
            var user = UserMgr.CurrUserInfo();

            model.User_ID = user.User_ID;
            var Model = new Section();

            Model.CopyFrom(model);
            sectionSer.Add(Model);
            Model.S_ID = Guid.NewGuid().ToString();
            sectionSer.SaveChanges();
            return(WriteSuccess(new
            {
                Model.S_ID,
                msg = "添加成功!"
            }));
        }
Exemple #2
0
 public ActionResult GetCurrentUser()
 {
     return(WriteSuccess(UserMgr.CurrUserInfo()));
 }