예제 #1
0
		/// <summary>
		/// 设置图表的曲线颜色
		/// </summary>
		public static void SetChartColor(Infragistics.WebUI.UltraWebChart.UltraChart UltraChart1, string Source)
		{
			try 
			{
				//				Infragistics.UltraChart.Resources.Appearance.PaintElement pe = new Infragistics.UltraChart.Resources.Appearance.PaintElement();
				//				this.UltraChart1.ColorModel.Skin.PEs.Add(pe);

				string[] arrSource = Source.Split(",".ToCharArray());
				UltraChart1.ColorModel.Skin.PEs.Clear();

				foreach(string val in arrSource) 
				{
					Infragistics.UltraChart.Resources.Appearance.PaintElement pe = new Infragistics.UltraChart.Resources.Appearance.PaintElement();

					BLL.CashFlowSource source = BLL.CashFlowRule.GetCashFlowSourceById(val);
					if (source != null)
					{
							pe.Fill = source.Color;
					}

					UltraChart1.ColorModel.Skin.PEs.Add( pe);
				}
			}
			catch(Exception ex) 
			{
				throw ex;
			}
		}
예제 #2
0
        /*
         * public static DataTable GenerateRtpFinI(string ProjectCode)
         * {
         *      try
         *      {
         *              DataTable tb = BLL.SalBudgetRule.GetSalPBSType(false);
         *
         *              tb.Columns.Add("PBSTypeNameHtml");
         *
         *              foreach(DataRow dr in tb.Rows)
         *              {
         *                      int Deep = BLL.ConvertRule.ToInt(dr["Deep"]);
         *                      string PBSTypeName = BLL.ConvertRule.ToString(dr["PBSTypeName"]);
         *
         *                      string space = "";
         *                      for(int i=1;i<Deep;i++)
         *                      {
         *                              space = space + "&nbsp;&nbsp;&nbsp;";
         *                      }
         *
         *                      dr["PBSTypeNameHtml"] = space + PBSTypeName;
         *              }
         *
         *              return tb;
         *      }
         *      catch(Exception ex)
         *      {
         *              throw ex;
         *      }
         * }
         */

        /*
         * public static DataTable GenerateRtpFinIO(string ProjectCode)
         * {
         *      try
         *      {
         *              //取数据
         *              QueryAgent qa = new Rms.ORMap.QueryAgent();
         *              try
         *              {
         *                      string sql = string.Format("select * from cbs where ProjectCode = '{0}' order by FullCode", ProjectCode);
         *                      DataSet ds = qa.ExecSqlForDataSet(sql);
         *                      DataTable tb = ds.Tables[0];
         *
         *                      tb.Columns.Add("CostNameHtml");
         *
         *                      foreach(DataRow dr in tb.Rows)
         *                      {
         *                              int Deep = BLL.ConvertRule.ToInt(dr["Deep"]);
         *                              string CostName = BLL.ConvertRule.ToString(dr["CostName"]);
         *
         *                              string space = "";
         *                              for(int i=1;i<Deep;i++)
         *                              {
         *                                      space = space + "&nbsp;&nbsp;&nbsp;";
         *                              }
         *
         *                              dr["CostNameHtml"] = space + CostName;
         *                      }
         *
         *                      return tb;
         *              }
         *              finally
         *              {
         *                      qa.Dispose();
         *              }
         *      }
         *      catch(Exception ex)
         *      {
         *              throw ex;
         *      }
         * }
         */

        private void LoadGrid()
        {
            try
            {
                string ProjectCode = this.txtProjectCode.Value;
                string Source      = BLL.ConvertRule.ToString(Request.QueryString["Source"]);
                string MonthType   = BLL.ConvertRule.ToString(Request.QueryString["MonthType"]);

                BLL.CashFlowSource source     = BLL.CashFlowRule.GetCashFlowSourceById(Source);
                string             SourceDesc = (source != null)?source.Desc:"";
                this.lblSourceName.Text = SourceDesc;

                int StartY = BLL.ConvertRule.ToInt(this.ucCostBudgetSelectMonth.MonthStart);
                int EndY   = BLL.ConvertRule.ToInt(this.ucCostBudgetSelectMonth.MonthEnd);

                //标题
                this.lblMonthTypeName.Text = BLL.CashFlowRule.GetMonthTypeName(MonthType);

                //年度展开
                string html_title1 = "";
                string html_title2 = "";
                int    MonthCount  = 0;
                BLL.CashFlowRule.GenerateYearTitleHtml(MonthType, StartY, EndY, ref html_title1, ref html_title2, ref MonthCount);

                ViewState["html_title1"] = html_title1;
                ViewState["html_title2"] = html_title2;
                ViewState["MonthCount"]  = MonthCount;

                //生成现金流表
                DataSet ds = BLL.CashFlowRule.GenerateCashFlowList(ProjectCode, StartY, EndY, MonthType, Source);

                //流入
                DataTable tbI = ds.Tables["CashFlowI"];

                tbI.Columns.Add("PBSTypeNameHtml");

                foreach (DataRow dr in tbI.Rows)
                {
                    int    Deep        = BLL.ConvertRule.ToInt(dr["Deep"]);
                    string PBSTypeName = BLL.ConvertRule.ToString(dr["PBSTypeName"]);

                    string space = "";
                    for (int i = 1; i < Deep; i++)
                    {
                        space = space + "&nbsp;&nbsp;&nbsp;";
                    }

                    dr["PBSTypeNameHtml"] = space + PBSTypeName;
                }

                DataView dvI = new DataView(tbI, "Deep > 0", "PBSTypeFullID", DataViewRowState.CurrentRows);
                this.dgListI.DataSource = dvI;
                this.dgListI.DataBind();

                DataView dvITotal = new DataView(tbI, "Deep = 0", "PBSTypeFullID", DataViewRowState.CurrentRows);
                this.dgListITotal.DataSource = dvITotal;
                this.dgListITotal.DataBind();

                //流出
                DataTable tbO = ds.Tables["CashFlowO"];

                tbO.Columns.Add("CostNameHtml");

                foreach (DataRow dr in tbO.Rows)
                {
                    int    Deep     = BLL.ConvertRule.ToInt(dr["Deep"]);
                    string CostName = BLL.ConvertRule.ToString(dr["CostName"]);

                    string space = "";
                    for (int i = 1; i < Deep; i++)
                    {
                        space = space + "&nbsp;&nbsp;&nbsp;";
                    }

                    dr["CostNameHtml"] = space + CostName;
                }

                DataView dvO = new DataView(tbO, "Deep > 0", "CostFullID", DataViewRowState.CurrentRows);
                this.dgListO.DataSource = dvO;
                this.dgListO.DataBind();

                DataView dvOTotal = new DataView(tbO, "Deep = 0", "CostFullID", DataViewRowState.CurrentRows);
                this.dgListOTotal.DataSource = dvOTotal;
                this.dgListOTotal.DataBind();

                //总计
                DataTable tbTotal = ds.Tables["CashFlowTotal"];
                this.dgListTotal.DataSource = tbTotal;
                this.dgListTotal.DataBind();
            }
            catch (Exception ex)
            {
                ApplicationLog.WriteLog(this.ToString(), ex, "");
                Response.Write(Rms.Web.JavaScript.Alert(true, "显示报表出错:" + ex.Message));
            }
        }
