コード例 #1
0
    protected void imgBtn_Click(object sender, ImageClickEventArgs e)
    {
        UssUrl sUrl = new UssUrl(Request.CurrentExecutionFilePath);

        sUrl.SetParam("Keyword", Server.UrlEncode(txtKeyword.Text.ToString()));
        sUrl.SetParam("id", id);
        string total_node   = string.Empty;
        string TotalGroupid = string.Empty;

        group = new Groups();
        string sGroup = string.Empty;

        foreach (TreeNode node in treeview1.CheckedNodes)
        {
            sGroup += node.Value + ",";
        }
        if (sGroup != string.Empty)//groupid here
        {
            sGroup       = sGroup.Substring(0, sGroup.Length - 1);
            total_node   = sGroup + "," + GetMutilTree(sGroup);
            TotalGroupid = total_node.Substring(0, total_node.Trim().Length - 1);
            sUrl.SetParam("groupid", TotalGroupid);
        }
        Response.Redirect(sUrl.Url);
    }
コード例 #2
0
    protected void imgBtn_Click(object sender, ImageClickEventArgs e)
    {
        UssUrl sUrl = new UssUrl(Request.CurrentExecutionFilePath);

        sUrl.SetParam("Keyword", Server.UrlEncode(txtKeyword.Text.ToString()));
        sUrl.SetParam("Status", ddlStatus.SelectedValue.ToString());
        Response.Redirect(sUrl.Url);
    }
コード例 #3
0
    private void GetData(string IdLienketC)
    {
        News news = new News();

        RptIN.DataSource = news.GetAllDataSelect(IdLienketC);
        RptIN.DataBind();
        //

        string vusername = "";

        if (!Membertask.IsAdministrator())
        {
            Member  mem = new Member();
            DataRow dr  = mem.GetInfoName(Membertask.Name);
            vusername = dr["username"].ToString().Trim();
        }
        else
        {
            vusername = string.Empty;
        }


        this.txtKeyword.Text = keyword;
        UssUrl sUrl1 = new UssUrl(Request.CurrentExecutionFilePath);

        sUrl1.SetParam("Keyword", Server.UrlEncode(txtKeyword.Text.ToString()));
        sUrl1.SetParam("groupid", groupid);
        sUrl1.SetParam("id", id);
        string PageQuery = "page";
        string strcPage  = Request.QueryString[PageQuery];

        if (strcPage == null)
        {
            strcPage = "1";
        }
        int cPage = Convert.ToInt32(strcPage);
        int TotalRecords, TotalPages;

        rptNews.DataSource = news.Searching_ForLienKet(vusername, keyword, groupid, cPage, 20, out TotalRecords, out TotalPages, IdLienketC);
        rptNews.DataBind();
        PageList1.m_pTotalPage   = TotalPages;
        PageList1.m_pPageQuery   = PageQuery;
        PageList1.m_pCurrentPage = cPage;
        PageList1.m_pPageUrl     = sUrl1.Url;
        PageList1.m_pIconPath    = Globals.UrlImages;
        PageList2.m_pTotalPage   = TotalPages;
        PageList2.m_pPageQuery   = PageQuery;
        PageList2.m_pCurrentPage = cPage;
        PageList2.m_pPageUrl     = sUrl1.Url;
        PageList2.m_pIconPath    = Globals.UrlImages;
        if (TotalRecords == 0)
        {
            ltlTotal1.Visible = false;
        }
        ltlTotal.Text = ltlTotal1.Text = string.Format(Language.GetTextByID(45), TotalRecords);
    }
コード例 #4
0
 protected void RptIN_ItemDataBound(object sender, RepeaterItemEventArgs e)
 {
     if (e.Item.ItemIndex != -1 && e.Item.ItemType != ListItemType.Separator)
     {
         HtmlTableRow trItems    = (HtmlTableRow)e.Item.FindControl("trItems");
         Literal      ltlIDN     = (Literal)e.Item.FindControl("ltlIDN");
         Literal      ltlIDNewsN = (Literal)e.Item.FindControl("ltlIDNewsN");
         HtmlAnchor   ltlTitleN  = (HtmlAnchor)e.Item.FindControl("ltlTitleN");
         LinkButton   lbtDelete  = (LinkButton)e.Item.FindControl("lbtDelete");
         DataRowView  dr         = (DataRowView)e.Item.DataItem;
         UssUrl       sUrl       = null;
         if (dr != null)
         {
             if (e.Item.ItemIndex % 2 == 1)
             {
                 trItems.Attributes.Add("class", "alter");
             }
             else
             {
                 trItems.Attributes.Add("class", "item");
             }
             ltlIDN.Text               = (e.Item.ItemIndex + 1).ToString();
             ltlIDNewsN.Text           = dr["id"].ToString();
             ltlTitleN.InnerText       = dr["title"].ToString().Trim();
             lbtDelete.CommandArgument = dr["id"].ToString();
             //
             // xem chi tiết
             sUrl = new UssUrl(Globals.URLCurrent + "detail.aspx");
             sUrl.SetParam("newsid", dr["id"].ToString());
             ltlTitleN.Attributes.Add("style", "cursor:pointer;");
             ltlTitleN.Attributes.Add("onclick", "javascript:ShowPopup('" + sUrl.Url + "','670','800');");
         }
     }
 }
コード例 #5
0
    protected void ddlCol_SelectedIndexChanged(object sender, EventArgs e)
    {
        UssUrl sUrl = new UssUrl();

        sUrl.SetParam("index", ddlCol.SelectedValue.ToString());
        Response.Redirect(sUrl.Url, true);
        GetData();
    }
