コード例 #1
0
    private void flowGrid_Bind(ChangeTrackingList <EntitySearcher> changeTrackingList, string sortColumn, string sortDirection)
    {
        ChangeTrackingList <EntitySearcher> trackingList = new ChangeTrackingList <EntitySearcher>();

        foreach (EntitySearcher s in changeTrackingList)
        {
            trackingList.Add(s);
        }
        if (this.CookiePersonnel != null)
        {
            EntitySearcher search = new EntitySearcher();
            search          = new EntitySearcher();
            search.Field    = "Creator";
            search.Relation = "AND";
            search.Operator = "=";
            search.Content  = this.CookiePersonnel.ID.ToString();
            trackingList.Add(search);
        }

        flowGrid.RecordCount = flowRunBll.GetCount(trackingList);
        ExtBindingList <FineOffice.Modules.OA_FlowRun> list = flowRunBll.GetList(trackingList, this.flowGrid.PageIndex, this.flowGrid.PageSize).ToBindingList();

        list.Sort(sortColumn, sortDirection);
        flowGrid.DataSource = list;
        flowGrid.DataBind();
    }
コード例 #2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            LoadData();
            hiddenFiles.Text       = Request["files"];
            btnEnter.OnClientClick = personGrid.GetNoSelectionAlertReference("请选择" + personGrid.Title + "!");

            this.personGrid.PageIndex = 0;
            ChangeTrackingList <EntitySearcher> changeTrackingList = new ChangeTrackingList <EntitySearcher>();
            ViewState["sql"] = changeTrackingList;
            GridColumn column = personGrid.FindColumn(personGrid.SortColumn);
            ExtBindingList <FineOffice.Modules.HR_Personnel> list = personGrid_Bind(changeTrackingList, column.SortField, personGrid.SortDirection);
            btnAdd.OnClientClick = newPersonWin.GetShowReference();

            btnModify.OnClientClick  = personGrid.GetNoSelectionAlertReference("请选择要编辑的" + personGrid.Title + "!");
            btnDelelte.OnClientClick = personGrid.GetNoSelectionAlertReference("请选择要删除的" + personGrid.Title + "!");
            btnDelelte.ConfirmText   = "你确认要删除选中的" + personGrid.Title + "吗?";
        }
        if (Request.Form["__EVENTARGUMENT"] == "subwin_close")
        {
            ChangeTrackingList <EntitySearcher> changeTrackingList = ViewState["sql"] as ChangeTrackingList <EntitySearcher>;
            GridColumn column = personGrid.FindColumn(personGrid.SortColumn);
            personGrid_Bind(changeTrackingList, column.SortField, personGrid.SortDirection);
        }
    }
コード例 #3
0
    private void formGrid_Bind(ChangeTrackingList <EntitySearcher> changeTrackingList, string sortColumn, string dortDirection)
    {
        ChangeTrackingList <EntitySearcher> trackingList = new ChangeTrackingList <EntitySearcher>();

        foreach (EntitySearcher s in changeTrackingList)
        {
            trackingList.Add(s);
        }

        FineUI.TreeNode node = tvwSort.SelectedNode;
        if (node != null && node.NodeID != "0")
        {
            EntitySearcher search = new EntitySearcher();
            search.Field    = "TypeID";
            search.Relation = "AND";
            search.Operator = "=";
            search.Content  = tvwSort.SelectedNodeID;
            trackingList.Add(search);
        }

        formGrid.RecordCount = formBll.GetCount(trackingList);
        ExtBindingList <FineOffice.Modules.OA_Form> list = formBll.GetList(trackingList, this.formGrid.PageIndex, this.formGrid.PageSize).ToBindingList();

        list.Sort(sortColumn, dortDirection);
        formGrid.DataSource = list;
        formGrid.DataBind();
    }
コード例 #4
0
 public UC_reeksAssignment(ExtBindingList <Ploeg> ploeglist)
 {
     _ploeglist = ploeglist;
     InitializeComponent();
     CreateOverview();
     dataGridView1.DataSource = _reeksAssignmentlist;
     //ploeglist.ListChanged += ploeglist_ListChanged;
 }
