private void OnNew(object obj) { var newRequest = new RequestDTO { Id = Guid.NewGuid(), CreateDate = DateTime.Now, SubmitDate = DateTime.Now, AirlinesId = Guid.Parse("1978ADFC-A2FD-40CC-9A26-6DEDB55C335F"), Status = (int) RequestStatus.草稿, }; Requests.AddNew(newRequest); RefreshCommandState(); }
internal void RemoveRequest(RequestDTO request) { // 从相关批文移除申请 request.ApprovalDocId = null; // 申请状态改为已提交 request.Status = (int) RequestStatus.已提交; // 相关申请明细对应计划飞机置为未批准,其管理状态置为申请 request.ApprovalHistories.ToList().ForEach(ah => { ah.IsApproved = false; var planAircraft = PlanAircrafts.FirstOrDefault(p => p.Id == ah.PlanAircraftId); var planHistory = PlanHistories.FirstOrDefault(p => p.ApprovalHistoryId == ah.Id); if (planAircraft != null) planAircraft.Status = (int) ManageStatus.申请; if (planHistory != null) planHistory.CanDeliver = (int) CanDeliver.未批准; }); EnRouteRequests.Add(request); ApprovalRequests.Remove(request); RefreshCommandState(); }
/// <summary> /// 初始化申请信息。 /// </summary> private void InitialRequest() { RequestsView = new QueryableDataServiceCollectionView<RequestDTO>(_context, _context.Requests.Expand(p => p.RelatedDocs)); var requestDescriptor = new FilterDescriptor("Note", FilterOperator.IsNotEqualTo, "指标飞机申请(系统添加)"); RequestsView.FilterDescriptors.Add(requestDescriptor); RequestsView.PageSize = 20; RequestsView.LoadedData += (sender, e) => { SetIsBusy(); if (e.HasError) { e.MarkErrorAsHandled(); return; } if (SelectedRequest == null) { SelectedRequest = e.Entities.Cast<RequestDTO>().FirstOrDefault(); } }; }
internal void AddRequestToApprovalDoc(RequestDTO request) { // 把申请赋给相关批文 request.ApprovalDocId = SelApprovalDoc.Id; // 申请状态改为已审批 request.Status = (int) RequestStatus.已审批; // 相关申请明细对应计划飞机置为批准,其管理状态置为批文 request.ApprovalHistories.ToList().ForEach(ah => { ah.IsApproved = true; var planAircraft = PlanAircrafts.FirstOrDefault(p => p.Id == ah.PlanAircraftId); var planHistory = PlanHistories.FirstOrDefault(p => p.ApprovalHistoryId == ah.Id); if (planAircraft != null) planAircraft.Status = (int) ManageStatus.批文; if (planHistory != null) planHistory.CanDeliver = (int) CanDeliver.可交付; }); EnRouteRequests.Remove(request); ApprovalRequests.Add(request); SelApprovalRequest = request; RefreshCommandState(); }
private void OnNew(object obj) { SelApprovalDoc = new ApprovalDocDTO { Id = Guid.NewGuid(), Note = "指标飞机批文", Status = (int) OperationStatus.草稿, }; ApprovalDocs.AddNew(SelApprovalDoc); var newRequest = new RequestDTO { Id = Guid.NewGuid(), CreateDate = DateTime.Now, SubmitDate = DateTime.Now, Title = "指标飞机申请(系统添加)", Note = "指标飞机申请(系统添加)", AirlinesId = Guid.Parse("1978ADFC-A2FD-40CC-9A26-6DEDB55C335F"), Status = (int) RequestStatus.草稿, IsFinished = true, ApprovalDocId = SelApprovalDoc.Id, }; Requests.AddNew(newRequest); CurRequest = newRequest; RefreshCommandState(); }