コード例 #6
0
ファイル: manager.ascx.cs プロジェクト: nhatgiaoict/gencenter
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!this.IsPostBack)
        {
            imgIconHeader.ImageUrl = Globals.UrlImages + "icon_menu1.gif";;
            ltlHeader.Text         = Language.GetTextByID(93);
            if (ParentID == null || ParentID == string.Empty || ParentID == "")
            {
                hlNavigator.Visible = false;
            }
            else
            {
                sUrl                    = new UssUrl(Request.CurrentExecutionFilePath);
                hlNavigator.Text        = Language.GetTextByID(93).ToUpper();
                hlNavigator.NavigateUrl = sUrl.Url;
            }
            sUrl = new UssUrl();
            string status = sUrl.GetParam("Status");
            if (status == "" || status == string.Empty || status == null)
            {
                status = "2";
            }

            UssUrl sUrl1 = new UssUrl(Request.CurrentExecutionFilePath);
            sUrl1.SetParam("ParentID", ParentID);

            string PageQuery = "page";
            string strcPage  = Request.QueryString[PageQuery];
            if (strcPage == null)
            {
                strcPage = "1";
            }
            int cPage = Convert.ToInt32(strcPage);
            int TotalRecords, TotalPages;

            group = new Groups();
            rptGroup.DataSource = group.Searching(ParentID, Convert.ToInt32(status), cPage, 25, out TotalRecords, out TotalPages);
            rptGroup.DataBind();

            PageList.m_pTotalPage   = TotalPages;
            PageList.m_pPageQuery   = PageQuery;
            PageList.m_pCurrentPage = cPage;
            PageList.m_pPageUrl     = sUrl1.Url;
            PageList.m_pIconPath    = Globals.UrlImages;

            if (TotalRecords == 0)
            {
                ltlTotal.Visible = false;
            }
            else
            {
                ltlTotal.Text = "";//string.Format(Language.GetTextByID(240), TotalRecords);
            }
            BtDelete.Text = Language.GetTextByID(43);
            BtSTT.Text    = Language.GetTextByID(48);
        }
    }
コード例 #7
0
    protected void rptNews_ItemDataBound(object sender, RepeaterItemEventArgs e)
    {
        if (e.Item.ItemType == ListItemType.Header)
        {
            Literal ltlIndexHeader = (Literal)e.Item.FindControl("ltlIndexHeader");
            ltlIndexHeader.Text = Language.GetTextByID(40);
            Literal ltlTitleHeader = (Literal)e.Item.FindControl("ltlTitleHeader");
            ltlTitleHeader.Text = Language.GetTextByID(29); //
            Literal ltlEditHeader = (Literal)e.Item.FindControl("ltlEditHeader");
            ltlEditHeader.Text = Language.GetTextByID(42);
            Literal ltlStatusHeader = (Literal)e.Item.FindControl("ltlStatusHeader");
            ltlStatusHeader.Text = Language.GetTextByID(39);
        }
        if (e.Item.ItemIndex != -1 && e.Item.ItemType != ListItemType.Separator)
        {
            HtmlTableRow trItems    = (HtmlTableRow)e.Item.FindControl("trItems");
            Literal      ltlID      = (Literal)e.Item.FindControl("ltlID");
            HyperLink    hlName     = (HyperLink)e.Item.FindControl("hlName");
            LinkButton   lbtOnline  = (LinkButton)e.Item.FindControl("lbtOnline");
            HtmlAnchor   hrEdit     = (HtmlAnchor)e.Item.FindControl("hrEdit");
            Literal      ltlIDNews  = (Literal)e.Item.FindControl("ltlIDNews");
            CheckBox     checkboxID = (CheckBox)e.Item.FindControl("checkboxID");

            DataRowView dr   = (DataRowView)e.Item.DataItem;
            UssUrl      sUrl = null;
            if (dr != null)
            {
                if (e.Item.ItemIndex % 2 == 1)
                {
                    trItems.Attributes.Add("class", "alter");
                }
                else
                {
                    trItems.Attributes.Add("class", "item");
                }

                ltlID.Text     = (e.Item.ItemIndex + 1).ToString();
                ltlIDNews.Text = dr["id"].ToString();
                hlName.Text    = dr["title"].ToString();
                sUrl           = new UssUrl(Globals.URLCurrent + "Detailfooter.aspx");
                sUrl.SetParam("newsid", dr["id"].ToString());
                hlName.Attributes.Add("style", "cursor:hand; cursor:pointer;");
                hlName.Attributes.Add("onclick", "javascript:ShowPopup('" + sUrl.Url + "','700','400');");


                lbtOnline.Text            = (Convert.ToInt32(dr["status"]) == 1) ? "<font color='#0000FF'>" + Language.GetTextByID(46) + "</font>" : "<font color='#FF0000'>" + Language.GetTextByID(47) + "</font>";
                lbtOnline.CommandArgument = dr["id"].ToString();

                sUrl = new UssUrl(Globals.URLCurrent + "footerUpdate.aspx");
                sUrl.SetParam("id", dr["id"].ToString());
                hrEdit.InnerText = Language.GetTextByID(42);
                hrEdit.HRef      = sUrl.Url;
            }
        }
    }
