Beispiel #1
0
        private void LoadData()
        {
            loadbar.Start();
            int    pageCount = 0;
            string filter    = "";
            string strState  = "";

            System.Collections.ObjectModel.ObservableCollection <object> paras = new System.Collections.ObjectModel.ObservableCollection <object>();

            if (Checkstate != Convert.ToInt32(CheckStates.All).ToString())
            {
                strState = Checkstate;
            }
            //根据部门过滤
            ComboBox cbxDepName = Utility.FindChildControl <ComboBox>(expander, "cbxDepName");

            if (cbxDepName != null)
            {
                if (cbxDepName.SelectedIndex > 0)
                {
                    T_HR_DEPARTMENT temp = cbxDepName.SelectedItem as T_HR_DEPARTMENT;
                    filter += "T_HR_DEPARTMENT.DEPARTMENTID==@" + paras.Count().ToString();
                    paras.Add(temp.DEPARTMENTID);
                }
            }
            //根据公司过滤
            ComboBox cbxCpyName = Utility.FindChildControl <ComboBox>(expander, "cbxCpyName");

            if (cbxCpyName != null)
            {
                if (cbxCpyName.SelectedIndex > 0)
                {
                    if (!string.IsNullOrEmpty(filter))
                    {
                        filter += " and ";
                    }
                    T_HR_COMPANY temp = cbxCpyName.SelectedItem as T_HR_COMPANY;
                    filter += " T_HR_DEPARTMENT.T_HR_COMPANY.COMPANYID==@" + paras.Count().ToString();
                    paras.Add(temp.COMPANYID);
                }
            }
            TextBox txtEmpName = Utility.FindChildControl <TextBox>(expander, "txtEmpName");

            if (txtEmpName != null)
            {
                if (!string.IsNullOrEmpty(txtEmpName.Text))
                {
                    if (!string.IsNullOrEmpty(filter))
                    {
                        filter += " and ";
                    }
                    //filter += "T_HR_POSTDICTIONARY.POSTNAME==@" + paras.Count().ToString();
                    filter += " @" + paras.Count().ToString() + ".Contains(T_HR_POSTDICTIONARY.POSTNAME)";
                    paras.Add(txtEmpName.Text.Trim());
                }
            }
            client.PostPagingAsync(dataPager.PageIndex, dataPager.PageSize, "T_HR_DEPARTMENT.T_HR_DEPARTMENTDICTIONARY.DEPARTMENTNAME",
                                   filter, paras, pageCount, SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID, strState);
        }