/// <summary> /// 打印初使化 /// </summary> private void PrintInit() { SelectInit(); IList <EyouSoft.Model.StatisticStructure.EarningsAreaStatistic> list = null; list = esBll.GetEarningsAreaStatistic(qesModel); len = list == null ? 0 : list.Count; this.rptList.DataSource = list; this.rptList.DataBind(); }
private void InitProAreaStaticlist() { #region 获取参数 PageIndex = Utils.GetInt(Utils.GetQueryStringValue("Page"), 1); LeaveStartDate = Utils.GetDateTimeNullable(Utils.GetQueryStringValue("LeaveStartDate"), new DateTime(DateTime.Now.Year, 1, 1)); LeaveEndDate = Utils.GetDateTimeNullable(Utils.GetQueryStringValue("LeaveEndDate"), new DateTime(DateTime.Now.Year, 12, 31)); CheckStartTime = Utils.GetDateTimeNullable(Utils.GetQueryStringValue("CheckStartDate")); CheckEndTime = Utils.GetDateTimeNullable(Utils.GetQueryStringValue("CheckEndDate")); TourType = Utils.GetInt(Utils.GetQueryStringValue("TourType"), -1); DeptIds = Utils.GetQueryStringValue("deptids"); OperatorIds = Utils.GetQueryStringValue("operatorids"); #endregion #region 实体赋值 EyouSoft.BLL.StatisticStructure.EarningsStatistic EarningBll = new EyouSoft.BLL.StatisticStructure.EarningsStatistic(this.SiteUserInfo); EyouSoft.Model.StatisticStructure.QueryEarningsStatistic model = new EyouSoft.Model.StatisticStructure.QueryEarningsStatistic(); model.OrderIndex = 0; model.LeaveDateStart = LeaveStartDate; model.LeaveDateEnd = LeaveEndDate; model.CheckDateStart = CheckStartTime; model.CheckDateEnd = CheckEndTime; model.CompanyId = this.SiteUserInfo.CompanyID; //设置查询model的ComputeOrderType值 EyouSoft.Model.EnumType.CompanyStructure.ComputeOrderType?computerOrderType = new EyouSoft.BLL.CompanyStructure.CompanySetting().GetComputeOrderType(SiteUserInfo.CompanyID); if (computerOrderType.HasValue) { model.ComputeOrderType = computerOrderType.Value; } TourTypeList1.TourType = TourType; if (TourType != -1) { model.TourType = (EyouSoft.Model.EnumType.TourStructure.TourType)TourType; } model.DepartIds = Utils.GetIntArray(DeptIds, ","); model.SaleIds = Utils.GetIntArray(OperatorIds, ","); #endregion #region 初始化表单元素 this.txtCheckStartDate.Value = CheckStartTime.HasValue ? CheckStartTime.Value.ToString("yyyy-MM-dd") : "";; this.txtCheckEndDate.Value = CheckEndTime.HasValue ? CheckEndTime.Value.ToString("yyyy-MM-dd") : ""; this.txtLeaveStartDate.Value = LeaveStartDate.HasValue ? LeaveStartDate.Value.ToString("yyyy-MM-dd") : ""; this.txtLeaveEndDate.Value = LeaveEndDate.HasValue ? LeaveEndDate.Value.ToString("yyyy-MM-dd") : ""; UCSelectDepartment1.GetDepartmentName = Utils.GetQueryStringValue("deptnames"); UCSelectDepartment1.GetDepartId = DeptIds; SelectOperator.OperName = Utils.GetQueryStringValue("operatornames"); SelectOperator.OperId = OperatorIds; #endregion IList <EyouSoft.Model.StatisticStructure.EarningsAreaStatistic> statisticList = new List <EyouSoft.Model.StatisticStructure.EarningsAreaStatistic>(); statisticList = EarningBll.GetEarningsAreaStatistic(model); #region 统计 by 田想兵 3.9 int teamNum = 0; decimal inMoney = 0; decimal outMoney = 0; decimal teamGross = 0; decimal pepoleGross = 0; decimal profitallot = 0; decimal comProfit = 0; int peopleNum = 0; int propleSum = 0; foreach (var v in statisticList) { peopleNum += v.TourPeopleNum; teamNum += v.TourNum; inMoney += v.GrossIncome; outMoney += v.GrossOut; teamGross += v.TourGross; //pepoleGross += v.PeopleGross; profitallot += v.TourShare; comProfit += v.CompanyShare; propleSum += v.TourPeopleNum; } if (peopleNum == 0) { pepoleGross = 0; } else { pepoleGross = teamGross / peopleNum; } lt_teamNum.Text = teamNum.ToString(); lt_InMoney.Text = inMoney.ToString("###,##0.00"); lt_outMoney.Text = outMoney.ToString("###,##0.00"); lt_teamgross_profit.Text = teamGross.ToString("###,##0.00"); lt_pepolegross_profit.Text = pepoleGross.ToString("###,##0.00"); lt_profitallot.Text = profitallot.ToString("###,##0.00"); lt_comProfit.Text = comProfit.ToString("###,##0.00"); lt_peopleSum.Text = propleSum.ToString(); if (inMoney != 0) { lt_lirunlv.Text = (Convert.ToDouble(comProfit) / Convert.ToDouble(inMoney)).ToString("0.00%"); } else { lt_lirunlv.Text = "0.00%"; } #endregion list = EyouSoft.Common.Function.SelfExportPage.GetList <EyouSoft.Model.StatisticStructure.EarningsAreaStatistic>(PageIndex, PageSize, out RecordCount, statisticList); if (Utils.GetInt(Utils.GetQueryStringValue("IsCartogram"), 0) > 0) //标识为统计图异步请求 { return; } if (list != null && list.Count != 0) { this.tbl_ExportPage.Visible = true; this.crp_GetProAreaList.DataSource = list; this.crp_GetProAreaList.DataBind(); BindPage();//绑定分页 } else { this.tbl_ExportPage.Visible = false; this.crp_GetProAreaList.EmptyText = "<tr><td id=\"EmptyData\" colspan='9' bgcolor='#e3f1fc' height='50px' align='center'>暂时没有数据!</td></tr>"; } RegisterScript(string.Format("var recordCount={0};", RecordCount)); model = null; EarningBll = null; }