コード例 #5
0
 public UC_ListAllocation(ExtBindingList <Ploeg> BindingSourceList, int NrOfOuutputLists = 2)
     : this()
 {
     _NrOfOutputLists   = NrOfOuutputLists;
     _BindingSourceList = BindingSourceList;
     //this creates a copy !!!! - bindig removed
     _inputlist = new ExtBindingList <Ploeg>(_BindingSourceList.ToList());
 }
コード例 #6
0
ファイル: BaseForm.cs プロジェクト: brambossche/zomertornooi
        private void BaseForm_Load(object sender, EventArgs e)
        {
            try
            {
                //connect to the database and get the Factory session
                _NHibernateSessionManager = new NHibernateSessionManager <BaseForm>(Databaseconfig.DB_UnitHibernateTest);
                //setup the structures of the program
                _StructureSetup = new StructureSetup(_NHibernateSessionManager.SessionFactory);

                _StructureSetup.Que_HasItems += _StructureSetup_Que_HasItems;
                _StructureSetup.Que_IsEmpty  += _StructureSetup_Que_IsEmpty;

                if (_userlevel == UserLevel.Admin)
                {
                    _PloegList   = _StructureSetup.PloegList;
                    _TerreinList = _StructureSetup.TerreinList;

                    Userview <Persoon> _persoonview = new Userview <Persoon>(_StructureSetup.PersoonList, true)
                    {
                        Name = "Persoonview"
                    };
                    Userview <Terrein> _terreinview = new Userview <Terrein>(_StructureSetup.TerreinList, false)
                    {
                        Name = "Terreinen"
                    };
                    //Userview<Reeks> _reeksen = new Userview<Reeks>(_StructureSetup.ReeksList) { Name = "Reeksen" };
                    UC_reeksAssignment _reeksAssignment = new UC_reeksAssignment(_StructureSetup.PloegList)
                    {
                        Name = "Reeks assignment"
                    };
                    UC_PloegOverView   _PloegOverView   = new UC_PloegOverView(_PloegList);
                    UC_RoundRobinSetup _RoundRobinSetup = new UC_RoundRobinSetup(_PloegList, _StructureSetup.WedstrijdList, _StructureSetup.TerreinList);
                    //UC_wedstrijdViewer _WedstrijdViewer = new UC_wedstrijdViewer(_StructureSetup.WedstrijdList);
                    Userview <Wedstrijd> _WedstrijdViewer = new Userview <Wedstrijd>(_StructureSetup.WedstrijdList, true)
                    {
                        Name = "Wedstrijden"
                    };
                    UC_TornooiAdministratie _TornooiAdministratie = new UC_TornooiAdministratie(_StructureSetup.WedstrijdList, _StructureSetup.TerreinList);

                    CreateDockContent(_persoonview, MainDocking);
                    CreateDockContent(_terreinview, MainDocking);
                    CreateDockContent(_reeksAssignment, MainDocking);
                    CreateDockContent(_PloegOverView, MainDocking);
                    CreateDockContent(_RoundRobinSetup, MainDocking);
                    CreateDockContent(_WedstrijdViewer, MainDocking);
                    CreateDockContent(_TornooiAdministratie, MainDocking);
                }
                else if (_userlevel == UserLevel.User)
                {
                    UC_wedstrijdViewer _WedstrijdViewer = new UC_wedstrijdViewer(_StructureSetup.WedstrijdList);
                    CreateDockContent(_WedstrijdViewer, MainDocking);
                }
            }
            catch (Exception ee)
            {
                logger.Error(this.Name + " Database loading error", ee);
            }
        }
コード例 #7
0
    /// <summary>
    /// 数据排序
    /// </summary>
    protected void Grid_Sort(object sender, FineUI.GridSortEventArgs e)
    {
        ChangeTrackingList <EntitySearcher> changeTrackingList     = ViewState["sql"] as ChangeTrackingList <EntitySearcher>;
        ExtBindingList <FineOffice.Modules.OA_FlowRunProcess> list = runProcessBll.GetList(changeTrackingList).ToBindingList();

        list.Sort(e.SortField, e.SortDirection);
        this.transmitGrid.DataSource = list;
        this.transmitGrid.DataBind();
    }
