Beispiel #1
0
        private void BindData()
        {
            DataTable dt = SPDayReportWrapper.GetDayCountReportForMaster((DateTime)dfReportStartDate.DateField.Value, (DateTime)dfReportEndDate.DateField.Value);

            if (dt.Columns["SPClientGroupName"] == null)
            {
                dt.Columns.Add("SPClientGroupName");
            }

            foreach (DataRow dataRow in dt.Rows)
            {
                if (dataRow["ClientID"] == System.DBNull.Value || dataRow["ClientID"].Equals(0))
                {
                    dataRow["SPClientGroupName"] = "";
                }
                else
                {
                    SPClientWrapper clientWrapper = SPClientWrapper.FindById((int)dataRow["ClientID"]);

                    if (clientWrapper != null)
                    {
                        dataRow["SPClientGroupName"] = clientWrapper.ClientGroupName;
                    }
                    else
                    {
                        dataRow["SPClientGroupName"] = "";
                    }
                }
            }


            this.Store1.DataSource = dt;
            this.Store1.DataBind();
        }
        private void BindData()
        {
            //DataTable dt = SPDayReportWrapper.GetDayliyReport(Convert.ToDateTime(dfReportDate.DateField.Value));

            DataTable dt = SPDayReportWrapper.GetDayCountReportForMaster((DateTime)dfReportDate.DateField.Value, (DateTime)dfReportDate.DateField.Value);

            if (dt.Columns["SPClientGroupName"] == null)
            {
                dt.Columns.Add("SPClientGroupName");
            }

            foreach (DataRow dataRow in dt.Rows)
            {
                if (dataRow["ClientID"] == System.DBNull.Value || dataRow["ClientID"].Equals(0))
                {
                    dataRow["SPClientGroupName"] = "";
                }
                else
                {
                    SPClientWrapper clientWrapper = SPClientWrapper.FindById((int)dataRow["ClientID"]);

                    if (clientWrapper != null)
                    {
                        dataRow["SPClientGroupName"] = clientWrapper.ClientGroupName;
                    }
                    else
                    {
                        dataRow["SPClientGroupName"] = "";
                    }
                }
            }


            this.Store1.DataSource = dt;
            this.Store1.DataBind();


            this.Store1.DataSource = dt;
            this.Store1.DataBind();
            this.txtTotalCount.Text     = string.Format("总点播数(条):{0}", GetSumField(dt, "TotalCount"));
            this.txtInterceptCount.Text = string.Format("总扣量数(条):{0}", GetSumField(dt, "InterceptCount"));
            this.txtDownCount.Text      = string.Format("总转发下家数(条):{0}", GetSumField(dt, "DownCount"));
            this.txtDownSycnCount.Text  = string.Format("总同步下家数(条):{0}", GetSumField(dt, "DownSycnCount"));
        }