Esempio n. 1
0
        private void LoadAttention()
        {
            AttentionStrategyBuilder asb = new AttentionStrategyBuilder();
            ArrayList arA = new ArrayList();

            arA.Add("070110");
            arA.Add(user.UserCode);
            arA.Add(user.BuildStationCodes());
            asb.AddStrategy(new Strategy(DAL.QueryStrategy.AttentionStrategyName.AccessRange, arA));
            asb.AddOrder(" AddTime ", false);
            string     sql = asb.BuildMainQueryString();
            QueryAgent qa  = new QueryAgent();

            qa.SetTopNumber(this.intListAttentionNum);
            EntityData entityAttention = qa.FillEntityData("TaskAttention", sql);

            qa.Dispose();
            rpAttention.DataSource = entityAttention;
            //			EntityData entityAttention = WBSDAO.GetAllTaskAttention();
            if (entityAttention.HasRecord())
            {
                //点更多时,查看第1条所在项目
                this.imgOpenMoreWBSAttention.Attributes["ProjectCode"] = entityAttention.CurrentTable.Rows[0]["ProjectCode"].ToString();

                DataTable dtAttentionNew = entityAttention.CurrentTable;
                dtAttentionNew.Columns.Add("Img", System.Type.GetType("System.String"));
                //				int i = 0;
                //				foreach(DataRow dr in dtAttentionNew.Rows)
                //				{
                //					if(dr["AddModule"].ToString()=="工作信息")
                //					{
                //						EntityData entityTask = WBSDAO.GetTaskByWBSCode(dr["MasterCode"].ToString());
                //						string strImportantLevel = entityTask.GetInt("ImportantLevel").ToString();
                //						if(strImportantLevel=="1")
                //							dr["Img"] =  "<img src=\"images/icon_important.gif\" width=\"17\" height=\"18\">";
                //					}
                //					if(dr["AddModule"].ToString()=="其他信息")
                //					{}
                //
                //					i++;
                //					if(i>this.intListAttentionNum) break;
                //				}
                this.rpAttention.DataSource = dtAttentionNew;
                this.rpAttention.DataBind();
            }
            entityAttention.Dispose();
        }
Esempio n. 2
0
        /// <summary>
        /// 载入数据
        /// </summary>
        private void LoadData()
        {
            User objUser = (User)Session["User"];
            AttentionStrategyBuilder asb = new AttentionStrategyBuilder();
            ArrayList arA = new ArrayList();

            arA.Add("070110");
            arA.Add(objUser.UserCode);
            arA.Add(user.BuildStationCodes());
            asb.AddStrategy(new Strategy(DAL.QueryStrategy.AttentionStrategyName.AccessRange, arA));
            asb.AddStrategy(new Strategy(DAL.QueryStrategy.AttentionStrategyName.ProjectCode, (string)ViewState["ProjectCode"]));
            if (this.txtType.Value.Length > 0)
            {
                asb.AddStrategy(new Strategy(DAL.QueryStrategy.AttentionStrategyName.AddModule, this.txtType.Value));
            }
            if (this.txtTitle.Value.Length > 0)
            {
                asb.AddStrategy(new Strategy(DAL.QueryStrategy.AttentionStrategyName.AddTitle, this.txtTitle.Value));
            }
            if (this.dtStartDate.Value.Length > 0 || this.dtEndDate.Value.Length > 0)
            {
                ArrayList arB = new ArrayList();
                arB.Add(this.dtStartDate.Value);
                arB.Add(this.dtEndDate.Value);
                asb.AddStrategy(new Strategy(DAL.QueryStrategy.AttentionStrategyName.AddTime, arB));
            }
            asb.AddOrder("AddTime", false);
            string     sql = asb.BuildMainQueryString();
            QueryAgent qa  = new QueryAgent();

            entityAttention = qa.FillEntityData("TaskAttention", sql);
            qa.Dispose();
            this.dgAttention.DataSource = entityAttention;
            this.dgAttention.DataBind();
            this.tbNoAttention.Visible = (entityAttention.CurrentTable.Rows.Count > 0)?false:true;
            entityAttention.Dispose();
        }