コード例 #8
0
    private void memberGrid_Bind(ChangeTrackingList <EntitySearcher> changeTrackingList, string sortColumn, string dortDirection)
    {
        memberGird.RecordCount = memberBll.GetCount(changeTrackingList);
        ExtBindingList <FineOffice.Modules.CNS_CensusMember> list = memberBll.GetList(changeTrackingList, this.memberGird.PageIndex, this.memberGird.PageSize).ToBindingList();

        list.Sort(sortColumn, dortDirection);
        memberGird.DataSource = list;
        memberGird.DataBind();
    }
コード例 #9
0
    private void personGrid_Bind(ChangeTrackingList <EntitySearcher> changeTrackingList, string sortColumn, string dortDirection)
    {
        personGrid.RecordCount = personBll.GetCount(changeTrackingList);
        ExtBindingList <FineOffice.Modules.HR_Personnel> list = personBll.GetList(changeTrackingList, this.personGrid.PageIndex, this.personGrid.PageSize).ToBindingList();

        list.Sort(sortColumn, dortDirection);
        personGrid.DataSource = list;
        personGrid.DataBind();
    }
コード例 #10
0
    protected void processGrid_RowSelect(object sender, FineUI.GridRowSelectEventArgs e)
    {
        ChangeTrackingList <EntitySearcher> searcherList = new ChangeTrackingList <EntitySearcher>();

        //部门条件
        object         department   = processGrid.DataKeys[processGrid.SelectedRowIndex][2];
        string         depCondition = department == null ? "" : department.ToString();
        EntitySearcher search       = new EntitySearcher();

        search = new EntitySearcher();
        search.LeftParentheses = "(";
        search.Field           = "DepartmentID";
        search.Relation        = "OR";
        search.Operator        = "in";
        StringBuilder dep = new StringBuilder();

        dep.Append("(");
        if (depCondition.Length > 0)
        {
            dep.Append(depCondition.Remove(depCondition.Length - 1));
        }
        else
        {
            dep.Append("0");
        }
        dep.Append(")");
        search.Content = dep.ToString();
        searcherList.Add(search);

        //员工条件
        search = new EntitySearcher();
        object person       = processGrid.DataKeys[processGrid.SelectedRowIndex][1];
        string perCondition = person == null ? "" : person.ToString();

        search.RightParentheses = ")";
        search.Field            = "ID";
        search.Operator         = "in";
        StringBuilder str = new StringBuilder();

        str.Append("(");
        if (perCondition.Length > 0)
        {
            str.Append(perCondition.Remove(perCondition.Length - 1));
        }
        else
        {
            str.Append("0");
        }
        str.Append(")");

        search.Content = str.ToString();
        searcherList.Add(search);
        ExtBindingList <FineOffice.Modules.HR_Personnel> list = personnelBll.GetList(searcherList).ToBindingList();

        personGrid.DataSource = list;
        personGrid.DataBind();
    }
コード例 #11
0
    private void rolebGrid_Bind(ChangeTrackingList <EntitySearcher> changeTrackingList, string sortColumn, string dortDirection)
    {
        rolebGrid.RecordCount = roleBll.GetCount(changeTrackingList);
        ExtBindingList <FineOffice.Modules.SYS_Role> list = roleBll.GetList(changeTrackingList, this.rolebGrid.PageIndex, this.rolebGrid.PageSize).ToBindingList();

        list.Sort(sortColumn, dortDirection);
        rolebGrid.DataSource = list;
        rolebGrid.DataBind();
    }
コード例 #12
0
    private void departmentGrid_Grid(ChangeTrackingList <EntitySearcher> changeTrackingList, string sortColumn, string dortDirection)
    {
        departmentGrid.RecordCount = depBll.GetCount(changeTrackingList);
        ExtBindingList <FineOffice.Modules.HR_Department> list = depBll.GetList(changeTrackingList, this.departmentGrid.PageIndex, this.departmentGrid.PageSize).ToBindingList();

        list.Sort(sortColumn, dortDirection);
        departmentGrid.DataSource = list;
        departmentGrid.DataBind();
    }