コード例 #8
0
    protected void rptList_ItemDataBound(object sender, RepeaterItemEventArgs e)
    {
        if (e.Item.ItemIndex != -1 && e.Item.ItemType != ListItemType.Separator)
        {
            HtmlTableRow trItems         = (HtmlTableRow)e.Item.FindControl("trItems");
            DataRowView  dr              = (DataRowView)e.Item.DataItem;
            Literal      ltlID           = (Literal)e.Item.FindControl("ltlID");
            LinkButton   ltllAddThuoctin = (LinkButton)e.Item.FindControl("ltllAddThuoctin");
            LinkButton   ltbstatus       = (LinkButton)e.Item.FindControl("ltbstatus");
            LinkButton   lblEdit         = (LinkButton)e.Item.FindControl("lblEdit");
            LinkButton   lbtDelete       = (LinkButton)e.Item.FindControl("lbtDelete");
            if (dr != null)
            {
                if (e.Item.ItemIndex % 2 == 1)
                {
                    trItems.Attributes.Add("class", "alter");
                }
                else
                {
                    trItems.Attributes.Add("class", "item");
                }
                ltlID.Text = (e.Item.ItemIndex + 1).ToString();

                ltbstatus.Text            = (Convert.ToInt32(dr["status"]) == 1) ? "<font color='#0000FF'>" + Language.GetTextByID(46) + "</font>" : "<font color='#FF0000'>" + Language.GetTextByID(47) + "</font>";
                ltbstatus.CommandArgument = dr["id"].ToString();

                lblEdit.CommandArgument   = dr["id"].ToString();
                lbtDelete.CommandArgument = dr["id"].ToString();

                sUrl = new UssUrl(Globals.URLCurrent + "AddValueOfthuoctinh.aspx");
                sUrl.SetParam("id", dr["id"].ToString());           // làm parentID;
                sUrl.SetParam("groupid", dr["groupid"].ToString()); // sử dụng cho việt insert đúng chuyên mục

                //ltllAddThuoctin.Attributes.Add("style", "cursor:hand;cursor:pointer");
                ltllAddThuoctin.Attributes.Add("onclick", "javascript:ShowPopup('" + sUrl.Url + "','400','300');");
            }
        }
    }
コード例 #9
0
    protected void Page_Load(object sender, EventArgs e)
    {
        spartner = new clsPartner();
        if (!this.IsPostBack)
        {
            //

            //Button1.Text = Language.GetTextByID(350);
            //btlOk.Text = Language.GetTextByID(37);

            ddlStatus.Attributes.Add("style", "border:1 solid #ff0000; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:11px; width:100px");
            ddlStatus.DataSource     = Language.Status_duyetok();
            ddlStatus.DataValueField = "id";
            ddlStatus.DataTextField  = Globals.CurrentLang;
            ddlStatus.DataBind();
            ddlStatus.SelectedValue = status;

            this.txtKeyword.Text = keyword;
            UssUrl sUrl1 = new UssUrl(Request.CurrentExecutionFilePath);
            sUrl1.SetParam("Keyword", Server.UrlEncode(txtKeyword.Text.ToString()));
            sUrl1.SetParam("Status", ddlStatus.SelectedValue.ToString());
            string PageQuery = "page";
            string strcPage  = Request.QueryString[PageQuery];
            if (strcPage == null)
            {
                strcPage = "1";
            }
            int cPage = Convert.ToInt32(strcPage);
            int TotalRecords, TotalPages;

            rptGroup.DataSource = spartner.Searching(keyword, Convert.ToInt32(status), cPage, 20, out TotalRecords, out TotalPages);
            rptGroup.DataBind();
            SetControls(false);

            BtSTT.Text = Language.GetTextByID(48);
        }
    }
コード例 #10
0
ファイル: menu.ascx.cs プロジェクト: nhatgiaoict/gencenter
    protected void rptGroup_ItemDataBound(object sender, RepeaterItemEventArgs e)
    {
        if (e.Item.ItemType == ListItemType.Header)
        {
            Literal ltlIdxHeader1 = (Literal)e.Item.FindControl("ltlIdxHeader1");
            ltlIdxHeader1.Text = Language.GetTextByID(40);
            Literal ltlTitleHeader1 = (Literal)e.Item.FindControl("ltlTitleHeader1");
            ltlTitleHeader1.Text = Language.GetTextByID(29);
            Literal ltlSummaryHeader1 = (Literal)e.Item.FindControl("ltlSummaryHeader1");
            ltlSummaryHeader1.Text = Language.GetTextByID(31);
            Literal ltlSelectHeader1 = (Literal)e.Item.FindControl("ltlSelectHeader1");
            ltlSelectHeader1.Text = Language.GetTextByID(122);
        }
        if (e.Item.ItemIndex != -1 && e.Item.ItemType != ListItemType.Separator)
        {
            HtmlTableRow trItems2    = (HtmlTableRow)e.Item.FindControl("trItems2");
            Literal      ltlIndex1   = (Literal)e.Item.FindControl("ltlIndex1");
            HyperLink    hlTitle1    = (HyperLink)e.Item.FindControl("hlTitle1");
            Literal      ltlSummary1 = (Literal)e.Item.FindControl("ltlSummary1");
            LinkButton   lbtSelect1  = (LinkButton)e.Item.FindControl("lbtSelect1");
            DataRowView  dr          = (DataRowView)e.Item.DataItem;
            if (dr != null)
            {
                if (e.Item.ItemIndex % 2 == 1)
                {
                    trItems2.Attributes.Add("class", "alter");
                }
                else
                {
                    trItems2.Attributes.Add("class", "item");
                }

                ltlIndex1.Text = (e.Item.ItemIndex + 1).ToString();
                hlTitle1.Text  = dr["title"].ToString();
                string sid = dr["id"].ToString();
                if (group.NextChild(sid))
                {
                    sUrl = new UssUrl();
                    sUrl.SetParam("ParentID", sid);
                    hlTitle1.NavigateUrl = sUrl.Url;
                }
                ltlSummary1.Text           = dr["summary"].ToString();
                lbtSelect1.Text            = Language.GetTextByID(122);
                lbtSelect1.CommandArgument = dr["id"].ToString();
            }
        }
    }
