Esempio n. 1
0
        public void QueryTravelSubjectData(bool readOnly)
        {
            deatilGridBar.Visibility = readOnly ? System.Windows.Visibility.Collapsed : System.Windows.Visibility.Visible;

            selectedDataManager = null;

            if (ExtensionalOrderDetailFBEntityList != null)
            {
                this.ExtensionalOrderDetailFBEntityList.Clear();
            }
            if (this.ExtensionalOrderDetailFBEntityList != null)
            {
                this.DeleteList.Clear();
            }

            if (IsFromFB)
            {
                QueryExpression qe = GetOrderQueryExp();
                //查询预算系统数据
                FBServiceLoacal.QueryFBEntitiesAsync(qe);
                SelectedDataManager.QueryExpression = GetQueryDetail();
            }
            else
            {
                if (string.IsNullOrEmpty(strBussinessTripID))
                {
                    MessageBox.Show("未获取到出差记录,请确认!");
                    return;
                }
                //费用来自工作计划
                WpServiceClient.GetTripSubjectAsync(strBussinessTripID);
            }
        }
Esempio n. 2
0
        /// <summary>
        /// 保存预算申请单
        /// </summary>
        /// <param name="statates">当前表单状态</param>
        public void Save(CheckStates statates)
        {
            List <string> listMsg = this.OnSaveCheck();

            if (listMsg.Count > 0)
            {
                OnSaveCompleted(listMsg);
                return;
            }
            this.GetValue();


            if (statates == CheckStates.Delete)
            {
                ExtensionalOrderFBEntity.FBEntityState = FBEntityState.Detached;
            }
            // else if如果是重新提交,如果当前单据是审核不通过的状态才可以重新提交,否则提示异常。
            // 需处理 this.Order.CHECKSTATES 为提交状态,并this.CurrentOrderEntity.FBEntityState 为重新提交
            else
            {
                if (submitFBFormTypes == FormTypes.Audit && statates == CheckStates.Approving)
                {
                    return;
                }


                this.ExtensionalOrder.CHECKSTATES = Convert.ToDecimal((int)statates);

                if (submitFBFormTypes == FormTypes.Resubmit)
                {
                    this.ExtensionalOrderFBEntity.FBEntityState = FBEntityState.ReSubmit;
                }
                else
                {
                    if (this.ExtensionalOrderFBEntity.FBEntityState == FBEntityState.Unchanged)
                    {
                        this.ExtensionalOrderFBEntity.FBEntityState = FBEntityState.Modified;
                    }
                }
            }
            if (this.IsFromFB)
            {
                QueryExpression qeSave = this.GetOrderQueryExp();
                SaveEntity      se     = new SaveEntity();
                se.QueryExpression = qeSave;
                se.FBEntity        = ExtensionalOrderFBEntity;
                FBServiceLoacal.SaveEntityAsync(se);
            }
            else
            {
                ObservableCollection <SMT.Saas.Tools.WpServiceWS.BussinessTripBudget> listTripBudget = new ObservableCollection <Saas.Tools.WpServiceWS.BussinessTripBudget>();

                foreach (var itemRM in ExtensionalOrderFBEntity.CollectionEntity)
                {
                    if (itemRM.EntityType == typeof(T_FB_EXTENSIONORDERDETAIL).Name ||
                        itemRM.EntityType == "T_FB_EXTENSIONORDERDETAIL_Travel")
                    {
                        foreach (var item in itemRM.FBEntities)
                        {
                            SMT.Saas.Tools.WpServiceWS.BussinessTripBudget saveItem = new Saas.Tools.WpServiceWS.BussinessTripBudget();
                            T_FB_EXTENSIONORDERDETAIL detail = item.Entity as T_FB_EXTENSIONORDERDETAIL;
                            //saveItem.SubjectID = detail.T_FB_SUBJECT.SUBJECTID;
                            saveItem.SubjectName = detail.T_FB_SUBJECT.SUBJECTNAME;
                            saveItem.SubjectCode = detail.T_FB_SUBJECT.SUBJECTCODE;
                            saveItem.PaidMoney   = detail.APPLIEDMONEY;
                            saveItem.UseMoney    = detail.USABLEMONEY.Value;
                            saveItem.NormName    = detail.REMARK;                 //摘要
                            saveItem.NormID      = detail.T_FB_SUBJECT.SUBJECTID; //摘要
                            if (string.IsNullOrEmpty(saveItem.NormID))
                            {
                                MessageBox.Show("工作计划保存科目Id失败,请联系管理员!");
                            }
                            listTripBudget.Add(saveItem);
                        }
                    }
                }
                string msg = string.Empty;
                WpServiceClient.TripSubjectSaveAsync(strBussinessTripID, listTripBudget, msg);
            }
        }