コード例 #13
0
    private void flowGrid_Bind(ChangeTrackingList <EntitySearcher> changeTrackingList, string sortColumn, string sortDirection)
    {
        flowGrid.RecordCount = flowBll.GetCount(changeTrackingList);
        ExtBindingList <FineOffice.Modules.OA_Flow> list = flowBll.GetList(changeTrackingList, this.flowGrid.PageIndex, this.flowGrid.PageSize).ToBindingList();

        list.Sort(sortColumn, sortDirection);
        flowGrid.DataSource = list;
        flowGrid.DataBind();
    }
コード例 #14
0
    private void traderGrid_Bind(ChangeTrackingList <EntitySearcher> changeTrackingList, string sortColumn, string dortDirection)
    {
        traderGrid.RecordCount = traderBll.GetCount(changeTrackingList);
        ExtBindingList <FineOffice.Modules.CRM_Trader> list = traderBll.GetList(changeTrackingList, this.traderGrid.PageIndex, this.traderGrid.PageSize).ToBindingList();

        list.Sort(sortColumn, dortDirection);
        traderGrid.DataSource = list;
        traderGrid.DataBind();
    }
コード例 #15
0
    private void grdAttachment_Bind(ChangeTrackingList <EntitySearcher> changeTrackingList, string sortColumn, string sortDirection)
    {
        grdAttachment.RecordCount = attachmentBll.GetCount(changeTrackingList);
        ExtBindingList <FineOffice.Modules.OA_Attachment> list = attachmentBll.GetList(changeTrackingList, this.grdAttachment.PageIndex, this.grdAttachment.PageSize).ToBindingList();

        list.Sort(sortColumn, sortDirection);
        grdAttachment.DataSource = list;
        grdAttachment.DataBind();
    }
コード例 #16
0
    private void contractGrid_Bind(ChangeTrackingList <EntitySearcher> changeTrackingList, string sortColumn, string dortDirection)
    {
        contractGrid.RecordCount = contractBll.GetCount(changeTrackingList);
        ExtBindingList <FineOffice.Modules.OA_Contract> list = contractBll.GetList(changeTrackingList, this.contractGrid.PageIndex, this.contractGrid.PageSize).ToBindingList();

        list.Sort(sortColumn, dortDirection);
        contractGrid.DataSource = list;
        contractGrid.DataBind();
    }
コード例 #17
0
        /// <summary>
        /// 转为排序的BindingCollection;
        /// </summary>
        /// <typeparam name="TSource"></typeparam>
        /// <param name="source"></param>
        /// <returns></returns>
        public static ExtBindingList <TSource> ToBindingList <TSource>(this IEnumerable <TSource> source)
        {
            ExtBindingList <TSource> tResult = new ExtBindingList <TSource>();

            foreach (var temp in source)
            {
                tResult.Add(temp);
            }
            return(tResult);
        }