コード例 #11
0
ファイル: manager.ascx.cs プロジェクト: nhatgiaoict/gencenter
    protected void rptGroup_ItemDataBound(object sender, RepeaterItemEventArgs e)
    {
        if (e.Item.ItemType == ListItemType.Header)
        {
            Literal ltlIndexHeader = (Literal)e.Item.FindControl("ltlIndexHeader");
            ltlIndexHeader.Text = Language.GetTextByID(40);

            Literal ltlTitleHeader = (Literal)e.Item.FindControl("ltlTitleHeader");
            ltlTitleHeader.Text = Language.GetTextByID(29);

            Literal ltlStatushome = (Literal)e.Item.FindControl("ltlStatushome");
            ltlStatushome.Text = Language.GetTextByID(96);

            Literal ltlStatusHeader = (Literal)e.Item.FindControl("ltlStatusHeader");
            ltlStatusHeader.Text = Language.GetTextByID(39);

            Literal ltlInquiryHeader = (Literal)e.Item.FindControl("ltlInquiryHeader");
            ltlInquiryHeader.Text = Language.GetTextByID(142);

            //Literal ltlKind = (Literal)e.Item.FindControl("ltlKind");
            //ltlKind.Text = Language.GetTextByID(415);

            Literal ltlEditHeader = (Literal)e.Item.FindControl("ltlEditHeader");
            ltlEditHeader.Text = Language.GetTextByID(42);

            Literal ltlDeleteHeader = (Literal)e.Item.FindControl("ltlDeleteHeader");
            ltlDeleteHeader.Text = Language.GetTextByID(43);
        }
        group = new Groups();
        if (e.Item.ItemIndex != -1 && e.Item.ItemType != ListItemType.Separator)
        {
            HtmlTableRow trItems = (HtmlTableRow)e.Item.FindControl("trItems");

            Literal    ltlID       = (Literal)e.Item.FindControl("ltlID");
            TextBox    ltlID_Index = (TextBox)e.Item.FindControl("ltlID_Index");
            Literal    ltlKind     = (Literal)e.Item.FindControl("ltlKind");
            TextBox    txtIdx      = (TextBox)e.Item.FindControl("txtIdx");
            HyperLink  hlTitle     = (HyperLink)e.Item.FindControl("hlTitle");
            LinkButton lbtOnline   = (LinkButton)e.Item.FindControl("lbtOnline");
            LinkButton lbtHome     = (LinkButton)e.Item.FindControl("lbtHome");
            LinkButton lbtInquiry  = (LinkButton)e.Item.FindControl("lbtInquiry");
            //LinkButton lbtKind = (LinkButton)e.Item.FindControl("lbtKind");

            Literal     ltlIDChuyenmuc = (Literal)e.Item.FindControl("ltlIDChuyenmuc");
            CheckBox    checkboxID     = (CheckBox)e.Item.FindControl("checkboxID");
            HtmlAnchor  hrEdit         = (HtmlAnchor)e.Item.FindControl("hrEdit");
            HtmlAnchor  hlinkthuoctinh = (HtmlAnchor)e.Item.FindControl("hlinkthuoctinh");
            DataRowView dr             = (DataRowView)e.Item.DataItem;
            if (dr != null)
            {
                if (e.Item.ItemIndex % 2 == 1)
                {
                    trItems.Attributes.Add("class", "alter");
                }
                else
                {
                    trItems.Attributes.Add("class", "item");
                }

                string sid = dr["id"].ToString();
                ltlID.Text          = sid;
                ltlIDChuyenmuc.Text = sid;
                ltlID_Index.Attributes.Add("style", "width:30px");
                ltlID_Index.Text = (e.Item.ItemIndex + 1).ToString();   //STT
                hlTitle.Text     = dr["title"].ToString();

                if (group.NextChild(sid))
                {
                    sUrl = new UssUrl();
                    sUrl.SetParam("ParentID", sid);
                    hlTitle.NavigateUrl = sUrl.Url;
                }

                if (dr["kind"].ToString() == "1")
                {
                    hlinkthuoctinh.InnerText = "Thuộc tính";
                    sUrl = new UssUrl(Globals.URLCurrent + "thuoctinhgroup.aspx");
                    sUrl.SetParam("id", sid);
                    hlinkthuoctinh.HRef = sUrl.Url;
                }
                lbtOnline.Text            = (Convert.ToInt32(dr["status"]) == 1) ? "<font color='#0000FF'>" + Language.GetTextByID(46) + "</font>" : "<font color='#FF0000'>" + Language.GetTextByID(47) + "</font>";
                lbtOnline.CommandArgument = dr["id"].ToString();

                lbtHome.Text            = (Convert.ToInt32(dr["home"]) == 1) ? "<font color='#0000FF'>" + Language.GetTextByID(46) + "</font>" : "<font color='#FF0000'>" + Language.GetTextByID(47) + "</font>";
                lbtHome.CommandArgument = dr["id"].ToString();

                lbtInquiry.Text            = (Convert.ToInt32(dr["inquiry"]) == 1) ? "<font color='#0000FF'>" + Language.GetTextByID(21) + "</font>" : "<font color='#FF0000'>" + Language.GetTextByID(22) + "</font>";
                lbtInquiry.CommandArgument = dr["id"].ToString();

                ltlKind.Text = ConvertKind(Convert.ToInt32(dr["kind"].ToString()));

                sUrl = new UssUrl(Globals.URLCurrent + "update.aspx");
                sUrl.SetParam("id", sid);
                hrEdit.InnerText = Language.GetTextByID(42);
                hrEdit.HRef      = sUrl.Url;
            }
        }
    }
