コード例 #1
0
        public MessageModel UpdateSingleEntity(CodeObjectModel model)
        {
            Func <IEntityContext, string> operation = delegate(IEntityContext context)
            {
                var data = context.CodeObject.FirstOrDefault(m => m.ObjectID == model.ObjectID);
                if (data == null)
                {
                    return("当前数据不存在或被更新,请刷新后再次操作!");
                }
                data.ObjectCode    = model.ObjectCode;
                data.ObjectName    = model.ObjectName;
                data.Prefix        = model.Prefix;
                data.MaxLength     = model.MaxLength;
                data.SeqLength     = model.SeqLength;
                data.IsFixedLength = model.IsFixedLength;
                data.IsAuto        = model.IsAuto;
                data.SortID        = model.SortID;
                data.Remark        = model.Remark;
                data.IsLocked      = model.IsLocked;
                data.IsShow        = model.IsShow;
                data.ModifyID      = model.ModifyID;
                data.ModifyName    = model.ModifyName;
                data.ModifyTime    = DateTime.Now;
                context.SaveChanges();
                return(string.Empty);
            };

            return(base.DbOperation(operation));
        }
コード例 #2
0
        public ActionResult Edit(CodeObjectModel codeObjectModel)
        {
            var result = codeObjectService.UpdateSingleCodeObject(codeObjectModel);
            var flag   = result.Status == MessageStatus.Success ? true : false;
            var msg    = result.Message;

            return(Json(new { flag = flag, msg = msg }));
        }
コード例 #3
0
        public MessageModel InsertSingleEntity(CodeObjectModel model)
        {
            Func <IEntityContext, string> operation = delegate(IEntityContext context)
            {
                model.ModifyID   = UserManagement.CurrentUser.UserID;
                model.ModifyName = UserManagement.CurrentUser.UserName;
                model.ModifyTime = DateTime.Now;
                context.CodeObject.Add(model);
                context.SaveChanges();
                return(string.Empty);
            };

            return(base.DbOperation(operation));
        }
コード例 #4
0
 /// <summary>
 /// 编辑单条CodeObject
 /// </summary>
 /// <param name="model">对象规则信息实体</param>
 /// <returns></returns>
 public MessageModel UpdateSingleCodeObject(CodeObjectModel model)
 {
     return(codeObjectAccess.UpdateSingleEntity(model));
 }
コード例 #5
0
 /// <summary>
 /// 新增单条CodeObject
 /// </summary>
 /// <param name="model">对象规则信息实体</param>
 /// <returns></returns>
 public MessageModel InsertSingleCodeObject(CodeObjectModel model)
 {
     return(codeObjectAccess.InsertSingleEntity(model));
 }