Пример #1
0
        public void Add()
        {
            string entity = OrderDetailGridInfo.OrderDetailEntityInfo.Type;

            SelectedForm sf = new SelectedForm();
            sf.SelectedDataManager = this.SelectedDataManager;
            sf.ReferenceDataType = entity;
            //sf.Query = qeTop;
            sf.SelectedCompleted += (o, e) =>
            {
                sf.SelectedItems.ForEach(item =>
                {
                    item.FBEntityState = FBEntityState.Added;
                    (ItemsSource as ObservableCollection<FBEntity>).Add(item);
                });
            };
            sf.Show();
        }
Пример #2
0
        protected virtual void OnLoadControlComplete()
        {
            DetailGrid dGrid = this.EditForm.Controls[4] as DetailGrid;

            if (dGrid != null)
            {
                dGrid.ToolBarItemClick += (sa, ea) =>
                {
                    if (ea.Action == ToolBarItemClickEventArgs.Actions.Add)
                    {
                        SelectedForm sForm = new SelectedForm();
                        sForm.SelectedCompleted += (sb, eb) =>
                        {
                            List <OrderDetailEntity> list = eb.SelectedItems;

                            // dGrid.ItemSource = list;
                        };
                        sForm.Show();
                    }
                };
            }
        }
Пример #3
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();
        }
Пример #4
0
        protected virtual void OnLoadControlComplete()
        {
            DetailGrid dGrid = this.EditForm.Controls[4] as DetailGrid;
            if (dGrid != null)
            {
                dGrid.ToolBarItemClick += (sa, ea) =>
                {

                    if (ea.Action == ToolBarItemClickEventArgs.Actions.Add)
                    {
                        SelectedForm sForm = new SelectedForm();
                        sForm.SelectedCompleted += (sb, eb) =>
                        {
                            List<OrderDetailEntity> list = eb.SelectedItems;
                            
                            // dGrid.ItemSource = list;
                        };
                        sForm.Show();
                    }
                };
            }
        }
Пример #5
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();

        }