public void SetEntity(EngineeringSpecialtyProvideEntity Entity)
 {
     this.ReceiveUserIDs = Entity.ReceiveUserIDs;
     this.DocName        = Entity.DocName;
     this.DocContent     = Entity.DocContent;
     this.LimitDate      = Entity.LimitDate;
 }
 public EngineeringSpecialtyProvideInfo(EngineeringSpecialtyProvideEntity Entity)
 {
     this.ID                 = Entity.ID;
     this.EngineeringID      = Entity.EngineeringID;
     this.SendSpecialtyID    = Entity.SendSpecialtyID;
     this.ReceiveSpecialtyID = Entity.ReceiveSpecialtyID;
     this.SendUserID         = Entity.SendUserID;
     this.ReceiveUserIDs     = Entity.ReceiveUserIDs;
     this.DocName            = Entity.DocName;
     this.DocContent         = Entity.DocContent;
     this.LimitDate          = Entity.LimitDate;
     this.IsDelete           = Entity.IsDelete;
     this.CreateDate         = Entity.CreateDate;
     this.CanReceive         = Entity.CanReceive;
 }
        public async Task <int> Add(EngineeringSpecialtyProvideInfo EngineeringSpecialtyProvide)
        {
            var entity = new EngineeringSpecialtyProvideEntity(EngineeringSpecialtyProvide);

            entity.IsDelete   = false;
            entity.CreateDate = DateTime.Now;
            entity.CanReceive = false;

            this._DB.Add(entity);

            foreach (var attachID in EngineeringSpecialtyProvide.AttachIDs)
            {
                AddAttach(entity.ID, attachID);
            }
            foreach (var fileID in EngineeringSpecialtyProvide.VolumeFiles)
            {
                AddAttach(entity.ID, fileID);
            }

            var data = new Dictionary <string, object>();

            data.Add("ApproveUser", EngineeringSpecialtyProvide.ApproveUser);
            data.Add("ProvideUser", EngineeringSpecialtyProvide.SendUserID);

            var pid = ProcessEngine.Instance.CreateProcessInstance("F1", EngineeringSpecialtyProvide.SendUserID, data);

            // 映射流程实例和卷册关系
            _IObjectProcessService.Add(new ObjectProcessEntity()
            {
                ObjectID  = entity.ID,
                ObjectKey = "EngineeringSpecialtyProvide",
                ProcessID = new Guid(pid)
            });

            await ProcessEngine.Instance.Start(pid);

            return(entity.ID);
        }