/// <summary> /// 更新数据 /// </summary> /// <param name="model"></param> /// <returns></returns> public MessageModel UpdateQSCard(QSCardModel model) { Func <IEntityContext, string> operation = delegate(IEntityContext context) { var basemodel = context.QSCard.Find(model.QSID); if (basemodel != null) { basemodel.CompanyID = model.CompanyID; basemodel.QSName = model.QSName; basemodel.CheckType = model.CheckType; basemodel.QSCard = model.QSCard; basemodel.IssuingTime = model.IssuingTime; basemodel.IssuingUnit = model.IssuingUnit; basemodel.Validity = model.Validity; basemodel.Remark = model.Remark; basemodel.IsLocked = model.IsLocked; basemodel.IsShow = model.IsShow; basemodel.ModifyID = UserManagement.CurrentUser.UserID; basemodel.ModifyName = UserManagement.CurrentUser.UserName; basemodel.ModifyTime = DateTime.Now; context.UpdateAndSave(basemodel); } return(string.Empty); }; return(base.DbOperationInTransaction(operation)); }
/// <summary> /// 保存数据 /// </summary> /// <param name="model"></param> /// <returns></returns> public JsonResult SaveCardData(QSCardModel model) { var result = new ResultJson(); try { var msg = new MessageModel(); if (model.QSID == 0) { msg = _qsCardService.InsertQSCard(model); } else { msg = _qsCardService.UpdateQSCard(model); } if (msg.Status == MessageStatus.Success) { result.IsSuccess = true; } } catch { } return(Json(result)); }
/// <summary> /// 新增数据 /// </summary> /// <param name="model"></param> public MessageModel InsertQSCard(QSCardModel model) { Func <IEntityContext, string> operation = delegate(IEntityContext context) { model.ModifyID = UserManagement.CurrentUser.UserID; model.ModifyName = UserManagement.CurrentUser.UserName; model.ModifyTime = DateTime.Now; context.QSCard.Add(model); context.SaveChanges(); return(string.Empty); }; return(base.DbOperationInTransaction(operation)); }
/// <summary> /// 更新数据 /// </summary> /// <param name="model"></param> /// <returns></returns> public MessageModel UpdateQSCard(QSCardModel model) { return(_qsCardAccess.UpdateQSCard(model)); }
/// <summary> /// 新增数据 /// </summary> /// <param name="model"></param> public MessageModel InsertQSCard(QSCardModel model) { return(_qsCardAccess.InsertQSCard(model)); }