Beispiel #1
0
        public async Task <int> Add(CarUseInfo CarUse)
        {
            var entity = new CarUseEntity(CarUse);

            entity.CreateDate     = DateTime.Now;
            entity.IsDelete       = false;
            entity.PeerStaffCount = entity.PeerStaff.Split(',').Length;
            this._DB.Add(entity);

            _ICarService.ChangeStatus(entity.CarID, CarStatus.申请中);

            var pid = ProcessEngine.Instance.CreateProcessInstance("Form_Car", CarUse.Manager, CarUse.FlowData);

            // 映射流程实例和用车申请
            _IObjectProcessService.Add(new ObjectProcessEntity()
            {
                ObjectID  = entity.ID,
                ObjectKey = "CarUse",
                ProcessID = new Guid(pid)
            });

            await ProcessEngine.Instance.Start(pid);

            return(entity.ID);
        }
Beispiel #2
0
        public void Update(int ID, CarUseEntity CarUse)
        {
            var entity = this._DB.Get(ID);

            entity.SetEntity(CarUse);

            this._DB.Edit(entity);
        }
Beispiel #3
0
 public void SetEntity(CarUseEntity Entity)
 {
     this.CarID          = Entity.CarID;
     this.StartDate      = Entity.StartDate;
     this.BackDate       = Entity.BackDate;
     this.Manager        = Entity.Manager;
     this.TargetPlace    = Entity.TargetPlace;
     this.Mileage        = Entity.Mileage;
     this.PeerStaff      = Entity.PeerStaff;
     this.PeerStaffCount = Entity.PeerStaff.Split(',').Length;
     this.Explain        = Entity.Explain;
 }
Beispiel #4
0
 public CarUseInfo(CarUseEntity Entity)
 {
     this.ID             = Entity.ID;
     this.CarID          = Entity.CarID;
     this.StartDate      = Entity.StartDate;
     this.BackDate       = Entity.BackDate;
     this.Manager        = Entity.Manager;
     this.TargetPlace    = Entity.TargetPlace;
     this.Mileage        = Entity.Mileage;
     this.PeerStaff      = Entity.PeerStaff;
     this.PeerStaffCount = Entity.PeerStaffCount;
     this.Explain        = Entity.Explain;
     this.CreateDate     = Entity.CreateDate;
     this.IsDelete       = Entity.IsDelete;
 }