/// <summary> /// 绑定信息 /// </summary> private void PageDataBind() { DataBase.Data.HashObject Hparams = new DataBase.Data.HashObject(); Hparams.Add("sqlwhere", Query()); //(账户,在线,销账)汇总 DataTable[] dsSalesInfoCollect = null; if (ViewState["paytype"].ToString() == "qkxz") { dsSalesInfoCollect = base.baseDataManage.MulExecProc("pro_CpyXZAccountCollect", Hparams); } else { dsSalesInfoCollect = base.baseDataManage.MulExecProc("pro_CpyAccountCollect", Hparams); } gvUserSumMaryInfo.DataSource = dsSalesInfoCollect[0]; gvUserSumMaryInfo.DataBind(); //DataTable dt = dsSalesInfoCollect[0]; //DataRow drnul = dt.NewRow(); //for (int i = 0; i < 50; i++) //{ // dt.Rows.Add(drnul[1]); //} //gvUserSumMaryInfoNew.DataSource = dt; //gvUserSumMaryInfoNew.DataBind(); }
/// <summary> /// 查询数据绑定 /// </summary> private void PageDataBind() { DataBase.Data.HashObject Hparams = new DataBase.Data.HashObject(); Hparams.Add("CONDITION", Query()); try { #region 3.机票信息明细 绑定 Hparams.Add("TYPE", true); Hparams.Add("PAGE_COUNT", Curr); Hparams.Add("SHOWROW", AspNetPager1.PageSize); Hparams.Add("Export", false); DataTable[] dsTicketDetail = base.baseDataManage.MulExecProc("pro_TicketFZ", Hparams); int countTicketDetail = 0; DataTable dt = new DataTable(); DataTable dtNew = new DataTable(); if (dsTicketDetail != null && dsTicketDetail.Length > 0) { countTicketDetail = dsTicketDetail[1].Rows.Count; dt = dsTicketDetail[1]; if (countTicketDetail > 1) { lbtnDc3.Visible = true; } lal3.Visible = true; dtNew = dt.Copy(); AspNetPager1.RecordCount = Convert.ToInt32(dsTicketDetail[0].Rows[0]["总行数"].ToString()); AspNetPager1.CustomInfoHTML = " 页码 : <font color=\"red\" size='2px'>" + Curr + "</font> / " + AspNetPager1.PageCount; gvTicketDetail.DataSource = dt; } else { gvTicketDetail.DataSource = null; } gvTicketDetail.DataBind(); #endregion } catch (Exception ex3) { gvTicketDetail.DataSource = null; gvTicketDetail.DataBind(); } }
/// <summary> /// 导出报表 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void lbtnDc3_Click(object sender, EventArgs e) { #region DataBase.Data.HashObject Hpm = new DataBase.Data.HashObject(); Hpm.Add("CONDITION", Query()); Hpm.Add("TYPE", true); Hpm.Add("PAGE_COUNT", 1); Hpm.Add("SHOWROW", 999999); Hpm.Add("Export", true); DataTable[] dsTicketDetail = base.baseDataManage.MulExecProc("pro_TicketFZ", Hpm); int countTicketDetail = 0; DataTable dt = new DataTable(); DataTable dtNew = new DataTable(); if (dsTicketDetail != null && dsTicketDetail.Length > 0) { countTicketDetail = dsTicketDetail[0].Rows.Count; dt = dsTicketDetail[0]; if (countTicketDetail > 1) { lbtnDc3.Visible = true; } lal3.Visible = true; DataRow drnul = dt.NewRow(); for (int i = 0; i < 50; i++) { dt.Rows.Add(drnul[1]); } gvTicketDetailNew.DataSource = dt; } else { gvTicketDetailNew.DataSource = null; } gvTicketDetailNew.DataBind(); #endregion Response.Clear(); DownloadExcelFlag = true; ViewState["type"] = "3"; Export("分账报表_" + DateTime.Now.ToString("yyyy_MM_dd_hh_mm_ss")); }
protected void btnPrint_Click(object sender, EventArgs e) { string cpyno = mCompany.UninCode.Length > 12 ? mCompany.UninCode.Substring(0, 12) : mCompany.UninCode; DataBase.Data.HashObject Hparams = new DataBase.Data.HashObject(); Hparams.Add("sqlWhere", Con); Hparams.Add("cpyno", cpyno); string pro = "pro_PayMentRecord"; if (ViewState["paytype"].ToString() == "pos") { pro = "pro_PosPayMentRecord"; } DataTable[] dtlist = base.baseDataManage.MulExecProc(pro, Hparams); DataTable dt = dtlist[0]; ExcelRender.RenderToExcel(dt, Context, this.spantitle.InnerText + "报表_" + DateTime.Now.ToString("yyyy_MM_dd_hh_mm_ss") + ".xls"); }
/// <summary> /// 导出报表 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnOut_Click(object sender, EventArgs e) { //Response.Clear(); //DownloadExcelFlag = true; //Export(this.spantitle.InnerText+"报表_" + DateTime.Now.ToString("yyyy_MM_dd_hh_mm_ss")); DataBase.Data.HashObject Hparams = new DataBase.Data.HashObject(); Hparams.Add("sqlwhere", Query()); //(账户,在线,销账)汇总 DataTable[] dsSalesInfoCollect = null; if (ViewState["paytype"].ToString() == "qkxz") { dsSalesInfoCollect = base.baseDataManage.MulExecProc("pro_CpyXZAccountCollect", Hparams); } else { dsSalesInfoCollect = base.baseDataManage.MulExecProc("pro_CpyAccountCollect", Hparams); } ExcelRender.RenderToExcel(dsSalesInfoCollect[0], Context, this.spantitle.InnerText + "报表_" + DateTime.Now.ToString("yyyy_MM_dd_hh_mm_ss") + ".xls"); }
/// <summary> /// 绑定信息 /// </summary> private void PageDataBind() { DataBase.Data.HashObject Hparams = new DataBase.Data.HashObject(); Hparams.Add("sqlwhere", Query()); //线下收银汇总 DataTable[] dsSalesInfoCollect = base.baseDataManage.MulExecProc("pro_OffLineCollect", Hparams); gvOffLineInfo.DataSource = dsSalesInfoCollect[0]; gvOffLineInfo.DataBind(); DataTable dt = dsSalesInfoCollect[0]; DataRow drnul = dt.NewRow(); for (int i = 0; i < 50; i++) { dt.Rows.Add(drnul[1]); } gvOffLineInfoNew.DataSource = dt; gvOffLineInfoNew.DataBind(); }
/// <summary> ///绑定信息 /// </summary> private void PageDataBind(string showtype) { DataBase.Data.HashObject Hparams = new DataBase.Data.HashObject(); Hparams.Add("strWhere", strQuery()); Hparams.Add("sqlWhere", Query()); Hparams.Add("orderbyWhere", "order by " + ddlSort.SelectedValue + " desc"); Hparams.Add("showType", int.Parse(rblcp.SelectedValue)); DataTable[] dsSalesInfoCollect = null; dsSalesInfoCollect = base.baseDataManage.MulExecProc("pro_BusinessStatistics", Hparams); gvBusinessInfo.DataSource = dsSalesInfoCollect[0]; gvBusinessInfo.DataBind(); if (!string.IsNullOrEmpty(showtype)) { DataTable dt = dsSalesInfoCollect[0]; DataRow drnul = dt.NewRow(); for (int i = 0; i < 50; i++) { dt.Rows.Add(drnul[1]); } gvBusinessInfoNew.DataSource = dt; gvBusinessInfoNew.DataBind(); } if (gvBusinessInfo.Rows.Count > 2 && rblcp.SelectedValue == "1") { gvBusinessInfo.Rows[0].Attributes.Add("Style", "color:Red"); if (!string.IsNullOrEmpty(showtype)) { gvBusinessInfoNew.Rows[0].Attributes.Add("Style", "color:Red"); } } else { gvBusinessInfo.Rows[gvBusinessInfo.Rows.Count - 1].Attributes.Add("Style", "color:Red"); if (!string.IsNullOrEmpty(showtype)) { gvBusinessInfoNew.Rows[gvBusinessInfoNew.Rows.Count - 1].Attributes.Add("Style", "color:Red"); } } }
/// <summary> /// /// </summary> public void BindCount() { try { string UninAllName = txtCustomer.Text.Trim(); string CPTimeState = DateTime.Parse(cptimestart.Value).ToString("yyyy-MM-dd") + " 00:00:00"; string CPTimeEnd = DateTime.Parse(cptimeend.Value).ToString("yyyy-MM-dd") + " 23:59:59"; PbProject.Logic.ControlBase.BaseDataManage baseDataManage = new PbProject.Logic.ControlBase.BaseDataManage(); DataBase.Data.HashObject queryParamter = new DataBase.Data.HashObject(); queryParamter.Add("UninAllName", UninAllName); queryParamter.Add("CPTimeState", CPTimeState); queryParamter.Add("CPTimeEnd", CPTimeEnd); System.Data.DataTable dt = baseDataManage.EexcProc("Proc_GetGXOrderCount", queryParamter); gvTicketDetail.DataSource = dt; gvTicketDetail.DataBind(); } catch (Exception) { } }
/// <summary> /// 绑定信息 /// </summary> private void PageDataBind(string showtype) { DataBase.Data.HashObject Hparams = new DataBase.Data.HashObject(); Hparams.Add("sqlWhere", Query()); //1.机票信息汇总 DataTable[] dsSalesInfoCollect = base.baseDataManage.MulExecProc("pro_UserSalesCollect", Hparams); gvSalesInfo.DataSource = dsSalesInfoCollect[0]; gvSalesInfo.DataBind(); if (!string.IsNullOrEmpty(showtype)) { DataTable dt = dsSalesInfoCollect[0]; DataRow drnul = dt.NewRow(); for (int i = 0; i < 50; i++) { dt.Rows.Add(drnul[1]); } gvSalesInfoNew.DataSource = dt; gvSalesInfoNew.DataBind(); } if (gvSalesInfo.Rows.Count > 2) { gvSalesInfo.Rows[0].Attributes.Add("Style", "color:Red"); if (!string.IsNullOrEmpty(showtype)) { gvSalesInfoNew.Rows[0].Attributes.Add("Style", "color:Red"); } } else { gvSalesInfo.Rows[gvSalesInfo.Rows.Count - 1].Attributes.Add("Style", "color:Red"); if (!string.IsNullOrEmpty(showtype)) { gvSalesInfoNew.Rows[gvSalesInfoNew.Rows.Count - 1].Attributes.Add("Style", "color:Red"); } } }
/// <summary> /// 查询数据绑定 /// </summary> private void PageDataBind() { DataBase.Data.HashObject Hparams = new DataBase.Data.HashObject(); Hparams.Add("CONDITION", Query()); try { #region 信息明细 绑定 bool type = cbType.Checked == true ? true : false; string showdf = cbshowdf.Checked == true ? "1" : "0"; Hparams.Add("TYPE", type); Hparams.Add("PAGE_COUNT", Curr); Hparams.Add("SHOWROW", AspNetPager1.PageSize); Hparams.Add("Export", false); Hparams.Add("ShowOutPay", showdf); if (mCompany.RoleType != 4 && mCompany.RoleType != 5)//分销报表无此参数 { Hparams.Add("LoginCpyNo", mCompany.UninCode); } DataTable[] dsTicketDetail = base.baseDataManage.MulExecProc("pro_TicketDetail", Hparams); int countTicketDetail = 0; DataTable dt = new DataTable(); DataTable dtNew = new DataTable(); if (dsTicketDetail != null && dsTicketDetail.Length > 0) { countTicketDetail = dsTicketDetail[1].Rows.Count; dt = dsTicketDetail[1]; string orderid = ""; decimal dfCountPrice = 0; decimal cjPrice = 0; decimal tfqPrice = 0; decimal PayMoney = 0, RealPayMoney = 0; for (int i = 0; i < dt.Rows.Count - 1; i++) { if (dt.Rows[i]["订单号"].ToString() == orderid) { dt.Rows[i]["代付金额"] = "0"; dt.Rows[i]["差价"] = "0"; if (!string.IsNullOrEmpty(dt.Rows[i]["机票状态"].ToString()) && dt.Rows[i]["机票状态"].ToString() == "改签") { dt.Rows[i]["退废改手续费"] = "0"; dt.Rows[i]["公司应收"] = "0"; dt.Rows[i]["公司实收"] = "0"; } } else { orderid = dt.Rows[i]["订单号"].ToString(); } dfCountPrice += decimal.Parse(dt.Rows[i]["代付金额"].ToString()); cjPrice += decimal.Parse(dt.Rows[i]["差价"].ToString()); tfqPrice += decimal.Parse(dt.Rows[i]["退废改手续费"].ToString()); PayMoney += decimal.Parse(dt.Rows[i]["公司应收"].ToString()); RealPayMoney += decimal.Parse(dt.Rows[i]["公司实收"].ToString()); } dt.Rows[dt.Rows.Count - 1]["代付金额"] = dfCountPrice; dt.Rows[dt.Rows.Count - 1]["差价"] = cjPrice; dt.Rows[dt.Rows.Count - 1]["退废改手续费"] = tfqPrice; dt.Rows[dt.Rows.Count - 1]["公司应收"] = PayMoney; dt.Rows[dt.Rows.Count - 1]["公司实收"] = RealPayMoney; if (countTicketDetail > 1) { lbtnDc3.Visible = true; } lal3.Visible = true; dtNew = dt.Copy(); AspNetPager1.RecordCount = Convert.ToInt32(dsTicketDetail[0].Rows[0]["总行数"].ToString()); AspNetPager1.CustomInfoHTML = " 页码 : <font color=\"red\" size='2px'>" + Curr + "</font> / " + AspNetPager1.PageCount; gvTicketDetail.DataSource = dt; } else { gvTicketDetail.DataSource = null; } gvTicketDetail.DataBind(); #endregion } catch (Exception ex3) { gvTicketDetail.DataSource = null; gvTicketDetail.DataBind(); } }
protected void lbtnDc3_Click(object sender, EventArgs e) { #region DataBase.Data.HashObject Hpm = new DataBase.Data.HashObject(); bool type = cbType.Checked == true ? true : false; string showdf = cbshowdf.Checked == true ? "1" : "0"; Hpm.Add("CONDITION", Query()); Hpm.Add("TYPE", type); Hpm.Add("PAGE_COUNT", 1); Hpm.Add("SHOWROW", 999999); Hpm.Add("Export", true); Hpm.Add("ShowOutPay", showdf); if (mCompany.RoleType != 4 && mCompany.RoleType != 5)//分销报表无此参数 { Hpm.Add("LoginCpyNo", mCompany.UninCode); } DataTable[] dsTicketDetail = base.baseDataManage.MulExecProc("pro_TicketDetail", Hpm); int countTicketDetail = 0; DataTable dt = new DataTable(); DataTable dtNew = new DataTable(); if (dsTicketDetail != null && dsTicketDetail.Length > 0) { countTicketDetail = dsTicketDetail[0].Rows.Count; dt = dsTicketDetail[0]; if (countTicketDetail > 1) { lbtnDc3.Visible = true; string orderid = ""; decimal dfCountPrice = 0; decimal cjPrice = 0; decimal tfqPrice = 0; decimal PayMoney = 0, RealPayMoney = 0; for (int i = 0; i < dt.Rows.Count - 1; i++) { if (dt.Rows[i]["订单号"].ToString() == orderid) { dt.Rows[i]["代付金额"] = "0"; dt.Rows[i]["差价"] = "0"; if (!string.IsNullOrEmpty(dt.Rows[i]["机票状态"].ToString()) && dt.Rows[i]["机票状态"].ToString() == "改签") { dt.Rows[i]["退废改手续费"] = "0"; dt.Rows[i]["公司应收"] = "0"; dt.Rows[i]["公司实收"] = "0"; } } else { orderid = dt.Rows[i]["订单号"].ToString(); } dfCountPrice += decimal.Parse(dt.Rows[i]["代付金额"].ToString()); cjPrice += decimal.Parse(dt.Rows[i]["差价"].ToString()); tfqPrice += decimal.Parse(dt.Rows[i]["退废改手续费"].ToString()); PayMoney += decimal.Parse(dt.Rows[i]["公司应收"].ToString()); RealPayMoney += decimal.Parse(dt.Rows[i]["公司实收"].ToString()); } dt.Rows[dt.Rows.Count - 1]["代付金额"] = dfCountPrice; dt.Rows[dt.Rows.Count - 1]["差价"] = cjPrice; dt.Rows[dt.Rows.Count - 1]["退废改手续费"] = tfqPrice; dt.Rows[dt.Rows.Count - 1]["公司应收"] = PayMoney; dt.Rows[dt.Rows.Count - 1]["公司实收"] = RealPayMoney; } lal3.Visible = true; DataRow drnul = dt.NewRow(); for (int i = 0; i < 50; i++) { dt.Rows.Add(drnul[1]); } gvTicketDetailNew.DataSource = dt; } else { gvTicketDetailNew.DataSource = null; } gvTicketDetailNew.DataBind(); #endregion Response.Clear(); DownloadExcelFlag = true; Export("机票明细报表_" + DateTime.Now.ToString("yyyy_MM_dd_hh_mm_ss")); }
public void Add(string[] keys, params object[] values) { HashObject item = new HashObject(keys, values); this.Add(item); }
/// <summary> /// 查询数据绑定 /// </summary> private void PageDataBind() { DataBase.Data.HashObject Hparams = new DataBase.Data.HashObject(); Hparams.Add("CONDITION", Query()); try { #region 信息明细 绑定 bool type = cbType.Checked == true ? true : false; Hparams.Add("TYPE", type); Hparams.Add("PAGE_COUNT", Curr); Hparams.Add("SHOWROW", AspNetPager1.PageSize); Hparams.Add("Export", false); if (mCompany.RoleType != 4 && mCompany.RoleType != 5)//分销报表无此参数 { Hparams.Add("LoginCpyNo", mCompany.UninCode); } DataTable[] dsTicketDetail = base.baseDataManage.MulExecProc("pro_TicketOrderDetail", Hparams); int countTicketDetail = 0; DataTable dt = new DataTable(); DataTable dtNew = new DataTable(); if (dsTicketDetail != null && dsTicketDetail.Length > 0) { countTicketDetail = dsTicketDetail[1].Rows.Count; dt = dsTicketDetail[1]; if (countTicketDetail > 1) { lbtnDc3.Visible = true; } lal3.Visible = true; //根据勾选显示 bool result = false; for (int i = 0; i < cblist.Items.Count; i++) { if (cblist.Items[i].Selected == true) { result = true; break; } } if (result == true) { for (int i = 0; i < cblist.Items.Count; i++) { if (cblist.Items[i].Selected == true) { } else { dt.Columns.Remove(cblist.Items[i].Value); //隐藏 } } } dtNew = dt.Copy(); AspNetPager1.RecordCount = Convert.ToInt32(dsTicketDetail[0].Rows[0]["总行数"].ToString()); AspNetPager1.CustomInfoHTML = " 页码 : <font color=\"red\" size='2px'>" + Curr + "</font> / " + AspNetPager1.PageCount; gvTicketDetail.DataSource = dt; } else { gvTicketDetail.DataSource = null; } gvTicketDetail.DataBind(); #endregion } catch (Exception ex3) { gvTicketDetail.DataSource = null; gvTicketDetail.DataBind(); } }
protected void lbtnDc3_Click(object sender, EventArgs e) { #region DataBase.Data.HashObject Hpm = new DataBase.Data.HashObject(); bool type = cbType.Checked == true ? true : false; Hpm.Add("CONDITION", Query()); Hpm.Add("TYPE", type); Hpm.Add("PAGE_COUNT", 1); Hpm.Add("SHOWROW", 999999); Hpm.Add("Export", true); if (mCompany.RoleType != 4 && mCompany.RoleType != 5) //分销报表无此参数 { Hpm.Add("LoginCpyNo", mCompany.UninCode); } DataTable[] dsTicketDetail = base.baseDataManage.MulExecProc("pro_TicketOrderDetail", Hpm); int countTicketDetail = 0; DataTable dt = new DataTable(); DataTable dtNew = new DataTable(); if (dsTicketDetail != null && dsTicketDetail.Length > 0) { countTicketDetail = dsTicketDetail[0].Rows.Count; dt = dsTicketDetail[0]; if (countTicketDetail > 1) { lbtnDc3.Visible = true; } lal3.Visible = true; //根据勾选显示 bool result = false; for (int i = 0; i < cblist.Items.Count; i++) { if (cblist.Items[i].Selected == true) { result = true; break; } } if (result == true) { for (int i = 0; i < cblist.Items.Count; i++) { if (cblist.Items[i].Selected == true) { } else { dt.Columns.Remove(cblist.Items[i].Value); //隐藏 } } } if (dt.Rows.Count < 50) { DataRow drnul = dt.NewRow(); for (int i = 0; i < 50; i++) { dt.Rows.Add(drnul[1]); } } gvTicketDetailNew.DataSource = dt; } else { gvTicketDetailNew.DataSource = null; } gvTicketDetailNew.DataBind(); #endregion Response.Clear(); DownloadExcelFlag = true; Export("机票明细报表_" + DateTime.Now.ToString("yyyy_MM_dd_hh_mm_ss")); }
protected void lbtnDc3_Click(object sender, EventArgs e) { #region DataBase.Data.HashObject Hpm = new DataBase.Data.HashObject(); bool type = cbType.Checked == true ? true : false; string showdf = cbshowdf.Checked == true ? "1" : "0"; Hpm.Add("CONDITION", Query()); Hpm.Add("TYPE", type); Hpm.Add("PAGE_COUNT", 1); Hpm.Add("SHOWROW", 999999); Hpm.Add("Export", true); Hpm.Add("ShowOutPay", showdf); if (mCompany.RoleType != 4 && mCompany.RoleType != 5) //分销报表无此参数 { Hpm.Add("LoginCpyNo", mCompany.UninCode); } DataTable[] dsTicketDetail = base.baseDataManage.MulExecProc(ViewState["pro3"].ToString(), Hpm); int countTicketDetail = 0; DataTable dt = new DataTable(); DataTable dtNew = new DataTable(); if (dsTicketDetail != null && dsTicketDetail.Length > 0) { countTicketDetail = dsTicketDetail[0].Rows.Count; dt = dsTicketDetail[0]; if (countTicketDetail > 1) { lbtnDc3.Visible = true; if (mCompany.RoleType != 4 && mCompany.RoleType != 5) //运营 { string orderid = ""; decimal dfCountPrice = 0; decimal cjPrice = 0; decimal tfqPrice = 0; decimal PayMoney = 0, RealPayMoney = 0; for (int i = 0; i < dt.Rows.Count - 1; i++) { if (dt.Rows[i]["订单号"].ToString() == orderid) { dt.Rows[i]["代付金额"] = "0"; dt.Rows[i]["差价"] = "0"; if (!string.IsNullOrEmpty(dt.Rows[i]["机票状态"].ToString()) && dt.Rows[i]["机票状态"].ToString() == "改签") { dt.Rows[i]["退废改手续费"] = "0"; dt.Rows[i]["公司应收"] = "0"; dt.Rows[i]["公司实收"] = "0"; } } else { orderid = dt.Rows[i]["订单号"].ToString(); } dfCountPrice += decimal.Parse(dt.Rows[i]["代付金额"].ToString()); cjPrice += decimal.Parse(dt.Rows[i]["差价"].ToString()); tfqPrice += decimal.Parse(dt.Rows[i]["退废改手续费"].ToString()); PayMoney += decimal.Parse(dt.Rows[i]["公司应收"].ToString()); RealPayMoney += decimal.Parse(dt.Rows[i]["公司实收"].ToString()); } dt.Rows[dt.Rows.Count - 1]["代付金额"] = dfCountPrice; dt.Rows[dt.Rows.Count - 1]["差价"] = cjPrice; dt.Rows[dt.Rows.Count - 1]["退废改手续费"] = tfqPrice; dt.Rows[dt.Rows.Count - 1]["公司应收"] = PayMoney; dt.Rows[dt.Rows.Count - 1]["公司实收"] = RealPayMoney; //根据勾选显示 bool result = false; for (int i = 0; i < cblist.Items.Count; i++) { if (cblist.Items[i].Selected == true) { result = true; break; } } if (result == true) { for (int i = 0; i < cblist.Items.Count; i++) { if (cblist.Items[i].Selected == true) { } else { dt.Columns.Remove(cblist.Items[i].Value); //隐藏 } } } else { if (dt.Columns[32].ColumnName == "差价") { dt.Columns[32].ColumnName = "利润(差价)"; } } } else { string qx = ViewState["qx"].ToString(); if (!qx.Contains("|9|")) { if (dt.Columns[2].ColumnName == "政策来源") { dt.Columns.Remove("政策来源"); } } } } lal3.Visible = true; } #endregion //Response.Clear(); //DownloadExcelFlag = true; //ViewState["type"] = "3"; //Export("机票明细报表_" + DateTime.Now.ToString("yyyy_MM_dd_hh_mm_ss")); ExcelRender.RenderToExcel(dt, Context, "机票明细报表_" + DateTime.Now.ToString("yyyy_MM_dd_hh_mm_ss") + ".xls"); }
/// <summary> /// 查询数据绑定 /// </summary> private void PageDataBind() { DataBase.Data.HashObject Hparams = new DataBase.Data.HashObject(); Hparams.Add("CONDITION", Query()); if (mCompany.RoleType != 4 && mCompany.RoleType != 5)//分销不用显示汇总和统计 { try { #region 1.机票信息汇总 //1.机票信息汇总 DataTable[] dsTicketInfoCollect = base.baseDataManage.MulExecProc(ViewState["pro1"].ToString(), Hparams); int countTicketDetail = 0; if (dsTicketInfoCollect != null && dsTicketInfoCollect.Length > 0) { countTicketDetail = dsTicketInfoCollect[0].Rows.Count; } if (countTicketDetail > 1) { lbtnDc1.Visible = true; } lal1.Visible = true; gvTicketInfoCollect.DataSource = dsTicketInfoCollect[0]; gvTicketInfoCollect.DataBind(); DataTable dt = dsTicketInfoCollect[0]; DataRow drnul = dt.NewRow(); for (int i = 0; i < 50; i++) { dt.Rows.Add(drnul[1]); } gvTicketInfoCollectNew.DataSource = dt; gvTicketInfoCollectNew.DataBind(); #endregion } catch (Exception ex1) { gvTicketInfoCollect.DataSource = null; gvTicketInfoCollect.DataBind(); } try { #region 2.机票销售统计 //2.机票销售统计 //string sql2 = "exec dbo.pro_TicketSalesCollect '" + Query() + "'"; DataTable[] dsTicketSellCount = base.baseDataManage.MulExecProc(ViewState["pro2"].ToString(), Hparams); int countTicketSellCount = 0; if (mCompany.RoleType == 4 || mCompany.RoleType == 5) { dsTicketSellCount[0].Columns.Remove("出票地"); } if (dsTicketSellCount != null && dsTicketSellCount.Length > 0) { countTicketSellCount = dsTicketSellCount[0].Rows.Count; if (dsTicketSellCount.Length > 1) { ViewState["dt"] = dsTicketSellCount[1]; #region 用于下载报表 DataTable dtNewS = dsTicketSellCount[0].Clone(); DataView dvb2b = dsTicketSellCount[1].DefaultView; dvb2b.RowFilter = "出票地='本地B2B'"; DataTable dtb2b = dvb2b.ToTable(); dtb2b.Columns.Remove("出票地"); dtb2b.Columns[0].ColumnName = "出票地"; DataView dvbsp = dsTicketSellCount[1].DefaultView; dvbsp.RowFilter = "出票地='本地BSP'"; DataTable dtbsp = dvbsp.ToTable(); dtbsp.Columns.Remove("出票地"); dtbsp.Columns[0].ColumnName = "出票地"; DataView dv517 = dsTicketSellCount[1].DefaultView; dv517.RowFilter = "出票地='517'"; DataTable dt517 = dv517.ToTable(); dt517.Columns.Remove("出票地"); dt517.Columns[0].ColumnName = "出票地"; DataView dv51book = dsTicketSellCount[1].DefaultView; dv51book.RowFilter = "出票地='51book'"; DataTable dt51book = dv51book.ToTable(); dt51book.Columns.Remove("出票地"); dt51book.Columns[0].ColumnName = "出票地"; DataView dvbt = dsTicketSellCount[1].DefaultView; dvbt.RowFilter = "出票地='百拓'"; DataTable dtbt = dvbt.ToTable(); dtbt.Columns.Remove("出票地"); dtbt.Columns[0].ColumnName = "出票地"; DataView dvpm = dsTicketSellCount[1].DefaultView; dvpm.RowFilter = "出票地='票盟'"; DataTable dtpm = dvpm.ToTable(); dtpm.Columns.Remove("出票地"); dtpm.Columns[0].ColumnName = "出票地"; DataView dvjr = dsTicketSellCount[1].DefaultView; dvjr.RowFilter = "出票地='今日'"; DataTable dtjr = dvjr.ToTable(); dtjr.Columns.Remove("出票地"); dtjr.Columns[0].ColumnName = "出票地"; DataView dvgx = dsTicketSellCount[1].DefaultView; dvgx.RowFilter = "出票地='共享'"; DataTable dtgx = dvgx.ToTable(); dtgx.Columns.Remove("出票地"); dtgx.Columns[0].ColumnName = "出票地"; DataView dv8qy = dsTicketSellCount[1].DefaultView; dv8qy.RowFilter = "出票地='8000翼'"; DataTable dt8qy = dv8qy.ToTable(); dt8qy.Columns.Remove("出票地"); dt8qy.Columns[0].ColumnName = "出票地"; DataView dv4k = dsTicketSellCount[1].DefaultView; dv4k.RowFilter = "出票地='4K商旅'"; DataTable dt4k = dv4k.ToTable(); dt4k.Columns.Remove("出票地"); dt4k.Columns[0].ColumnName = "出票地"; string type = ""; for (int i = 0; i < countTicketSellCount; i++) { type = dsTicketSellCount[0].Rows[i][0].ToString(); dtNewS.ImportRow(dsTicketSellCount[0].Rows[i]); if (type == "本地B2B") { for (int j = 0; j < dtb2b.Rows.Count; j++) { dtNewS.ImportRow(dtb2b.Rows[j]); } } else if (type == "本地BSP") { for (int j = 0; j < dtbsp.Rows.Count; j++) { dtNewS.ImportRow(dtbsp.Rows[j]); } } else if (type == "517") { for (int j = 0; j < dt517.Rows.Count; j++) { dtNewS.ImportRow(dt517.Rows[j]); } } else if (type == "51book") { for (int j = 0; j < dt51book.Rows.Count; j++) { dtNewS.ImportRow(dt51book.Rows[j]); } } else if (type == "百拓") { for (int j = 0; j < dtbt.Rows.Count; j++) { dtNewS.ImportRow(dtbt.Rows[j]); } } else if (type == "票盟") { for (int j = 0; j < dtpm.Rows.Count; j++) { dtNewS.ImportRow(dtpm.Rows[j]); } } else if (type == "今日") { for (int j = 0; j < dtjr.Rows.Count; j++) { dtNewS.ImportRow(dtjr.Rows[j]); } } else if (type == "共享") { for (int j = 0; j < dtgx.Rows.Count; j++) { dtNewS.ImportRow(dtgx.Rows[j]); } } else if (type == "8000翼") { for (int j = 0; j < dt8qy.Rows.Count; j++) { dtNewS.ImportRow(dt8qy.Rows[j]); } } else if (type == "4K商旅") { for (int j = 0; j < dt4k.Rows.Count; j++) { dtNewS.ImportRow(dt4k.Rows[j]); } } } DataRow drnul = dtNewS.NewRow(); for (int i = 0; i < 50; i++) { dtNewS.Rows.Add(drnul[1]); } gvTicketSellCountNew.DataSource = dtNewS; gvTicketSellCountNew.DataBind(); for (int i = 0; i < dtNewS.Rows.Count; i++) { string titles = dtNewS.Rows[i][0].ToString(); if (titles == "本地B2B" || titles == "本地BSP" || titles == "517" || titles == "51book" || titles == "百拓" || titles == "票盟" || titles == "今日" || titles == "共享" || titles == "8000翼" || titles == "4K商旅") { gvTicketSellCountNew.Rows[i].Attributes.Add("Style", "color:Red"); } } gvTicketSellCountNew.Rows[gvTicketSellCountNew.Rows.Count - 1].Attributes.Add("Style", "color:Red"); #endregion } } if (countTicketSellCount > 1) { lbtnDc2.Visible = true; } lal2.Visible = true; gvTicketSellCount.DataSource = dsTicketSellCount[0]; gvTicketSellCount.DataBind(); //设置 行 的颜色 (最后一行 合计显示红色) if (gvTicketSellCount.Rows.Count > 1) { gvTicketSellCount.Rows[gvTicketSellCount.Rows.Count - 1].Attributes.Add("class", "tds"); } #endregion } catch (Exception ex2) { gvTicketSellCount.DataSource = null; gvTicketSellCount.DataBind(); } } try { #region 3.机票信息明细 绑定 bool type = cbType.Checked == true ? true : false; string showdf = cbshowdf.Checked == true ? "1" : "0"; Hparams.Add("TYPE", type); Hparams.Add("PAGE_COUNT", Curr); Hparams.Add("SHOWROW", AspNetPager1.PageSize); Hparams.Add("Export", false); Hparams.Add("ShowOutPay", showdf); if (mCompany.RoleType != 4 && mCompany.RoleType != 5)//分销报表无此参数 { Hparams.Add("LoginCpyNo", mCompany.UninCode); } DataTable[] dsTicketDetail = base.baseDataManage.MulExecProc(ViewState["pro3"].ToString(), Hparams); int countTicketDetail = 0; DataTable dt = new DataTable(); DataTable dtNew = new DataTable(); if (dsTicketDetail != null && dsTicketDetail.Length > 0) { countTicketDetail = dsTicketDetail[1].Rows.Count; dt = dsTicketDetail[1]; if (mCompany.RoleType != 4 && mCompany.RoleType != 5)//运营 { string orderid = ""; decimal dfCountPrice = 0; decimal cjPrice = 0; decimal tfqPrice = 0; decimal PayMoney = 0, RealPayMoney = 0; for (int i = 0; i < dt.Rows.Count - 1; i++) { if (dt.Rows[i]["订单号"].ToString() == orderid) { dt.Rows[i]["代付金额"] = "0"; dt.Rows[i]["差价"] = "0"; if (!string.IsNullOrEmpty(dt.Rows[i]["机票状态"].ToString()) && dt.Rows[i]["机票状态"].ToString() == "改签") { dt.Rows[i]["退废改手续费"] = "0"; dt.Rows[i]["公司应收"] = "0"; dt.Rows[i]["公司实收"] = "0"; } } else { orderid = dt.Rows[i]["订单号"].ToString(); } dfCountPrice += decimal.Parse(dt.Rows[i]["代付金额"].ToString()); cjPrice += decimal.Parse(dt.Rows[i]["差价"].ToString()); tfqPrice += decimal.Parse(dt.Rows[i]["退废改手续费"].ToString()); PayMoney += decimal.Parse(dt.Rows[i]["公司应收"].ToString()); RealPayMoney += decimal.Parse(dt.Rows[i]["公司实收"].ToString()); } dt.Rows[dt.Rows.Count - 1]["代付金额"] = dfCountPrice; dt.Rows[dt.Rows.Count - 1]["差价"] = cjPrice; dt.Rows[dt.Rows.Count - 1]["退废改手续费"] = tfqPrice; dt.Rows[dt.Rows.Count - 1]["公司应收"] = PayMoney; dt.Rows[dt.Rows.Count - 1]["公司实收"] = RealPayMoney; } else { string qx = ViewState["qx"].ToString(); if (!qx.Contains("|9|")) { if (dt.Columns[2].ColumnName == "政策来源") { dt.Columns.Remove("政策来源"); } } } if (countTicketDetail > 1) { lbtnDc3.Visible = true; } lal3.Visible = true; //根据勾选显示 bool result = false; for (int i = 0; i < cblist.Items.Count; i++) { if (cblist.Items[i].Selected == true) { result = true; break; } } if (result == true) { for (int i = 0; i < cblist.Items.Count; i++) { if (cblist.Items[i].Selected == true) { } else { dt.Columns.Remove(cblist.Items[i].Value); //隐藏 } } } dtNew = dt.Copy(); AspNetPager1.RecordCount = Convert.ToInt32(dsTicketDetail[0].Rows[0]["总行数"].ToString()); AspNetPager1.CustomInfoHTML = " 页码 : <font color=\"red\" size='2px'>" + Curr + "</font> / " + AspNetPager1.PageCount; gvTicketDetail.DataSource = dt; } else { gvTicketDetail.DataSource = null; } gvTicketDetail.DataBind(); #endregion } catch (Exception ex3) { gvTicketDetail.DataSource = null; gvTicketDetail.DataBind(); } }