コード例 #18
0
        /*void ploeglist_ListChanged(object sender, ListChangedEventArgs e)
         * {
         *
         *  if (e.ListChangedType == ListChangedType.ItemChanged)
         *  {
         *      ReeksAssignment reeks = _reeksAssignmentlist.Where(x => x.Category.Categorynaam == _ploeglist[e.NewIndex].Category.Categorynaam).First();
         *      reeks.AangemeldePloegen = _ploeglist.Where(x => x.Category.Categorynaam == reeks.Category.Categorynaam).Where(x => x.Aangemeld == true).Count();
         *      reeks.AantalPloegen = _ploeglist.Where(x => x.Category.Categorynaam == reeks.Category.Categorynaam).Count();
         *
         *      UC_ListAllocation _UC_ListAllocation = List_UC_ListAllocation.Where(x => x.Name == reeks.Category.Categorynaam).First();
         *
         *      if (_ploeglist[e.NewIndex].Aangemeld)
         *      {
         *          _UC_ListAllocation.InputList.Add(_ploeglist[e.NewIndex]);
         *      }
         *      else
         *      {
         *          if (_UC_ListAllocation.InputList.Contains (_ploeglist[e.NewIndex]))
         *          {
         *              _UC_ListAllocation.InputList.Remove (_ploeglist[e.NewIndex]);
         *          }
         *          else
         *          {
         *              foreach (BindingList<Ploeg> output in _UC_ListAllocation.Outputlist)
         *              {
         *                  if (output.Contains(_ploeglist[e.NewIndex]))
         *                  {
         *                      output.Remove(_ploeglist[e.NewIndex]);
         *                  }
         *              }
         *          }
         *      }
         *  }
         * }*/

        private void CreateOverview()
        {
            try
            {
                foreach (Category cat in Category.Categories)
                {
                    _reeksAssignmentlist.Add(new ReeksAssignment()
                    {
                        Category          = cat,
                        AantalPloegen     = _ploeglist.Where(x => x.Category.Categorynaam == cat.Categorynaam).Count(),
                        AangemeldePloegen = _ploeglist.Where(x => x.Category.Categorynaam == cat.Categorynaam).Where(x => x.Aangemeld == true).Count(),
                    });

                    ExtBindingList <Ploeg> PloegList = new ExtBindingList <Ploeg>(_ploeglist.Where(x => x.Category.Categorynaam == cat.Categorynaam).Where(x => x.Aangemeld == true).ToList())
                    {
                        Name = _reeksAssignmentlist.Last <ReeksAssignment>().Category.Categorynaam
                    };

                    SortedDictionary <string, int> _differentSeries = new SortedDictionary <string, int>();

                    foreach (Ploeg pl in PloegList.ToList())
                    {
                        if (pl.Reeksnaam == null)
                        {
                            pl.Reeksnaam = "";
                        }

                        if (pl.Reeksnaam != "")
                        {
                            if (_differentSeries.ContainsKey(pl.Reeksnaam))
                            {
                                _differentSeries[pl.Reeksnaam]++;
                            }
                            else
                            {
                                _differentSeries.Add(pl.Reeksnaam, 1);
                            }
                        }
                    }
                    _differentSeries.OrderBy(key => key.Key);
                    _reeksAssignmentlist.Last <ReeksAssignment>().NrOfReeksen = _differentSeries.Count();
                    //populate the control list to keep the current states*/
                    List_UC_ListAllocation.Add(new UC_ListAllocation(PloegList)
                    {
                        Name = PloegList.Name
                    });
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e.ToString());
            }
        }
コード例 #19
0
    private ExtBindingList <FineOffice.Modules.HR_Personnel> BindGrid(ChangeTrackingList <EntitySearcher> changeTrackingList, string sortColumn, string dortDirection)
    {
        EntitySearcher search = new EntitySearcher();

        search = new EntitySearcher();
        search.LeftParentheses = "(";
        search.Field           = "DepartmentID";
        search.Relation        = "OR";
        search.Operator        = "in";
        StringBuilder dep = new StringBuilder();

        dep.Append("(");
        if (hiddenDepartment.Text.Length > 0)
        {
            dep.Append(hiddenDepartment.Text.Remove(hiddenDepartment.Text.Length - 1));
        }
        else
        {
            dep.Append("0");
        }
        dep.Append(")");
        search.Content = dep.ToString();
        changeTrackingList.Add(search);

        search = new EntitySearcher();
        search.RightParentheses = ")";
        search.Field            = "ID";
        search.Operator         = "in";
        StringBuilder str = new StringBuilder();

        str.Append("(");
        if (hiddenPerson.Text.Length > 0)
        {
            str.Append(hiddenPerson.Text.Remove(hiddenPerson.Text.Length - 1));
        }
        else
        {
            str.Append("0");
        }
        str.Append(")");
        search.Content = str.ToString();
        changeTrackingList.Add(search);

        CommonGrid.RecordCount = personnelBll.GetCount(changeTrackingList);
        ExtBindingList <FineOffice.Modules.HR_Personnel> list = personnelBll.GetList(changeTrackingList, this.CommonGrid.PageIndex, this.CommonGrid.PageSize).ToBindingList();

        list.Sort(sortColumn, dortDirection);
        CommonGrid.DataSource = list;
        CommonGrid.DataBind();
        return(list);
    }
