private void BinddrpLinkType()
    {
        DataTable dt = ProviderLinkManBus.GetdrpLinkType();

        if (dt != null && dt.Rows.Count > 0)
        {
            drpLinkType.DataSource     = dt;
            drpLinkType.DataTextField  = "TypeName";
            drpLinkType.DataValueField = "ID";
            drpLinkType.DataBind();
            ListItem Item = new ListItem("--请选择--", "");
            drpLinkType.Items.Insert(0, Item);
        }
    }
    protected void btnImport_Click(object sender, ImageClickEventArgs e)
    {
        string companyCD = ((UserInfoUtil)SessionUtil.Session["UserInfo"]).CompanyCD;

        string CustNo      = this.txtCustNo.Value;
        string LinkManName = this.txtLinkManName.Text;
        string Handset     = this.txtHandset.Text;;
        string Important   = this.drpImportant.Value;

        if (Important == "0")
        {
            Important = "";
        }
        string LinkType = this.drpLinkType.Value;

        if (LinkType == "0")
        {
            LinkType = "";
        }
        string StartBirthday = this.txtStartBirthday.Text;
        string EndBirthday   = this.txtEndBirthday.Text;



        int       TotalCount = 0;
        DataTable dt         = ProviderLinkManBus.SelectProviderLinkMan(1, 1000000, "ID", ref TotalCount, CustNo, LinkManName, Handset, Important, LinkType, StartBirthday, EndBirthday);



        //DataTable dt = WorkCenterBus.GetWorkCenterListBycondition(model, 1, 1000000, "ID desc", ref totalCount);

        //导出标题
        string headerTitle = "联系人姓名|供应商名称|称谓|联系人类型|重要程度|电话|手机|邮件|MSN|QQ|生日";

        string[] header = headerTitle.Split('|');

        //导出标题所对应的列字段名称
        string columnFiled = "LinkManName|CustName|Appellation|LinkTypeName|Important|WorkTel|Handset|MailAddress|MSN|QQ|Birthday";

        string[] field = columnFiled.Split('|');

        XBase.Common.OutputToExecl.ExportToTable(this.Page, dt, header, field, "供应商联系人列表");
    }
    protected void LoadPrintInfo()
    {
        PrintParameterSettingModel model = new PrintParameterSettingModel();

        model.CompanyCD     = ((UserInfoUtil)SessionUtil.Session["UserInfo"]).CompanyCD;
        model.BillTypeFlag  = int.Parse(ConstUtil.BILL_TYPEFLAG_PURCHASE);
        model.PrintTypeFlag = ConstUtil.PRINTBILL_TYPEFLAG_PROVIDERLINKMAN;

        /*此处需注意在模板设置表里的字段和取基本信息的字段是否一致*/
        string[,] aBase =
        {
            { "联系人姓名",  "LinkManName"    },
            { "供应商姓名",  "CustName"       },
            { "性别",     "SexName"        },
            { "重要程度",   "ImportantName"  },
            { "称谓",     "Appellation"    },
            { "单位",     "Company"        },
            { "部门",     "Department"     },
            { "职务",     "Position"       },
            { "负责业务",   "Operation"      },
            { "工作电话",   "WorkTel"        },
            { "传真",     "Fax"            },
            { "移动电话",   "Handset"        },
            { "邮件地址",   "MailAddress"    },
            { "家庭电话",   "HomeTel"        },
            { "MSN",    "MSN"            },
            { "QQ",     "QQ"             },
            { "邮编",     "Post"           },
            { "联系人类型",  "LinkTypeName"   },
            { "年龄",     "Age"            },
            { "证件类型",   "PaperType"      },
            { "证件号",    "PaperNum"       },
            { "最后更新日期", "ModifiedDate"   },
            { "最后更新人",  "ModifiedUserID" },
            { "生日",     "Birthday"       },
            { "爱好",     "Likes"          },
            { "备注",     "Remark"         },
        };
        DataTable dbPrint = XBase.Business.Common.PrintParameterSettingBus.GetPrintParameterSettingInfo(model);

        DataTable dtProviderInfo = ProviderLinkManBus.SelectProviderLinkMan(this.intMrpID);

        string strBaseFields   = "";
        string strDetailFields = "";
        /*第二明细*/
        string strDetailSecondFields = "";

        if (dbPrint.Rows.Count > 0)
        {
            isSeted.Value   = "1";
            strBaseFields   = dbPrint.Rows[0]["BaseFields"].ToString();
            strDetailFields = dbPrint.Rows[0]["DetailFields"].ToString();
            /*第二明细*/
            strDetailSecondFields = dbPrint.Rows[0]["DetailSecondFields"].ToString();
        }
        else
        {
            isSeted.Value = "0";
            strBaseFields = "LinkManName|CustName|SexName|ImportantName|Appellation|Company|Department|Position|Operation|WorkTel|Fax|Handset|MailAddress|HomeTel|MSN|QQ|Post|LinkTypeName|Age|PaperType|PaperNum|ModifiedDate|ModifiedUserID|Birthday|Likes|Remark";
        }

        #region 2.主表信息
        if (!string.IsNullOrEmpty(strBaseFields))
        {
            tableBase.InnerHtml = WritePrintPageTable("供应商联系人", strBaseFields, null, aBase, null, dtProviderInfo, null, true);
        }
        #endregion

        //#region 3.明细信息
        //if (!string.IsNullOrEmpty(strDetailFields))
        //{
        //    tableDetail.InnerHtml = WritePrintPageTable("物料需求计划", strBaseFields, strDetailFields, aBase, aDetail, dtMRP, dtDetail, false);
        //}
        //#endregion

        ///*第二明细*/
        //#region 4.明细信息2
        //if (!string.IsNullOrEmpty(strDetailSecondFields))
        //{
        //    tableDetail2.InnerHtml = WritePrintPageTable("物料需求计划", strBaseFields, strDetailSecondFields, aBase, aSecondDetail, dtMRP, dtDetail, false);
        //}
        //#endregion
    }