예제 #3
0
        private void LoadGrid()
        {
            try
            {
                Source    = this.sltSource.Value;
                MonthType = this.sltMonthType.Value;

                //Source = BLL.ConvertRule.ToString(Request.QueryString["Source"]);
                //MonthType = BLL.ConvertRule.ToString(Request.QueryString["MonthType"]);

                //项目
                ProjectCodes = this.ucSelectProjectMulti.Value;
                if (ProjectCodes == "")
                {
                    foreach (DataRow dr in user.m_EntityDataAccessProject.CurrentTable.Rows)
                    {
                        ProjectCodes += BLL.ConvertRule.ToString(dr["ProjectCode"]) + ",";
                    }

                    if (ProjectCodes.Length > 0)
                    {
                        ProjectCodes = ProjectCodes.Substring(0, ProjectCodes.Length - 1);
                    }
                }

//                Response.Write(Rms.Web.JavaScript.Alert(true, "user:"******"," + user.m_EntityDataAccessProject.CurrentTable.Rows.Count.ToString()));

                BLL.CashFlowSource source     = BLL.CashFlowRule.GetCashFlowSourceById(Source);
                string             SourceDesc = (source != null)?source.Desc:"";
                this.lblSourceName.Text = SourceDesc;

                BeginYm = this.ucCostBudgetSelectMonth.MonthStart.Replace("-", "");
                EndYm   = this.ucCostBudgetSelectMonth.MonthEnd.Replace("-", "");

                BeginY = BLL.ConvertRule.ToInt(BeginYm.Substring(0, 4));
                EndY   = BLL.ConvertRule.ToInt(EndYm.Substring(0, 4));

                //年度展开
                string html_title1 = "";
                string html_title2 = "";
                int    MonthCount  = 0;
                GenerateYearTitleHtml(ref html_title1, ref html_title2, ref MonthCount);

                ViewState["html_title1"] = html_title1;
                ViewState["html_title2"] = html_title2;
                ViewState["MonthCount"]  = MonthCount;

                //生成现金流表
                GenerateCashFlow();

                DataView dvDtl = new DataView(tbHtml, "Type = ''", "ProjectName", DataViewRowState.CurrentRows);
                this.dgList.DataSource = dvDtl;
                this.dgList.DataBind();

                //总计
                DataView dvSum = new DataView(tbHtml, "Type = 'SUM'", "ProjectName", DataViewRowState.CurrentRows);
                this.dgListTotal.DataSource = dvSum;
                this.dgListTotal.DataBind();
            }
            catch (Exception ex)
            {
                ApplicationLog.WriteLog(this.ToString(), ex, "");
                Response.Write(Rms.Web.JavaScript.Alert(true, "显示报表出错:" + ex.Message));
            }
        }