Exemplo n.º 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);
        }
Exemplo n.º 2
0
 public CarUseEntity(CarUseInfo Info)
 {
     this.ID             = Info.ID;
     this.CarID          = Info.CarID;
     this.StartDate      = Info.StartDate;
     this.BackDate       = Info.BackDate;
     this.Manager        = Info.Manager;
     this.TargetPlace    = Info.TargetPlace;
     this.Mileage        = Info.Mileage;
     this.PeerStaff      = Info.PeerStaff;
     this.PeerStaffCount = Info.PeerStaffCount;
     this.Explain        = Info.Explain;
     this.CreateDate     = Info.CreateDate;
     this.IsDelete       = Info.IsDelete;
 }
Exemplo n.º 3
0
 public async Task <int> Apply(int ID, CarUseInfo ApplyInfo)
 {
     ApplyInfo.CarID   = ID;
     ApplyInfo.Manager = int.Parse(base.User.Identity.Name);
     return(await this._ICarUseService.Add(ApplyInfo));
 }