Пример #1
0
        /// <summary>
        /// 更新GuideLineFlow
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public bool EditGuideLineFlow(GuideLineFlow model)
        {
            using (CRDatabase _context = new CRDatabase())
            {
                var entity = _context.CTMS_GUIDELINEFLOW.FirstOrDefault(p => p.ID == model.ID);
                if (entity != null)
                {
                    //1.将原先流程状态设置成删除
                    entity.ISDELETED = true;

                    GuideLineFlow addModel = new GuideLineFlow();
                    addModel.ID             = Guid.NewGuid().ToString();
                    addModel.GUIDELINENAME  = entity.GUIDELINENAME;
                    addModel.GUIDELINEINFO  = model.GUIDELINEINFO;
                    addModel.CreateUserID   = model.CreateUserID;
                    addModel.CreateDateTime = model.CreateDateTime;
                    addModel.EditTime       = model.EditTime;
                    addModel.EditUserID     = model.EditUserID;
                    addModel.IsDeleted      = false;
                    addModel.OwnerID        = model.OwnerID;
                    _context.CTMS_GUIDELINEFLOW.Add(ModelToEntity(addModel));
                    return(_context.SaveChanges() > 0);
                }
                return(false);
            }
        }
Пример #2
0
 /// <summary>
 /// 添加GuideLineFlow
 /// </summary>
 /// <param name="model"></param>
 /// <returns></returns>
 public bool AddGuideLineFlow(GuideLineFlow model)
 {
     using (CRDatabase _context = new CRDatabase())
     {
         _context.CTMS_GUIDELINEFLOW.Add(ModelToEntity(model));
         return(_context.SaveChanges() > 0);
     }
 }
Пример #3
0
 public CTMS_GUIDELINEFLOW ModelToEntity(GuideLineFlow model)
 {
     if (model != null)
     {
         var entity = new CTMS_GUIDELINEFLOW()
         {
             ID             = model.ID,
             GUIDELINENAME  = model.GUIDELINENAME,
             GUIDELINEINFO  = model.GUIDELINEINFO,
             CREATEUSERID   = model.CreateUserID,
             CREATEDATETIME = model.CreateDateTime,
             EDITUSERID     = model.EditUserID,
             EDITDATETIME   = model.EditTime,
             ISDELETED      = model.IsDeleted,
             OWNERID        = model.OwnerID
         };
         return(entity);
     }
     return(null);
 }
Пример #4
0
 public GuideLineFlow EntityToModel(CTMS_GUIDELINEFLOW entity)
 {
     if (entity != null)
     {
         var model = new GuideLineFlow()
         {
             ID             = entity.ID,
             GUIDELINENAME  = entity.GUIDELINENAME,
             GUIDELINEINFO  = entity.GUIDELINEINFO,
             CreateUserID   = entity.CREATEUSERID,
             CreateDateTime = entity.CREATEDATETIME,
             EditUserID     = entity.EDITUSERID,
             EditTime       = entity.EDITDATETIME,
             IsDeleted      = entity.ISDELETED,
             OwnerID        = entity.OWNERID
         };
         return(model);
     }
     return(null);
 }