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); }
public void Update(int ID, CarUseEntity CarUse) { var entity = this._DB.Get(ID); entity.SetEntity(CarUse); this._DB.Edit(entity); }
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; }
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; }