protected void btnImport_Click(object sender, ImageClickEventArgs e) { //设置行为参数 string orderString = hiddExpOrder.Value.Trim(); //排序 string order = "desc"; //排序:降序 string orderBy = (!string.IsNullOrEmpty(orderString)) ? orderString.Substring(0, orderString.Length - 2) : "CreatDate"; //要排序的字段,如果为空,默认为"ID" if (orderString.EndsWith("_a")) { order = "asc"; //排序:升序 } int pageCount = int.Parse(hiddExpTotal.Value); //每页显示记录数 int pageIndex = 1; //当前页 int totalCount = 0; //总记录数 string ord = orderBy + " " + order; //排序字段 DataTable dt = new DataTable(); AdversaryInfoModel adversaryInfoModel = new AdversaryInfoModel(); string strCustNo = hiddExpCustNo.Value; string strCustType = hiddExpCustType.Value; string strCustName = hiddExpCustName.Value; string strPYShort = hiddExpPYShort.Value; string CustNo = strCustNo.Length == 0 ? null : strCustNo; int? CustType = strCustType.Length == 0 ? null : (int?)Convert.ToInt32(strCustType); string CustName = strCustName.Length == 0 ? null : strCustName; string PYShort = strPYShort.Length == 0 ? null : strPYShort; adversaryInfoModel.CustNo = CustNo; adversaryInfoModel.CustType = CustType; adversaryInfoModel.CustName = CustName; adversaryInfoModel.PYShort = PYShort; dt = AdversaryInfoBus.GetOrderList(adversaryInfoModel, pageIndex, pageCount, ord, ref totalCount); //导出标题 string headerTitle = "对手编号|对手名称|对手类别|对手拼音代码|联系人|联系电话|创建人|创建日期"; //string headerTitle = "建档日期|启用状态"; string[] header = headerTitle.Split('|'); //导出标题所对应的列字段名称 string columnFiled = "CustNo|CustName|TypeName|PYShort|ContactName|Tel|EmployeeName|CreatDate"; //string columnFiled = "CreateDate|strUsedStatus"; string[] field = columnFiled.Split('|'); XBase.Common.OutputToExecl.ExportToTable(this.Page, dt, header, field, "竞争对手档案列表"); }
private void BindTreeChildNodes() { DataTable dt_product = AdversaryInfoBus.GetAdversaryType(); DataView dataView = dt_product.DefaultView; foreach (DataRow row in dt_product.Select("SupperID=0")) { TreeNode nodes = new TreeNode(); nodes.Text = row["CodeName"].ToString(); nodes.Value = row["ID"].ToString(); nodes.NavigateUrl = string.Format("javascript:SelectedNodeChanged('{0}','{1}');", nodes.Text, nodes.Value); LoadSubData(row["ID"].ToString(), nodes, dt_product); //node.ChildNodes.Add(nodes); this.TreeView1.Nodes.Add(nodes); nodes.Expanded = false; } }
protected void LoadPrintInfo() { PrintParameterSettingModel model = new PrintParameterSettingModel(); model.CompanyCD = ((UserInfoUtil)SessionUtil.Session["UserInfo"]).CompanyCD; model.BillTypeFlag = int.Parse(ConstUtil.BILL_TYPEFLAG_SALE); model.PrintTypeFlag = ConstUtil.PRINTBILL_ADVERSARY; AdversaryInfoModel modelMRP = new AdversaryInfoModel(); modelMRP.CompanyCD = ((UserInfoUtil)SessionUtil.Session["UserInfo"]).CompanyCD; modelMRP.CustNo = this.PlanNo; /*此处需注意在模板设置表里的字段和取基本信息的字段是否一致*/ #region 信息的字段 string[,] aBase = { { "对手编号", "CustNo" }, { "对手类别", "CustTypeName" }, { "对手细分", "CustClassName" }, { "对手名称", "CustName" }, { "对手简称", "ShortNam" }, { "对手拼音代码", "PYShort" }, { "对手所在区域", "AreaIDName" }, { "成立时间", "SetupDate" }, { "法人代表", "ArtiPerson" }, { "单位性质", "CompanyTypeName" }, { "员工总数", "StaffCount" }, { "注册资本(万元)", "SetupMoney" }, { "注册地址", "SetupAddress" }, { "公司网址", "website" }, { "资产规模(万元)", "CapitalScale" }, { "经营范围", "SellArea" }, { "年销售额(万元)", "SaleroomY" }, { "年利润额(万元)", "ProfitY" }, { "税务登记号", "TaxCD" }, { "营业执照号", "BusiNumber" }, { "一般纳税人", "IsTaxName" }, { "地址", "Address" }, { "邮编", "Post" }, { "联系人", "ContactName" }, { "电话", "Tel" }, { "手机", "Mobile" }, { "邮件", "email" }, { "对手简介", "CustNote" }, { "主打产品 ", "Product" }, { "竞争产品/方案", "Project" }, { "竞争能力", "Power" }, { "竞争优势", "Advantage" }, { "竞争劣势", "disadvantage" }, { "应对策略", "Policy" }, { "市场占有率(%)", "Market" }, { "销售模式", "SellMode" }, { "启用状态", "UsedStatusName" }, { "制单人", "EmployeeName" }, { "制单日期", "CreatDate" }, { "最后更新人", "ModifiedUserID" }, { "最后更新日", "ModifiedDate" }, { "备注", "Remark" }, }; string[,] aDetail = { { "对手动态", "Dynamic" }, }; #endregion DataTable dbPrint = XBase.Business.Common.PrintParameterSettingBus.GetPrintParameterSettingInfo(model); DataTable dtMRP = AdversaryInfoBus.GetRepOrder(PlanNo); //SellContractBus.GetRepOrder(OfferNo); DataTable dtDetail = AdversaryInfoBus.GetRepOrderDetail(PlanNo); // SellContractBus.GetRepOrderDetail(OfferNo); string strBaseFields = ""; string strDetailFields = ""; if (dbPrint.Rows.Count > 0) { isSeted.Value = "1"; strBaseFields = dbPrint.Rows[0]["BaseFields"].ToString(); strDetailFields = dbPrint.Rows[0]["DetailFields"].ToString(); } else { isSeted.Value = "0"; strBaseFields = "CustNo|CustTypeName|CustClassName|CustName|ShortNam|PYShort|AreaIDName|SetupDate|ArtiPerson|CompanyTypeName|StaffCount|SetupMoney|" + "SetupAddress|website|CapitalScale|SellArea|SaleroomY|ProfitY|TaxCD|BusiNumber|IsTaxName|Address|Post|ContactName|Tel|Mobile|email|" + "CustNote|Product|Project|Power|Advantage|disadvantage|Policy|Market|SellMode|UsedStatusName|EmployeeName|CreatDate|ModifiedUserID|" + "ModifiedDate|Remark"; strDetailFields = "Dynamic"; } #region 主表信息 if (!string.IsNullOrEmpty(strBaseFields)) { tableBase.InnerHtml = WritePrintPageTable("竞争对手档案", strBaseFields, strDetailFields, aBase, aDetail, dtMRP, dtDetail, true); } #endregion #region 明细信息 if (!string.IsNullOrEmpty(strDetailFields)) { tableDetail.InnerHtml = WritePrintPageTable("对手动态信息", strBaseFields, strDetailFields, aBase, aDetail, dtMRP, dtDetail, false); } #endregion }