Пример #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            ((SiteEnterpriseMaster)Master).InitMenu();
            ((SiteEnterpriseMaster)Master).li1.Attributes.Add("class", "hover ccc");
            ((SiteEnterpriseMaster)Master).b_hmenu1.Style.Clear();
            ((SiteEnterpriseMaster)Master).b_hmenu2.Style.Add("display", "none");
            ((SiteEnterpriseMaster)Master).b_hmenu3.Style.Add("display", "none");
            ((SiteEnterpriseMaster)Master).b_hmenu4.Style.Add("display", "none");
            ((SiteEnterpriseMaster)Master).s_menu1_1.Style.Add("COLOR", "#147ab8");
            ((SiteEnterpriseMaster)Master).s_menu1_1.Style.Add("TEXT-DECORATION", "none");

            if (Session["username"] == null)
            {
                Page.ClientScript.RegisterStartupScript(this.GetType(), "PopupScript", "<script>alert('请先登录系统!');top.location.href='../Enterprise/EnterpriseLogin.aspx';</script>");
                return;
            }
            else
            {
                if (!IsPostBack)
                {
                    if (Request["actid"] != null)
                    {
                        m_actid = Request["actid"].ToString();

                        ActivityBLL activityBll = new ActivityBLL();
                        EnterpriseUserBLL enterpriseUserBll = new EnterpriseUserBLL();
                        string username = Session["username"].ToString();
                        string enterpriseId = enterpriseUserBll.GetEnterpriseIdByUser(username);
                        DataSet dsActivity = activityBll.GetActivityAll(enterpriseId);
                        if (dsActivity != null)
                        {
                            ddlActivity.DataSource = dsActivity.Tables[0].DefaultView;
                            ddlActivity.DataValueField = "activity_id";
                            ddlActivity.DataTextField = "activity_name";
                            ddlActivity.DataBind();
                            ddlActivity.SelectedValue = m_actid;
                        }
                        bind(Int32.Parse(m_actid));
                    }
                }
            }
        }
Пример #2
0
        private void bind()
        {
            if (string.IsNullOrEmpty(Request.QueryString["users_id"]))
            {
                return;
            }

            ActivityBLL temp = new ActivityBLL();

            DataSet ds = temp.GetActivityAll(Request.QueryString["users_id"]);

            if (ds == null) return;

            foreach (DataRow row in ds.Tables[0].Rows)
            {
                string aStatus = row["ACTIVITY_STATUS"].ToString();
                if (aStatus.Equals("开启项目"))
                {
                    row["ACTIVITY_STATUS"] = "已停止";
                }
                else if (aStatus.Equals("停止项目"))
                {
                    row["ACTIVITY_STATUS"] = "测试中";
                }
                else
                {
                }
            }

            grVActivityManage.DataSource = ds.Tables[0].DefaultView;
            grVActivityManage.DataSourceID = null;
            grVActivityManage.DataBind();
            temp = null;
        }