Пример #1
0
        /// <summary>
        /// 导出通讯录
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void btnOutExcel_Click(object sender, RoutedEventArgs e)
        {
            string sType = "", sValue = "";

            sType  = treeOrganization.sType;
            sValue = treeOrganization.sValue;
            if (sType != "Company")
            {
                ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("CAUTION"), Utility.GetResourceStr("SELECTCOMPANY"),
                                               Utility.GetResourceStr("CONFIRM"), MessageIcon.Exclamation);
                return;
            }

            dialog.Filter      = "MS Excel Files|*.xls";
            dialog.FilterIndex = 1;
            result             = dialog.ShowDialog();

            string filter = "";

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

            TextBox txtEmpName = Utility.FindChildControl <TextBox>(expander, "txtEmpName");

            if (txtEmpName != null)
            {
                if (!string.IsNullOrEmpty(txtEmpName.Text.Trim()))
                {
                    if (!string.IsNullOrEmpty(filter))
                    {
                        filter += " and ";
                    }
                    filter += " @" + paras.Count().ToString() + ".Contains(EMPLOYEECNAME)";
                    paras.Add(txtEmpName.Text.Trim());
                }
            }

            string companyID = sValue;

            //client.ExportEmployeeAsync(companyID, filter, paras, SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID);
            client.ExportContactsListAsync(companyID, filter, paras, sType, sValue, SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID);
        }