protected void btnImport_Click(object sender, ImageClickEventArgs e)
    {
        string companyCD = ((UserInfoUtil)SessionUtil.Session["UserInfo"]).CompanyCD;

        string CustNo   = this.txtCustNo.Text;
        string CustName = this.txtCustName.Text;
        string CustNam  = this.txtCustNam.Text;
        string PYShort  = this.txtPYShort.Text;
        string CustType = this.drpCustType.Value;

        if (CustType == "0")
        {
            CustType = "";
        }
        string CustClass = this.txtCustClass.Value;
        string AreaID    = this.drpAreaID.Value;

        if (AreaID == "0")
        {
            AreaID = "";
        }
        string CreditGrade = this.drpCreditGrade.Value;

        if (CreditGrade == "0")
        {
            CreditGrade = "";
        }
        string Manager         = this.HidManager.Value;
        string StartCreateDate = this.txtStartCreateDate.Text;
        string EndCreateDate   = this.txtEndCreateDate.Text;



        int       TotalCount = 0;
        DataTable dt         = ProviderInfoBus.SelectProviderInfo(1, 1000000, "ID", ref TotalCount, CustNo, CustName, CustNam, PYShort, CustType, CustClass, AreaID, CreditGrade, Manager, StartCreateDate, EndCreateDate);



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

        //导出标题
        string headerTitle = "供应商编号|供应商名称|供应商简称|供应商拼音代码|供应商类别|供应商分类|所在区域|分管采购员|优质级别|建挡人|建挡日期";

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

        //导出标题所对应的列字段名称
        string columnFiled = "CustNo|CustName|CustNam|PYShort|CustTypeName|CustClassName|AreaName|ManagerName|CreditGradeName|CreatorName|CreateDate";

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

        XBase.Common.OutputToExecl.ExportToTable(this.Page, dt, header, field, "供应商档案列表");
    }
Exemple #2
0
    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_PROVIDERINFO;

        /*此处需注意在模板设置表里的字段和取基本信息的字段是否一致*/
        string[,] aBase =
        {
            { "供应商编号",   "CustNo"           },
            { "供应商类别",   "CustTypeName"     },
            { "供应商分类",   "CustClassName"    },
            { "供应商名称",   "CustName"         },
            { "供应商简称",   "CustNam"          },
            { "供应商拼音代码", "PYShort"          },
            { "供应商简介",   "CustNote"         },
            { "国家地区",    "CountryName"      },
            { "省",       "Province"         },
            { "市",       "City"             },
            { "邮编",      "Post"             },
            { "联系人",     "ContactName"      },
            { "电话",      "Tel"              },
            { "传真",      "Fax"              },
            { "手机",      "Mobile"           },
            { "邮件",      "email"            },
            { "在线咨询",    "OnLine"           },
            { "公司网址",    "WebSite"          },
            { "交货方式",    "TakeTypeName"     },
            { "运送方式",    "CarryTypeName"    },
            { "供应商优先级别", "CreditGradeName"  },
            { "热点供应商",   "HotIsName"        },
            { "启用状态",    "UsedStatusName"   },
            { "分管采购员",   "ManagerName"      },
            { "联络期限",    "LinkCycle"        },
            { "所在地区",    "AreaName"         },
            { "发货地址",    "SendAddress"      },
            { "经营范围",    "SellArea"         },
            { "结算方式",    "PayTypeName"      },
            { "币种",      "CurrencyTypeName" },
            { "开户行",     "OpenBank"         },
            { "户名",      "AccountMan"       },
            { "帐号",      "AccountNum"       },
            { "成立时间",    "SetupDate"        },
            { "法人代表",    "ArtiPerson"       },
            { "一般纳税人",   "IsTaxName"        },
            { "税务登记号",   "TaxCD"            },
            { "营业执照号",   "BusiNumber"       },
            { "热度",      "HotHowName"       },
        };
        DataTable dbPrint = XBase.Business.Common.PrintParameterSettingBus.GetPrintParameterSettingInfo(model);

        DataTable dtProviderInfo = ProviderInfoBus.SelectProviderInfo(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 = "CustNo|CustTypeName|CustClassName|CustName|CustNam|PYShort|CustNote|CountryName|Province|City|Post|ContactName|Tel|Fax|Mobile|email|OnLine|WebSite|TakeTypeName|CarryTypeName|CreditGradeName|HotIsName|UsedStatusName|ManagerName|LinkCycle|AreaName|SendAddress|SellArea|PayTypeName|CurrencyTypeName|OpenBank|AccountMan|AccountNum|SetupDate|ArtiPerson|IsTaxName|TaxCD|BusiNumber|HotHowName";
        }

        #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
    }