コード例 #12
0
    protected void Page_Load(object sender, EventArgs e)
    {
        group = new Groups();
        string sLang = Globals.CurrentLang;

        if (sLang == "vn")
        {
            sLang     = "vi";
            test_lang = 1;
        }
        else
        {
            test_lang = 2;
        }
        if (!this.IsPostBack)
        {
            //Trees view
            treeview1.ShowCheckBoxes = TreeNodeTypes.All;
            treeview1.ShowLines      = true;
            if (ParentID == "" || ParentID == string.Empty || ParentID == "")
            {
                treeview1.ExpandDepth = 0;
            }
            else
            {
                treeview1.ExpandDepth = Convert.ToInt32(ParentID);
            }
            BildRoot(treeview1);

            BtDelete.Text = Language.GetTextByID(43);
            BtSend.Text   = Language.GetTextByID(161);
            BtReturn.Text = Language.GetTextByID(164);

            Member  mem       = new Member();
            DataRow dr        = mem.GetInfoName(Membertask.Name);
            string  vusername = dr["username"].ToString().Trim();

            imgIconHeader.ImageUrl = Globals.UrlImages + "icon_menu1.gif";
            ltlHeader.Text         = Language.GetTextByID(163);
            ltlGroup.Text          = Language.GetTextByID(91);
            ltlKeyword.Text        = Language.GetTextByID(38);
            txtKeyword.Attributes.Add("style", "width:250px");
            ltlStatus.Text = Language.GetTextByID(39);

            imgBtn.ImageUrl = Globals.UrlImages + "search_new.gif";
            ddlStatus.Attributes.Add("style", "border:1 solid #ff0000; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:11px; width:100px");
            ddlStatus.DataSource     = Language.Status_Bientap();
            ddlStatus.DataValueField = "id";
            ddlStatus.DataTextField  = Globals.CurrentLang;
            ddlStatus.DataBind();
            ddlStatus.SelectedValue = status;

            this.txtKeyword.Text = keyword;

            UssUrl sUrl1 = new UssUrl(Request.CurrentExecutionFilePath);
            sUrl1.SetParam("Keyword", Server.UrlEncode(txtKeyword.Text.ToString()));
            sUrl1.SetParam("Status", ddlStatus.SelectedValue.ToString());
            sUrl1.SetParam("groupid", groupid);

            string PageQuery = "page";
            string strcPage  = Request.QueryString[PageQuery];
            if (strcPage == null)
            {
                strcPage = "1";
            }
            int cPage = Convert.ToInt32(strcPage);
            int TotalRecords, TotalPages;

            News news = new News();
            rptNews.DataSource = news.Searching_ofBientap(keyword, groupid, Convert.ToInt32(status), cPage, 20, out TotalRecords, out TotalPages);
            rptNews.DataBind();

            PageList1.m_pTotalPage   = TotalPages;
            PageList1.m_pPageQuery   = PageQuery;
            PageList1.m_pCurrentPage = cPage;
            PageList1.m_pPageUrl     = sUrl1.Url;
            PageList1.m_pIconPath    = Globals.UrlImages;

            PageList2.m_pTotalPage   = TotalPages;
            PageList2.m_pPageQuery   = PageQuery;
            PageList2.m_pCurrentPage = cPage;
            PageList2.m_pPageUrl     = sUrl1.Url;
            PageList2.m_pIconPath    = Globals.UrlImages;

            if (TotalRecords == 0)
            {
                //ltlTotal.Visible = false;
                ltlTotal1.Visible = false;
            }
            ltlTotal.Text = ltlTotal1.Text = string.Format(Language.GetTextByID(45), TotalRecords);
        }
    }
コード例 #13
0
    protected void rptNews_ItemDataBound(object sender, RepeaterItemEventArgs e)
    {
        if (e.Item.ItemType == ListItemType.Header)
        {
            Literal ltlIndexHeader = (Literal)e.Item.FindControl("ltlIndexHeader");
            ltlIndexHeader.Text = Language.GetTextByID(40);
            Literal ltlTitleHeader = (Literal)e.Item.FindControl("ltlTitleHeader");
            ltlTitleHeader.Text = Language.GetTextByID(29);
            Literal ltlLastUpdateHeader = (Literal)e.Item.FindControl("ltlLastUpdateHeader");
            ltlLastUpdateHeader.Text = Language.GetTextByID(41);

            Literal ltlEditHeader = (Literal)e.Item.FindControl("ltlEditHeader");
            ltlEditHeader.Text = Language.GetTextByID(42);

            Literal ltlSendHeader = (Literal)e.Item.FindControl("ltlSendHeader");
            ltlSendHeader.Text = Language.GetTextByID(161);

            Literal ltlReturnHeader = (Literal)e.Item.FindControl("ltlReturnHeader");
            ltlReturnHeader.Text = Language.GetTextByID(164);

            Literal ltlLogHeader = (Literal)e.Item.FindControl("ltlLogHeader");
            ltlLogHeader.Text = Language.GetTextByID(166);
        }
        if (e.Item.ItemIndex != -1 && e.Item.ItemType != ListItemType.Separator)
        {
            HtmlTableRow trItems    = (HtmlTableRow)e.Item.FindControl("trItems");
            Literal      ltlID      = (Literal)e.Item.FindControl("ltlID");
            HyperLink    ltlTitle   = (HyperLink)e.Item.FindControl("ltlTitle");
            Literal      ltlCreated = (Literal)e.Item.FindControl("ltlCreated");

            HtmlAnchor hrEdit = (HtmlAnchor)e.Item.FindControl("hrEdit");

            LinkButton lbtSend = (LinkButton)e.Item.FindControl("lbtSend");
            HtmlImage  imgSend = (HtmlImage)e.Item.FindControl("imgSend");

            LinkButton lbtReturn = (LinkButton)e.Item.FindControl("lbtReturn");
            HtmlImage  imgReturn = (HtmlImage)e.Item.FindControl("imgReturn");

            HtmlImage imgHistory = (HtmlImage)e.Item.FindControl("imgHistory");

            Literal  ltlIDNews  = (Literal)e.Item.FindControl("ltlIDNews");
            CheckBox checkboxID = (CheckBox)e.Item.FindControl("checkboxID");

            DataRowView dr   = (DataRowView)e.Item.DataItem;
            UssUrl      sUrl = null;

            if (dr != null)
            {
                if (e.Item.ItemIndex % 2 == 1)
                {
                    trItems.Attributes.Add("class", "alter");
                }
                else
                {
                    trItems.Attributes.Add("class", "item");
                }

                ltlID.Text = (e.Item.ItemIndex + 1).ToString();

                ltlIDNews.Text = dr["id"].ToString();

                ltlTitle.Text = dr["title"].ToString();
                sUrl          = new UssUrl(Globals.URLCurrent + "detail.aspx");
                sUrl.SetParam("newsid", dr["id"].ToString());
                ltlTitle.Attributes.Add("style", "cursor:hand; cursor:pointer;");
                ltlTitle.Attributes.Add("onclick", "javascript:ShowPopup('" + sUrl.Url + "','670','800');");


                ltlCreated.Text = Globals.FullDateTime(Convert.ToDateTime(dr["created"]));

                sUrl = new UssUrl(Globals.URLCurrent + "update.aspx");
                sUrl.SetParam("id", dr["id"].ToString());
                hrEdit.InnerText = Language.GetTextByID(42);
                hrEdit.HRef      = sUrl.Url;
                hrEdit.Visible   = false;

                imgSend.Src             = Globals.UrlImages + "icon_submit.gif";
                lbtSend.CommandArgument = dr["id"].ToString();
                imgSend.Visible         = false;

                imgReturn.Src             = Globals.UrlImages + "icon_return.gif";
                lbtReturn.CommandArgument = dr["id"].ToString();
                imgReturn.Visible         = false;

                checkboxID.Visible = false;
                if (Convert.ToInt32(dr["status"].ToString()) == 3)
                {
                    imgSend.Visible    = true;
                    imgReturn.Visible  = true;
                    hrEdit.Visible     = true;
                    checkboxID.Visible = true;
                }
                sUrl = new UssUrl(Globals.UrlRoot + "news/logfile.aspx");
                sUrl.SetParam("ID", dr["ID"].ToString());
                imgHistory.Attributes.Add("style", "cursor:hand;cursor:pointer");
                imgHistory.Attributes.Add("onclick", "javascript:ShowPopup('" + sUrl.Url + "','800','400');");
                imgHistory.Src = Globals.UrlImages + "history.gif";
            }
        }
    }
