Example #1
0
        private void OnParameterValueChange()
        {
            OrderEntity orderEntity = this.DataContext as OrderEntity;
            QueryExpression qeTop = null;

            foreach (KeyValuePair<string, string> dict in Parameters)
            {
                object value = orderEntity.GetEntityValue(dict.Value);
                QueryExpression qe = QueryExpressionHelper.Equal(dict.Key, value.ToString());
                qe.RelatedExpression = qeTop;
                qeTop = qe;
            }
            if (qeTop != null)
            {

                qeTop.VisitAction = ((int)this.operationType).ToString();
                qeTop.QueryType = this.OrderDetailGridInfo.OrderDetailEntityInfo.Type;
                qeTop.VisitModuleCode = this.OrderDetailGridInfo.OrderDetailEntityInfo.Type;
                
            }

            SelectedDataManager.QueryExpression = qeTop;
        }
Example #2
0
        public void InitBorrowOrder()
        {
            string entity = ReferencedDataInfo.OrderInfo.Type;

            OrderEntity     orderEntity = this.DataContext as OrderEntity;
            QueryExpression qeTop       = null;

            string strEascapeDepIds = "c1dc9c03-31a2-4f0c-be0b-459fdb06b851,4ede37fa-72b5-4939-b087-10bef4520d49,815daaee-b439-4695-874d-ad79ba361add,"
                                      + "0027e9e6-c645-48ec-9333-a2ef507faf57,0abaf119-a470-44ee-8a9e-2e42783b4c86,45995e7d-6062-49e6-b08f-1da59729f9f1";

            string strCurDepId = string.Empty;

            foreach (KeyValuePair <string, string> dict in Parameters)
            {
                object objvalue = orderEntity.GetEntityValue(dict.Value);
                if (dict.Key == "OWNERDEPARTMENTID" && objvalue != null)
                {
                    strCurDepId = objvalue.ToString();
                    continue;
                }

                if (dict.Key == "OWNERPOSTID")
                {
                    if (strEascapeDepIds.Contains(strCurDepId))
                    {
                        continue;
                    }
                }
                QueryExpression qe = QueryExpressionHelper.Equal(dict.Key, objvalue.ToString());
                qe.RelatedExpression = qeTop;
                qeTop = qe;
            }

            // 未偿还
            QueryExpression qeIsRepaied = QueryExpressionHelper.Equal("ISREPAIED", "1");

            qeIsRepaied.Operation         = QueryExpression.Operations.NotEqual;
            qeIsRepaied.RelatedExpression = qeTop;
            qeTop = qeIsRepaied;

            if (qeTop != null)
            {
                qeTop.VisitAction     = ((int)this.OperationType).ToString();
                qeTop.QueryType       = entity;
                qeTop.VisitModuleCode = entity;
                qeTop.Include         = new System.Collections.ObjectModel.ObservableCollection <string>();
                qeTop.Include.Add("T_FB_EXTENSIONALORDER.T_FB_EXTENSIONALTYPE");
                qeTop.Include.Add("T_FB_BORROWAPPLYDETAIL.T_FB_SUBJECT");
            }

            SelectedDataManager.QueryExpression = qeTop;
            SelectedForm sf = new SelectedForm();

            sf.TitleContent        = "借款单";
            sf.SelectedDataManager = this.SelectedDataManager;
            sf.ReferenceDataType   = this.ReferencedDataInfo.Type;
            sf.SelectionMode       = DataGridSelectionMode.Single;
            sf.SelectedCompleted  += (o, e) =>
            {
                FBEntity       fbEntity = sf.SelectedItems.FirstOrDefault();
                Type           type     = CommonFunction.GetType(this.ReferencedDataInfo.Type, CommonFunction.TypeCategory.ReferencedData);
                ITextValueItem item     = Activator.CreateInstance(type) as ITextValueItem;
                item.Value      = fbEntity.Entity;
                this.SelectItem = item;
            };
            sf.Show();
        }