コード例 #1
0
ファイル: AppCommController.cs プロジェクト: gowhy/LoveBank
        public ActionResult AppPostTSAdd(Supervise entity)
        {
            JsonMessage retJson = new JsonMessage();
            try
            {

                using (LoveBankDBContext db = new LoveBankDBContext())
                {
                    entity.AddTime = DateTime.Now;
                    db.Add(entity);
                    db.SaveChanges();

                    retJson.Status = true;
                    retJson.Info = "新增成功";
                }
                return Json(retJson);
            }
            catch (Exception ex)
            {
                retJson.Status = false;
                retJson.Data = ex.Message + ex.TargetSite;

                return Json(retJson);
            }
        }
コード例 #2
0
ファイル: LBTSController.cs プロジェクト: gowhy/LoveBank
        public ActionResult PostAddSupervise(Supervise entity)
        {
            JsonMessage retJson = new JsonMessage();

            entity.DepId = BaseWebSiteConifg.DeptId;
            using (LoveBankDBContext db = new LoveBankDBContext())
            {
                if (User != null)
                {
                    entity.AddUserName = User.RealName;
                    entity.AddUserPhone = User.Phone;
                    entity.AddUser = User.ID;
                }

                entity.AddTime = DateTime.Now;
                db.Add<Supervise>(entity);
                db.SaveChanges();

                retJson.Status = true;
                retJson.Info = "提交成功";
            }
            return Json(retJson);
        }