コード例 #14
0
    protected void rptMember_ItemDataBound(object sender, RepeaterItemEventArgs e)
    {
        if (e.Item.ItemType == ListItemType.Header)
        {
            Literal ltlIndexHeader = (Literal)e.Item.FindControl("ltlIndexHeader");
            ltlIndexHeader.Text = Language.GetTextByID(40);
            Literal ltlTitleHeader = (Literal)e.Item.FindControl("ltlTitleHeader");
            ltlTitleHeader.Text = Language.GetTextByID(57);
            Literal ltlLastUpdateHeader = (Literal)e.Item.FindControl("ltlLastUpdateHeader");
            ltlLastUpdateHeader.Text = Language.GetTextByID(69);
            Literal ltlStatusHeader = (Literal)e.Item.FindControl("ltlStatusHeader");
            ltlStatusHeader.Text = Language.GetTextByID(39);
            Literal ltlEditHeader = (Literal)e.Item.FindControl("ltlEditHeader");
            ltlEditHeader.Text = Language.GetTextByID(42);
            Literal ltlDeleteHeader = (Literal)e.Item.FindControl("ltlDeleteHeader");
            ltlDeleteHeader.Text = Language.GetTextByID(43);
        }
        if (e.Item.ItemIndex != -1 && e.Item.ItemType != ListItemType.Separator)
        {
            HtmlTableRow trItems     = (HtmlTableRow)e.Item.FindControl("trItems");
            Literal      ltlID       = (Literal)e.Item.FindControl("ltlID");
            Literal      ltlID_Index = (Literal)e.Item.FindControl("ltlID_Index");
            Literal      ltlTitle    = (Literal)e.Item.FindControl("ltlTitle");
            Literal      ltlCreated  = (Literal)e.Item.FindControl("ltlCreated");
            LinkButton   lbtOnline   = (LinkButton)e.Item.FindControl("lbtOnline");
            HtmlAnchor   hrEdit      = (HtmlAnchor)e.Item.FindControl("hrEdit");

            Literal  ltlIDMember = (Literal)e.Item.FindControl("ltlIDMember");
            CheckBox checkboxID  = (CheckBox)e.Item.FindControl("checkboxID");


            DataRowView dr = (DataRowView)e.Item.DataItem;
            if (dr != null)
            {
                if (e.Item.ItemIndex % 2 == 1)
                {
                    trItems.Attributes.Add("class", "alter");
                }
                else
                {
                    trItems.Attributes.Add("class", "item");
                }
                ltlID.Text       = dr["id"].ToString();
                ltlID_Index.Text = (e.Item.ItemIndex + 1).ToString();   //STT
                ltlIDMember.Text = dr["id"].ToString();

                ltlTitle.Text = dr["fullname"].ToString() + " (" + dr["username"].ToString() + ")";

                if (Membertask.IsAdministrator(dr["username"].ToString()))
                {
                    if (Convert.ToInt32(dr["IsAdmin"].ToString()) != 1)
                    {
                        ltlCreated.Text = Language.GetTextByID(68);
                    }
                    else
                    {
                        ltlCreated.Text = Language.GetTextByID(199);
                    }
                }
                else
                {
                    ltlCreated.Text = Language.GetTextByID(2);
                }

                lbtOnline.Text            = (Convert.ToInt32(dr["status"]) == 1) ? "<font color='#0000FF'>" + Language.GetTextByID(73) + "</font>" : "<font color='#FF0000'>" + Language.GetTextByID(74) + "</font>";
                lbtOnline.CommandArgument = dr["id"].ToString();
                lbtOnline.Visible         = false;

                sUrl = new UssUrl(Globals.URLCurrent + "update.aspx");
                sUrl.SetParam("id", dr["id"].ToString());

                hrEdit.InnerText = Language.GetTextByID(42);
                hrEdit.HRef      = sUrl.Url;
                hrEdit.Visible   = false;

                checkboxID.Visible = false;
                if (Convert.ToInt32(dr["IsAdmin"].ToString()) != 1)
                {
                    hrEdit.Visible     = true;
                    lbtOnline.Visible  = true;
                    checkboxID.Visible = true;
                }
            }
        }
    }
