Beispiel #1
0
    //string isLDAP = ConfigurationManager.AppSettings.Get["isLDAP"].ToString();
    //string ConnString = ConfigurationManager.AppSettings.Get("Connection_String_Eoffice");
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["LoginCount"] == null)
        {
            Session["LoginCount"] = "0";
            capcha_panel.Visible  = false;
        }
        else
        if (Convert.ToInt32(Session["LoginCount"].ToString()) > 3)
        {
            capcha_panel.Visible = true;
        }
        else
        {
            capcha_panel.Visible = false;
        }

        if (!IsPostBack)
        {
            if (m_UserValidation.IsSigned())
            {
                Response.Redirect(ResolveUrl("~/") + "Default.aspx");
            }
        }
    }
Beispiel #2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         BindArea();
         BindDistrict();
         if (memVal.IsSigned())
         {
             Tool.BindYear(ddlYear, "Tất cả", "");
             BindData();
         }
         else
         {
             Response.Redirect(ResolveUrl("~"));
         }
     }
 }
Beispiel #3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            if (m_UserValidation.IsSigned())
            {
                welcomAdmin.Text = "<span class='hidden-sm hidden-xs'>Xin chào, </span>" + m_UserValidation.UserName;
            }

            HttpCookie cookie_lang = Request.Cookies["LangInfo_CMS"];
            if (cookie_lang != null && cookie_lang["Lang"] != null && cookie_lang["Lang"].Trim() != string.Empty)
            {
                if (cookie_lang["Lang"].ToString().Equals("vi-VN"))
                {
                    lang.Text = "<span class='flag-xs flag-vn mr5'></span><span class='hidden-sm hidden-xs'>Tiếng Việt</span>";
                }
                else
                if (cookie_lang["Lang"].ToString().Equals("en-US"))
                {
                    lang.Text = "<span class='flag-xs flag-us mr5'></span><span class='hidden-sm hidden-xs'>English</span>";
                }
            }
        }
    }
Beispiel #4
0
        public ActionResult Header()
        {
            string sUrl = Server.UrlEncode(HttpContext.Request.Url.ToString());

            Session["Redirect_Uri"] = sUrl;
            //Kiểm tra Authen
            var userValidate = new UserValidation();
            var urlLogin     = Config.UrlRoot + "Account/FormLogin";

            if (!userValidate.IsSigned())
            {
                ViewBag.LogIn    = false;
                ViewBag.UrlLogin = urlLogin;
                return(PartialView());
            }
            else
            {
                var IsAdministrator = userValidate.IsAdministrator;
                var functions       = new List <Functions>();
                if (IsAdministrator)
                {
                    functions = AbstractDAOFactory.Instance().CreateFunctionDAO().SelectAllFunctionID(-1, string.Empty, 1, 1);
                }
                else
                {
                    functions = AbstractDAOFactory.Instance().CreateFunctionDAO().GetListFunctionByUserID(userValidate.UserId, -1);
                }

                Session[SessionsManager.SESSION_FUNCTIONS] = functions;

                ViewBag.UserName = userValidate.UserName;
            }
            ViewBag.LogIn    = true;
            ViewBag.UrlLogin = urlLogin;
            return(PartialView());
        }
