Beispiel #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            RepNews.DataSource = BindNews("CPS新闻公告");
            RepNews.DataBind();
            RepZhi.DataSource = BindNews("CPS推广指南");
            RepZhi.DataBind();
            BindUsers();
            if (_User != null)
            {
                lbUserName.Text = "<strong>" + _User.Name + "</strong>";

                if (_User.Competences.CompetencesList != "")
                {
                    lbUserType.Text         = "管理员";
                    trSupperManager.Visible = true;
                }
                else
                {
                    if (_User.cps.ID > 0)
                    {
                        trCpsLogin.Visible = true;

                        if (_User.cps.Type == 2)
                        {
                            lbUserType.Text = "代理商";
                        }
                    }
                    else
                    {
                        lbUserType.Text = "高级会员";

                        if (new DAL.Tables.T_CpsTrys().GetCount("HandleResult = 0 and UserID=" + _User.ID.ToString()) > 0)
                        {
                            trCheck.Visible = true;
                            lbUserType.Text = "代理商";
                        }
                        else
                        {
                            trApply.Visible = true;
                        }
                    }
                }

                NoLogin.Visible   = false;
                Longining.Visible = true;
            }
            HttpCookie cookie = System.Web.HttpContext.Current.Request.Cookies["cookTBUSERNAME"];
            if (cookie != null && !cookie.Value.ToString().Equals(""))
            {
                tbUserName.Value = cookie.Value.ToString();
            }
        }
    }
 protected void BindNewsHeading()
 {
     try
     {
         DataSet theDataSet = OnlineMFSchemeDetailsBo.GetAPIData(ConfigurationSettings.AppSettings["NEWS_HEADING"] + ConfigurationSettings.AppSettings["NEWS_DETAICOUNTS"]);
         RepNews.DataSource = theDataSet.Tables[1];
         RepNews.DataBind();
     }
     catch (BaseApplicationException Ex)
     {
         throw Ex;
     }
     catch (Exception Ex)
     {
         BaseApplicationException exBase       = new BaseApplicationException(Ex.Message, Ex);
         NameValueCollection      FunctionInfo = new NameValueCollection();
         FunctionInfo.Add("Method", "OnlineMFSchemeDetailsDao.cs:BindNewsHeading()");
         object[] objects = new object[0];
         FunctionInfo = exBase.AddObject(FunctionInfo, objects);
         exBase.AdditionalInformation = FunctionInfo;
         ExceptionManager.Publish(exBase);
         throw exBase;
     }
 }