コード例 #20
0
 private void InitViolinData()
 {
     violinStorage = (IViolinStorage)daoDll.CreateInstance(
         "Michalski.Models.ViolinStorage", false, BindingFlags.ExactBinding, null, new object[] { dburi }, null, null
         );
     _violins = new ExtBindingList <IViolinModel>();
     foreach (var v in violinStorage.ReadAll())
     {
         _violins.Add(v);
     }
     Violins.ListChanged  += new ListChangedEventHandler(ViolinsChangedHandler);
     Violins.AddingNew    += (sender, e) => e.NewObject = violinStorage.CreateNewItem();
     Violins.BeforeChange += BeforeViolinsChangedHandler;
 }
コード例 #21
0
    private void fileGrid_Bind(ChangeTrackingList <EntitySearcher> changeTrackingList, string sortColumn, string dortDirection)
    {
        ChangeTrackingList <EntitySearcher> tempTrackingList = new ChangeTrackingList <EntitySearcher>();

        foreach (EntitySearcher s in changeTrackingList)
        {
            tempTrackingList.Add(s);
        }

        EntitySearcher search = new EntitySearcher();

        search.Field    = "IsPublic";
        search.Relation = "AND";
        search.Operator = "=";
        search.Content  = "True";
        tempTrackingList.Add(search);

        FineUI.TreeNode node = tvwFolder.SelectedNode;
        if (node != null && node.NodeID != "0")
        {
            if (chkContainFolder.Checked)
            {
                strNodes = new StringBuilder();
                string nodes = GetSubNodes(node);
                nodes = nodes.Remove(nodes.Length - 1);
                string content = string.Format("({0})", nodes);
                search          = new EntitySearcher();
                search.Field    = "FolderID";
                search.Relation = "AND";
                search.Operator = "in";
                search.Content  = content;
                tempTrackingList.Add(search);
            }
            else
            {
                search          = new EntitySearcher();
                search.Field    = "FolderID";
                search.Relation = "AND";
                search.Operator = "=";
                search.Content  = tvwFolder.SelectedNodeID;
                tempTrackingList.Add(search);
            }
        }
        fileGrid.RecordCount = fileBll.GetCount(tempTrackingList);
        ExtBindingList <FineOffice.Modules.HD_Attachment> list = fileBll.GetList(tempTrackingList, fileGrid.PageIndex, fileGrid.PageSize).ToBindingList();

        list.Sort(sortColumn, dortDirection);
        fileGrid.DataSource = list;
        fileGrid.DataBind();
    }
コード例 #22
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            ExtBindingList <FineOffice.Modules.OA_FlowRunProcess> list = runHandlerBll.FlowRunProcessList(new FineOffice.Modules.OA_FlowRun {
                ID = int.Parse(Request["RunID"])
            }).ToBindingList();

            GridColumn column = transmitGrid.FindColumn(transmitGrid.SortColumn);
            list.Sort(column.SortField, transmitGrid.SortDirection);

            this.transmitGrid.DataSource = list;
            this.transmitGrid.DataBind();
        }
    }
コード例 #23
0
        private void InitMakersData()
        {
            makerStorage = (IMakerStorage)daoDll.CreateInstance(
                "Michalski.Models.MakerStorage", false, BindingFlags.ExactBinding, null, new object[] { dburi }, null, null
                );

            _makers = new ExtBindingList <IMakerModel>();
            foreach (var m in makerStorage.ReadAll())
            {
                _makers.Add(m);
            }
            Makers.ListChanged  += new ListChangedEventHandler(MakersChangedHandler);
            Makers.AddingNew    += (sender, e) => e.NewObject = makerStorage.CreateNewItem();
            Makers.BeforeChange += BeforeMakersChangeHandler;
        }