Beispiel #5
0
    private void ViewNewsGroupDetail(int Id)
    {
        CateNewsGroupBSO cateNewsgroupBSO = new CateNewsGroupBSO();
        NewsGroupBSO     newsgroupBSO     = new NewsGroupBSO();
        NewsGroup        newsgroup        = newsgroupBSO.GetNewsGroupById(Id);

        if (newsgroup == null)
        {
            Response.Redirect("~/Default.aspx");
        }
        commonBSO commonBSO = new commonBSO();
        //Kiem tra neu phan quyen truy cap chuyen muc nay
        DataTable dtCheckRole = commonBSO.CreateDataView("SELECT Id FROM tblRoleCate WHERE CateId=" + newsgroup.CateNewsID);

        if (dtCheckRole != null && dtCheckRole.Rows.Count > 0)
        {
            UserValidation m_UserValidation = new UserValidation();

            if (m_UserValidation.IsSigned())
            {
                DataTable dtGroupRole = new AdminRolesBSO().GetAdminRolesByUserName(m_UserValidation.UserName);
                if (dtGroupRole != null && dtGroupRole.Rows.Count > 0)
                {
                    DataTable dtRoleCate = commonBSO.CreateDataView("SELECT Id FROM tblRoleCate WHERE GroupId IN (SELECT RolesID FROM tblAdminRoles WHERE Admin_UserName = '******') AND CateId=" + newsgroup.CateNewsID);
                    if (dtRoleCate != null && dtRoleCate.Rows.Count > 0)
                    {
                        //Da dang nhap va co quyen xem
                    }
                    else
                    {
                        //Da dang nhap nhung khong co quyen truy cap, chuyen ve trang thong bao;
                        content_notice.Visible = true;
                        content_news.Visible   = false;
                    }
                }
            }
            else
            {
                //Yeu cau dang nhap
                Response.Redirect(ResolveUrl("~") + "Dang-nhap.aspx?RetUrl=" + Request.RawUrl);
            }
        }
        ltlTitle.Text = newsgroup.Title;
        //LabelDate.Text = newsgroup.PostDate.ToString("dd/MM/yyyy");// Convert.ToString(newsgroup.PostDate);
        ltlDescribe.Text     = newsgroup.ShortDescribe;
        FullDescirbe.Text    = newsgroup.FullDescribe;
        LabelAuthor.Text     = newsgroup.Author;
        lblAproved.Text      = newsgroup.PostDate.ToString("dd/MM/yyyy hh:mm");
        txtNewsGroupID.Value = Convert.ToString(newsgroup.NewsGroupID);

        newsgroupBSO.NewsGroupClickUpdate(Id);
        NewsGroupFollow(newsgroup.PostDate, newsgroup.NewsGroupID, newsgroup.CateNewsID);
        NewsGroupRelation(newsgroup.NewsGroupID);
        ;


        //CateNewsBSO catenewsBSO = new CateNewsBSO();
        //CateNews catenews = catenewsBSO.GetCateNewsById(newsgroup.CateNewsID);
        //CateNewsGroup cateNewsGroup = cateNewsgroupBSO.GetCateNewsGroupByGroupCate(catenews.GroupCate, Language.language);

        //title_name.Text = "<a href='" + ResolveUrl("~/") + "c3/" + catenewsBSO.GetSlugByCateId(catenews.CateNewsID) + "/" + GetString(catenews.CateNewsName) + "-" + catenews.GroupCate + "-" + catenews.CateNewsID + ".aspx'>" + catenews.CateNewsName + "</a>";

        //string cate = "<a href='" + ResolveUrl("~/") + "c2/" + cateNewsgroupBSO.GetSlugById(cateNewsGroup.CateNewsGroupID) + "/" + GetString(cateNewsGroup.CateNewsGroupName) + "-" + catenews.GroupCate + ".aspx' class='content_Text_Cat'>";
        //string s1 = "";
        //while (catenews.ParentNewsID != 0)
        //{
        //    int pId = catenews.ParentNewsID;
        //    catenews = catenewsBSO.GetCateNewsById(pId);
        //    s1 = "<img src='" + ResolveUrl("~/") + "images/icon_arrows1.png'><a href='" + ResolveUrl("~/") + "c3/" + catenewsBSO.GetSlugByCateId(catenews.CateNewsID) + "/" + GetString(catenews.CateNewsName) + "-" + catenews.GroupCate + "-" + catenews.CateNewsID + ".aspx' class='content_Text_Cat'>" + catenews.CateNewsName + "</a>" + s1;
        //}

        //cate += cateNewsGroup.CateNewsGroupName.ToString(); //Sửa lại
        //cate += "</a>";
        //cate += s1;
        //title_cate.Text = "<a href='" + ResolveUrl("~/") + "Default.aspx' class='content_Text_Cat'>" + Resources.resource.T_home + "</a><img src='" + ResolveUrl("~/") + "images/icon_arrows1.png'> ";
        //title_cate.Text += cate;

        if (!String.IsNullOrEmpty(Request["error"]))
        {
            error.Text = "<div class='error_register_text'>" + Resources.resource.T_Comment_Error1 + "</div>";
        }

        if (!newsgroup.IsComment)
        {
            btnComment.Visible   = false;
            CommentPanel.Visible = false;
        }
        else
        {
            btnComment.Visible   = true;
            CommentPanel.Visible = true;
            GetNewsCommentById(Id);
        }


        //ViewRegister(Id);

        ltlFb_like.Text    = "<div class='fb-like' data-href='" + Variables.sDomain + "/d4/news/" + GetString(newsgroup.Title) + "-" + newsgroup.GroupCate + "-" + newsgroup.NewsGroupID + ".aspx' data-send='true' data-width='100%' data-height='65' data-show-faces='true'></div>";
        ltlFb_comment.Text = "<div class='fb-comments' data-href='" + Variables.sDomain + "/d4/news/" + GetString(newsgroup.Title) + "-" + newsgroup.GroupCate + "-" + newsgroup.NewsGroupID + ".aspx' data-num-posts='10' data-width='100%'></div>";

        Page.Title = newsgroup.Title;
        HtmlMeta _desrip = new HtmlMeta();

        _desrip.Name    = "description";
        _desrip.Content = Tool.StripTagsCharArray(newsgroup.ShortDescribe) + " , " + newsgroup.Title + " , " + (newsgroup.Tags) + " , " + newsgroup.Keyword;

        Page.Header.Controls.Add(_desrip);

        System.Web.UI.HtmlControls.HtmlMeta _keyWords = new HtmlMeta();
        _keyWords.Name    = "keywords";
        _keyWords.Content = GetString(newsgroup.Keyword) + " ; " + newsgroup.Title;

        Page.Header.Controls.Add(_keyWords);
    }