示例#1
0
        void editForm_LoadControlComplete(object sender, EventArgs e)
        {
            EditForm editForm = sender as EditForm;

            DetailGrid grid = editForm.FindChildControl <DetailGrid>("OrderGrid");

            if (grid != null)
            {
                grid.SetGridFix();
                grid.ADGrid.Columns.ForEach(item =>
                {
                    item.CanUserSort = false;
                });

                grid.ADGrid.Columns[2].HeaderStyle = null;
                grid.ADGrid.Columns[2].HeaderStyle = Resources["activeStyle"] as Style;

                List <string> groups = new List <string> {
                    "Entity.T_FB_SUBJECT.T_FB_SUBJECTTYPE.SUBJECTTYPENAME"
                };
                grid.Groups = groups;
            }

            //初始化活动经费
            BeginMoneyAssign(grid);
        }
示例#2
0
        void editForm_LoadControlComplete(object sender, EventArgs e)
        {
            DetailGrid grid = editForm.FindChildControl <DetailGrid>("OrderGrid");

            if (grid != null)
            {
                grid.SetGridFix();
                grid.ADGrid.Columns.ForEach(item =>
                {
                    item.CanUserSort = false;
                });
                grid.ADGrid.Columns[2].HeaderStyle = null;
                grid.ADGrid.Columns[2].HeaderStyle = Resources["activeStyle"] as Style;

                //如果是公司预算管理员:则自己的公司不可以修改
                if (IsFbAdmin == 1)
                {
                    if (currentTreeViewItem != null)
                    {
                        OrderEntity entity = currentTreeViewItem.DataContext as OrderEntity;

                        string StrCompany    = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].CompanyID;
                        string SelectCompany = (entity.Entity as VirtualCompany).ID;
                        if (StrCompany == SelectCompany)
                        {
                            grid.ADGrid.Columns[2].IsReadOnly = true;
                        }
                        else
                        {
                            grid.ADGrid.Columns[2].IsReadOnly = false;
                        }
                    }
                }

                grid.ADGrid.Columns[3].Visibility = Visibility.Collapsed;
                grid.ADGrid.Columns[4].Visibility = Visibility.Collapsed;
                grid.ADGrid.Columns[5].Visibility = Visibility.Collapsed;
                grid.ADGrid.Columns[6].Visibility = Visibility.Collapsed;
                grid.ADGrid.Columns[7].Visibility = Visibility.Collapsed;
                List <string> groups = new List <string> {
                    "Entity.T_FB_SUBJECT.T_FB_SUBJECTTYPE.SUBJECTTYPENAME"
                };
                grid.Groups = groups;

                //活动经费处理
                OrderEntity oe = grid.DataContext as OrderEntity;
                oe.FBEntity.CollectionEntity.ForEach(p =>
                {
                    p.FBEntities.ForEach(item =>
                    {
                        var v = item.Entity as T_FB_SUBJECTCOMPANY;
                        if (v != null && v.T_FB_SUBJECT.SUBJECTID == DataCore.SystemSetting.MONEYASSIGNSUBJECTID)
                        {
                            item.Entity.PropertyChanged += new System.ComponentModel.PropertyChangedEventHandler(DeatilEntity_PropertyChanged);
                            DeatilEntity_PropertyChanged(item.Entity, null);
                        }
                    });
                });
            }
        }
示例#3
0
        void editForm_LoadControlComplete(object sender, EventArgs e)
        {
            DetailGrid grid = editForm.FindChildControl <DetailGrid>("OrderGrid");

            if (grid != null)
            {
                grid.SetGridFix();
                grid.ADGrid.Columns.ForEach(item =>
                {
                    item.CanUserSort = false;
                });
                // var aa = grid.ADGrid.Columns[3].Header;
                grid.ADGrid.Columns[3].HeaderStyle = null;
                grid.ADGrid.Columns[3].HeaderStyle = Resources["activeStyle"] as Style;
                List <string> groups = new List <string> {
                    "Entity.T_FB_SUBJECT.T_FB_SUBJECTTYPE.SUBJECTTYPENAME"
                };
                grid.Groups = groups;

                grid.ADGrid.Columns[2].Visibility = Visibility.Collapsed;

                // 是否可以设置滚动
                if (DataCore.GetSetting("CanSetSubjectControl") == "1")
                {
                    grid.ADGrid.Columns[7].IsReadOnly = false;
                }
                grid.ADGrid.Columns[5].IsReadOnly = false;
                //活动经费处理
                OrderEntity oe = grid.DataContext as OrderEntity;
                oe.FBEntity.CollectionEntity.ForEach(p =>
                {
                    p.FBEntities.ForEach(item =>
                    {
                        var v = item.Entity as T_FB_SUBJECTCOMPANY;
                        if (v != null && v.T_FB_SUBJECT.SUBJECTID == DataCore.SystemSetting.MONEYASSIGNSUBJECTID)
                        {
                            item.Entity.PropertyChanged += new System.ComponentModel.PropertyChangedEventHandler(DeatilEntity_PropertyChanged);
                            DeatilEntity_PropertyChanged(item.Entity, null);
                        }
                    });
                });
            }
        }