コード例 #24
0
    private void grdFollow_Bind(ChangeTrackingList <EntitySearcher> changeTrackingList, string sortColumn, string dortDirection)
    {
        EntitySearcher search = new EntitySearcher();

        search.Field    = "LetterID";
        search.Relation = "AND";
        search.Operator = "=";
        search.Content  = hiddenLetterID.Text;
        changeTrackingList.Add(search);

        grdFollow.RecordCount = followBll.GetCount(changeTrackingList);
        ExtBindingList <FineOffice.Modules.ADM_LetterFollow> list = followBll.GetList(changeTrackingList, this.grdFollow.PageIndex, this.grdFollow.PageSize).ToBindingList();

        list.Sort(sortColumn, dortDirection);
        grdFollow.DataSource = list;
        grdFollow.DataBind();
    }
コード例 #25
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            ChangeTrackingList <EntitySearcher> changeTrackingList = new ChangeTrackingList <EntitySearcher>();
            EntitySearcher search = new EntitySearcher();
            search.Field    = "Stop";
            search.Relation = "AND";
            search.Operator = "=";
            search.Content  = "1";
            changeTrackingList.Add(search);

            ViewState["sql"] = changeTrackingList;
            GridColumn column = departmentGrid.FindColumn(departmentGrid.SortColumn);
            ExtBindingList <FineOffice.Modules.HR_Department> list = departmentGrid_Bind(changeTrackingList, column.SortField, departmentGrid.SortDirection);

            if (Request["selected"] != null && Request["selected"].Length > 0)
            {
                List <FineOffice.Modules.HR_Department> tempList = new List <FineOffice.Modules.HR_Department>();
                string[] str = Request["selected"].Split(',');
                for (int i = 0; i < str.Length; i++)
                {
                    if (str[i].Length > 0)
                    {
                        FineOffice.Modules.HR_Department depart = list.Where(d => d.ID == int.Parse(str[i])).FirstOrDefault();
                        tempList.Add(depart);
                    }
                }
                rightGrid.DataSource = tempList;
                rightGrid.DataBind();
            }

            btnNew.OnClientClick    = newDepartmentWin.GetShowReference();
            btnModify.OnClientClick = departmentGrid.GetNoSelectionAlertReference(string.Format("请选择要编辑的{0}!", departmentGrid.Title));
            btnDelete.OnClientClick = departmentGrid.GetNoSelectionAlertReference(string.Format("请选择要删除的{0}!", departmentGrid.Title));
            btnDelete.ConfirmText   = string.Format("你确认要删除选中{0}吗!", departmentGrid.Title);
        }
        //子窗体回发事件
        if (Request.Form["__EVENTARGUMENT"] == "windowClose")
        {
            ChangeTrackingList <EntitySearcher> changeTrackingList = ViewState["sql"] as ChangeTrackingList <EntitySearcher>;
            GridColumn column = departmentGrid.FindColumn(departmentGrid.SortColumn);
            departmentGrid_Bind(changeTrackingList, column.SortField, departmentGrid.SortDirection);
        }
    }
コード例 #26
0
    private void contractGrid_Bind(ChangeTrackingList <EntitySearcher> changeTrackingList, string sortColumn, string dortDirection)
    {
        if (txtExpire.Text.Length > 0)
        {
            EntitySearcher search = new EntitySearcher();
            search.Field    = "Expire";
            search.Relation = "AND";
            search.Operator = "<=";
            search.Content  = txtExpire.Text;
            changeTrackingList.Add(search);
        }

        contractGrid.RecordCount = contractBll.GetCount(changeTrackingList);
        ExtBindingList <FineOffice.Modules.OA_Contract> list = contractBll.GetList(changeTrackingList, this.contractGrid.PageIndex, this.contractGrid.PageSize).ToBindingList();

        list.Sort(sortColumn, dortDirection);
        contractGrid.DataSource = list;
        contractGrid.DataBind();
    }
