public JsonResult GetInfo(string ID) { var mql2 = TF_LifeCommentsSet.SelectAll().Where(TF_LifeCommentsSet.Id.Equal(ID)); TF_LifeComments Rmodel = OPBiz.GetEntity(mql2); return(Json(Rmodel, JsonRequestBehavior.AllowGet)); }
public JsonResult EditInfo(TF_LifeComments EidModle) { HttpReSultMode ReSultMode = new HttpReSultMode(); bool IsAdd = false; EidModle.UpdateTime = DateTime.Now; if (!(EidModle.Id != null && !EidModle.Id.ToString().Equals("00000000-0000-0000-0000-000000000000")))//id为空,是添加 { IsAdd = true; } if (IsAdd) { EidModle.Id = Guid.NewGuid(); EidModle.CreateMan = UserData.UserName; EidModle.CreateTime = DateTime.Now; EidModle.isValid = true; EidModle.isDeleted = false; EidModle.States = -1; try { OPBiz.Add(EidModle); ReSultMode.Code = 11; ReSultMode.Data = EidModle.Id.ToString(); ReSultMode.Msg = "保存成功,请尽快提交审核!"; SysOperateLogBiz.AddSysOperateLog(UserData.Id.ToString(), UserData.UserName, e3net.Mode.OperatEnumName.新增, "生平管理--新增", true, WebClientIP, "生平管理"); } catch (Exception e) { ReSultMode.Code = -11; ReSultMode.Data = e.ToString(); ReSultMode.Msg = "添加失败"; SysOperateLogBiz.AddSysOperateLog(UserData.Id.ToString(), UserData.UserName, e3net.Mode.OperatEnumName.新增, "生平管理--新增", false, WebClientIP, "生平管理"); } } else { EidModle.WhereExpression = TF_LifeCommentsSet.Id.Equal(EidModle.Id); // EidModle.ChangedMap.Remove("id");//移除主键值 if (OPBiz.Update(EidModle) > 0) { ReSultMode.Code = 11; ReSultMode.Data = ""; ReSultMode.Msg = "保存成功,请尽快提交审核!"; SysOperateLogBiz.AddSysOperateLog(UserData.Id.ToString(), UserData.UserName, e3net.Mode.OperatEnumName.修改, "生平管理--修改", true, WebClientIP, "生平管理"); } else { ReSultMode.Code = -13; ReSultMode.Data = ""; ReSultMode.Msg = "修改失败"; SysOperateLogBiz.AddSysOperateLog(UserData.Id.ToString(), UserData.UserName, e3net.Mode.OperatEnumName.修改, "生平管理--修改", false, WebClientIP, "生平管理"); } } return(Json(ReSultMode, JsonRequestBehavior.AllowGet)); }