コード例 #15
0
    protected void rptAdvert_ItemDataBound(object sender, RepeaterItemEventArgs e)
    {
        if (e.Item.ItemType == ListItemType.Header)
        {
            Literal ltlIndexHeader = (Literal)e.Item.FindControl("ltlIndexHeader");
            ltlIndexHeader.Text = Language.GetTextByID(40);
            Literal ltlTitleHeader = (Literal)e.Item.FindControl("ltlTitleHeader");
            ltlTitleHeader.Text = Language.GetTextByID(29);

            Literal ltlLogoHeader = (Literal)e.Item.FindControl("ltlLogoHeader");
            ltlLogoHeader.Text = Language.GetTextByID(33);
            Literal ltlLastUpdateHeader = (Literal)e.Item.FindControl("ltlLastUpdateHeader");
            ltlLastUpdateHeader.Text = Language.GetTextByID(41);

            Literal ltlClickCountHeader = (Literal)e.Item.FindControl("ltlClickCountHeader");
            ltlClickCountHeader.Text = Language.GetTextByID(146);

            Literal ltlStatusHeader = (Literal)e.Item.FindControl("ltlStatusHeader");
            ltlStatusHeader.Text = Language.GetTextByID(39);
            Literal ltlEditHeader = (Literal)e.Item.FindControl("ltlEditHeader");
            ltlEditHeader.Text = Language.GetTextByID(42);
            Literal ltlDeleteHeader = (Literal)e.Item.FindControl("ltlDeleteHeader");
            ltlDeleteHeader.Text = Language.GetTextByID(43);
        }
        if (e.Item.ItemIndex != -1 && e.Item.ItemType != ListItemType.Separator)
        {
            HtmlTableRow trItems       = (HtmlTableRow)e.Item.FindControl("trItems");
            Literal      ltlID         = (Literal)e.Item.FindControl("ltlID");
            HtmlAnchor   Hlinktitle    = (HtmlAnchor)e.Item.FindControl("Hlinktitle");
            Literal      ltlLogo       = (Literal)e.Item.FindControl("ltlLogo");
            Literal      ltlCreated    = (Literal)e.Item.FindControl("ltlCreated");
            Literal      ltlClickCount = (Literal)e.Item.FindControl("ltlClickCount");
            LinkButton   lbtOnline     = (LinkButton)e.Item.FindControl("lbtOnline");
            HtmlAnchor   hrEdit        = (HtmlAnchor)e.Item.FindControl("hrEdit");
            LinkButton   lbtDelete     = (LinkButton)e.Item.FindControl("lbtDelete");
            HtmlImage    imgDelete     = (HtmlImage)e.Item.FindControl("imgDelete");
            string       sFile         = string.Empty;
            string       sPath         = string.Empty;
            string       fExt          = string.Empty;
            DataRowView  dr            = (DataRowView)e.Item.DataItem;
            UssUrl       sUrlCT        = null;
            if (dr != null)
            {
                if (e.Item.ItemIndex % 2 == 1)
                {
                    trItems.Attributes.Add("class", "alter");
                }
                else
                {
                    trItems.Attributes.Add("class", "item");
                }
                ltlID.Text           = (e.Item.ItemIndex + 1).ToString();
                Hlinktitle.InnerText = dr["title"].ToString();
                if (Convert.ToInt32(dr["kind"].ToString()) == 1)
                {
                    sUrlCT = new UssUrl(Globals.URLCurrent + "ViewAdvert.aspx");
                    sUrlCT.SetParam("Advertid", dr["id"].ToString());
                    Hlinktitle.Attributes.Add("style", "cursor:hand;cursor:pointer");
                    Hlinktitle.Attributes.Add("onclick", "javascript:ShowPopup('" + sUrlCT.Url + "','400','400');");
                }
                else
                {
                    string sfimage = dr["filename"].ToString();
                    string SFile   = string.Empty;
                    if (sfimage.Length > 0)
                    {
                        SFile = sfimage.Substring(sfimage.Length - 4);
                        string s = Globals.UrlRoot + dr["filename"].ToString();
                        if (SFile == ".swf")
                        {
                            ltlLogo.Text = string.Format("<script language='javascript'>\n<!--\n embed_flash('{0}', '185', '','left');\n-->\n</script>", s);
                        }
                        else
                        {
                            ltlLogo.Text = string.Format("<img src='{0}' border='0' width='185' >", s);
                        }
                    }
                    else
                    {
                        ltlLogo.Text = string.Empty;
                    }
                }
                ltlCreated.Text           = Convert.ToDateTime(dr["created"]).ToString("dd/MM/yyyy");
                ltlClickCount.Text        = dr["nclick"].ToString();
                lbtOnline.Text            = (Convert.ToInt32(dr["status"]) == 1) ? "<font color='#0000FF'>" + Language.GetTextByID(46) + "</font>" : "<font color='#FF0000'>" + Language.GetTextByID(47) + "</font>";
                lbtOnline.CommandArgument = dr["id"].ToString();

                UssUrl sUrl = new UssUrl(Globals.URLCurrent + "update.aspx");
                sUrl.SetParam("id", dr["id"].ToString());

                hrEdit.InnerText          = Language.GetTextByID(42);
                hrEdit.HRef               = sUrl.Url;
                imgDelete.Src             = Globals.UrlImages + "delete.gif";
                lbtDelete.CommandArgument = dr["id"].ToString();
                imgDelete.Visible         = false;
                if (Convert.ToInt32(dr["status"].ToString()) == 0)
                {
                    //hrEdit.Visible = true;
                    imgDelete.Visible = true;
                }
            }
        }
    }