コード例 #27
0
        private void MakerFilter_TextChanged(object sender, TextChangedEventArgs e)
        {
            var filter = (sender as TextBox).Text;

            if (filter.Length > 0)
            {
                IEnumerable <IMakerModel> filteredDataEnumerable = from maker in mainVM.Makers where maker.name.StartsWith(filter) select maker;
                var filteredData = new ExtBindingList <IMakerModel>();
                foreach (var item in filteredDataEnumerable)
                {
                    filteredData.Add(item);
                }
                MakersDataGrid.DataContext = filteredData;
            }
            else
            {
                MakersDataGrid.DataContext = mainVM.Makers;
            }
        }
コード例 #28
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         LoadData();
         this.CommonGrid.PageIndex = 0;
         ChangeTrackingList <EntitySearcher> changeTrackingList = new ChangeTrackingList <EntitySearcher>();
         ViewState["sql"] = changeTrackingList;
         GridColumn column = CommonGrid.FindColumn(CommonGrid.SortColumn);
         ExtBindingList <FineOffice.Modules.HR_Personnel> list = BindGrid(changeTrackingList, column.SortField, CommonGrid.SortDirection);
     }
     //子窗体回发事件
     if (Request.Form["__EVENTARGUMENT"] == "windowClose")
     {
         ChangeTrackingList <EntitySearcher> changeTrackingList = ViewState["sql"] as ChangeTrackingList <EntitySearcher>;
         GridColumn column = CommonGrid.FindColumn(CommonGrid.SortColumn);
         BindGrid(changeTrackingList, column.SortField, CommonGrid.SortDirection);
     }
 }
コード例 #29
0
        private void ViolinFilter_TextChanged(object sender, TextChangedEventArgs e)
        {
            var filter = (sender as TextBox).Text;

            if (filter.Length > 0)
            {
                IEnumerable <IViolinModel> filteredDataEnumerable = from violin in mainVM.Violins where violin.maker.StartsWith(filter) select violin;
                var filteredData = new ExtBindingList <IViolinModel>();
                foreach (var item in filteredDataEnumerable)
                {
                    filteredData.Add(item);
                }
                ViolinsDataGrid.DataContext = filteredData;
            }
            else
            {
                ViolinsDataGrid.DataContext = mainVM.Violins;
            }
        }
コード例 #30
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            LoadData();
            this.personGrid.PageIndex = 0;
            ChangeTrackingList <EntitySearcher> changeTrackingList = new ChangeTrackingList <EntitySearcher>();
            ViewState["sql"] = changeTrackingList;
            GridColumn column = personGrid.FindColumn(personGrid.SortColumn);
            ExtBindingList <FineOffice.Modules.HR_Personnel> list = personGrid_Bind(changeTrackingList, column.SortField, personGrid.SortDirection);

            #region 恢复选中
            if (Request["selected"] != null && Request["selected"].Length > 0)
            {
                List <FineOffice.Modules.HR_Personnel> tempList = new List <FineOffice.Modules.HR_Personnel>();
                string[] str = Request["selected"].Split(',');
                for (int i = 0; i < str.Length; i++)
                {
                    if (str[i].Length > 0)
                    {
                        FineOffice.Modules.HR_Personnel depart = list.Where(d => d.ID == int.Parse(str[i])).FirstOrDefault();
                        tempList.Add(depart);
                    }
                }
                rightGrid.DataSource = tempList;
                rightGrid.DataBind();
            }
            #endregion

            btnNew.OnClientClick = newPersonWin.GetShowReference();


            btnModify.OnClientClick = personGrid.GetNoSelectionAlertReference(string.Format("请选择要编辑的{0}!", personGrid.Title));
            btnDelete.OnClientClick = personGrid.GetNoSelectionAlertReference(string.Format("请选择要删除的{0}!", personGrid.Title));
            btnDelete.ConfirmText   = string.Format("你确认要删除选中{0}吗!", personGrid.Title);
        }
        if (Request.Form["__EVENTARGUMENT"] == "subwin_close")
        {
            ChangeTrackingList <EntitySearcher> changeTrackingList = ViewState["sql"] as ChangeTrackingList <EntitySearcher>;
            GridColumn column = personGrid.FindColumn(personGrid.SortColumn);
            personGrid_Bind(changeTrackingList, column.SortField, personGrid.SortDirection);
        }
    }