コード例 #16
0
ファイル: manager.ascx.cs プロジェクト: nhatgiaoict/gencenter
    protected void Page_Load(object sender, EventArgs e)
    {
        group = new Groups(1);
        string sLang = Globals.CurrentLang;

        if (sLang == "vn")
        {
            sLang     = "vi";
            test_lang = 1;
        }
        else
        {
            test_lang = 2;
        }
        if (!this.IsPostBack)
        {
            //Trees view
            treeview1.ShowCheckBoxes = TreeNodeTypes.All;
            treeview1.ShowLines      = true;
            if (ParentID == "" || ParentID == string.Empty || ParentID == "")
            {
                treeview1.ExpandDepth = 0;
            }
            else
            {
                treeview1.ExpandDepth = Convert.ToInt32(ParentID);
            }
            BildRoot(treeview1);
            BtDelete.Text = Language.GetTextByID(43);
            txtKeyword.Attributes.Add("style", "width:250px");

            imgBtn.ImageUrl = Globals.UrlImages + "search_new.gif";

            this.txtKeyword.Text = keyword;
            UssUrl sUrl1 = new UssUrl(Request.CurrentExecutionFilePath);
            sUrl1.SetParam("Keyword", Server.UrlEncode(txtKeyword.Text.ToString()));
            sUrl1.SetParam("groupid", groupid);

            string PageQuery = "page";
            string strcPage  = Request.QueryString[PageQuery];
            if (strcPage == null)
            {
                strcPage = "1";
            }
            int cPage = Convert.ToInt32(strcPage);
            int TotalRecords, TotalPages;

            clsHoivien hoivien = new clsHoivien();
            rptNews.DataSource = hoivien.SearchHoivien(keyword, groupid, cPage, 20, out TotalRecords, out TotalPages);
            rptNews.DataBind();

            PageList1.m_pTotalPage   = TotalPages;
            PageList1.m_pPageQuery   = PageQuery;
            PageList1.m_pCurrentPage = cPage;
            PageList1.m_pPageUrl     = sUrl1.Url;
            PageList1.m_pIconPath    = Globals.UrlImages;

            PageList2.m_pTotalPage   = TotalPages;
            PageList2.m_pPageQuery   = PageQuery;
            PageList2.m_pCurrentPage = cPage;
            PageList2.m_pPageUrl     = sUrl1.Url;
            PageList2.m_pIconPath    = Globals.UrlImages;

            if (TotalRecords == 0)
            {
                //ltlTotal.Visible = false;
                ltlTotal1.Visible = false;
            }
            ltlTotal.Text = ltlTotal1.Text = string.Format(Language.GetTextByID(428), TotalRecords);
        }
    }
コード例 #17
0
ファイル: manager.ascx.cs プロジェクト: nhatgiaoict/gencenter
    protected void rptNews_ItemDataBound(object sender, RepeaterItemEventArgs e)
    {
        if (e.Item.ItemIndex != -1 && e.Item.ItemType != ListItemType.Separator)
        {
            HtmlTableRow trItems    = (HtmlTableRow)e.Item.FindControl("trItems");
            HyperLink    ltlTitle   = (HyperLink)e.Item.FindControl("ltlTitle");
            Literal      ltlCreated = (Literal)e.Item.FindControl("ltlCreated");
            TextBox      txtSTT     = (TextBox)e.Item.FindControl("txtSTT");
            HtmlAnchor   hrEdit     = (HtmlAnchor)e.Item.FindControl("hrEdit");
            LinkButton   lbtSend    = (LinkButton)e.Item.FindControl("lbtSend");
            HtmlImage    imgHistory = (HtmlImage)e.Item.FindControl("imgHistory");
            Literal      ltlIDNews  = (Literal)e.Item.FindControl("ltlIDNews");
            CheckBox     checkboxID = (CheckBox)e.Item.FindControl("checkboxID");
            DataRowView  dr         = (DataRowView)e.Item.DataItem;
            UssUrl       sUrl       = null;

            if (dr != null)
            {
                if (e.Item.ItemIndex % 2 == 1)
                {
                    trItems.Attributes.Add("class", "alter");
                }
                else
                {
                    trItems.Attributes.Add("class", "item");
                }

                ltlIDNews.Text = dr["id"].ToString();

                checkboxID.Attributes.Add("style", "width:30px");
                checkboxID.Text = (e.Item.ItemIndex + 1).ToString();

                txtSTT.Text = (e.Item.ItemIndex + 1).ToString();

                ltlCreated.Text = Globals.FullDateTime(Convert.ToDateTime(dr["created"]));
                ltlTitle.Text   = dr["title"].ToString();
                sUrl            = new UssUrl(Globals.URLCurrent + "detail.aspx");
                sUrl.SetParam("newsid", dr["id"].ToString());
                ltlTitle.Attributes.Add("style", "cursor:hand; cursor:pointer;");
                ltlTitle.Attributes.Add("onclick", "javascript:ShowPopup('" + sUrl.Url + "','670','800');");

                sUrl = new UssUrl(Globals.URLCurrent + "update.aspx");
                sUrl.SetParam("id", dr["id"].ToString());
                hrEdit.InnerText        = Language.GetTextByID(42);
                hrEdit.HRef             = sUrl.Url;
                lbtSend.Text            = (Convert.ToInt32(dr["status"]) == 1) ? "<font color='#0000FF'>" + Language.GetTextByID(46) + "</font>" : "<font color='#FF0000'>" + Language.GetTextByID(47) + "</font>";
                lbtSend.CommandArgument = dr["id"].ToString();

                checkboxID.Visible = false;
                if (Convert.ToInt32(dr["status"].ToString()) == 0)
                {
                    //hrEdit.Visible = true;
                    checkboxID.Visible = true;
                }
                sUrl = new UssUrl(Globals.UrlRoot + "hoivien/logfile.aspx");
                sUrl.SetParam("ID", dr["ID"].ToString());
                imgHistory.Attributes.Add("style", "cursor:hand;cursor:pointer");
                imgHistory.Attributes.Add("onclick", "javascript:ShowPopup('" + sUrl.Url + "','800','400');");
                imgHistory.Src = Globals.UrlImages + "history.gif";
            }
        }
    }