Пример #1
0
    private void lbtSend_Click(object sender, System.EventArgs e)
    {
        LinkButton lbtSend = (LinkButton)sender;

        if (lbtSend.CommandArgument != String.Empty)
        {
            string     id      = lbtSend.CommandArgument.ToString();
            clsHoivien hoivien = new clsHoivien();
            hoivien.SetStatus(id);

            //Save log
            string created = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
            string Ghichu  = "";
            if (test_lang != 2)
            {
                Ghichu = "Cho phép bài hiển thị";
            }
            else
            {
                Ghichu = "Online";
            }
            Logfile log    = new Logfile();
            int     status = 1;
            log.insertDatalog(id, created, status, Ghichu.Trim());
            Response.Redirect(Globals.UrlRoot + "temp.aspx?url=" + Request.Url);
        }
    }
Пример #2
0
    protected void btnRegister_Click(object sender, EventArgs e)
    {
        string sTitle   = tbxTitle.Text.Trim();
        string sTomtat  = tbxSummary.Text.Trim();
        string sImage   = txtFileImages.Value.Trim();
        string sCapbac  = txtCapbac.Text.Trim();
        string sContent = txtContent.Text.Trim();
        string created  = rdpPublishDate.SelectedDate.ToString("yyyy-MM-dd HH:mm:ss");

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

        foreach (TreeNode node in treeview1.CheckedNodes)
        {
            sGroup = node.Value;
        }
        if (sGroup == "" || sGroup == string.Empty || sGroup == null)
        {
            ltlRequireGroup.Visible = true; return;
        }
        else
        {
            ltlRequireGroup.Visible = false;
        }

        clsHoivien hoivien = new clsHoivien();

        hoivien.UpdateHoivien(id, sGroup, sTitle, sTomtat, created, sImage, sCapbac, sContent);

        Response.Redirect(Globals.URLCurrent + "manager.aspx");
    }
Пример #3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (id == "" || id == null || id == string.Empty)
        {
            Response.Redirect(Globals.URLCurrent + "manager.aspx");
        }
        string sLang = Globals.CurrentLang;

        if (sLang == "vn")
        {
            sLang     = "vi";
            test_lang = 1;
        }
        else
        {
            test_lang = 2;
        }
        group = new Groups(1);
        if (!this.IsPostBack)
        {
            Globals.CKEditor(txtContent);
            //txtFileImages.Attributes.Add("style", "Width:250px");
            ltlNote.Text         = Language.GetTextByID(28);
            ltlRequireTitle.Text = "Nhập đầy đủ các trường bắt buộc !"; //Language.GetTextByID(30);
            ltlGroup.Text        = Language.GetTextByID(91);
            ltlRequireGroup.Text = Language.GetTextByID(94);
            btnRegister.Text     = Language.GetTextByID(37);

            clsHoivien hoivien = new clsHoivien();
            DataRow    dr      = hoivien.GetInfo(id);

            if (dr == null)
            {
                Response.Redirect(Globals.URLCurrent + "manager.aspx");
            }

            tbxTitle.Text   = dr["title"].ToString();
            tbxSummary.Text = dr["summary"].ToString();

            sGroupID = dr["groupid"].ToString();

            tbxSummary.Text             = dr["summary"].ToString();
            txtFileImages.Value         = dr["logo"].ToString();
            txtCapbac.Text              = dr["capbac"].ToString();
            txtContent.Text             = dr["Content"].ToString().Trim();
            rdpPublishDate.SelectedDate = Convert.ToDateTime(dr["created"].ToString().Trim());

            //Trees view
            treeview1.ShowCheckBoxes = TreeNodeTypes.All;
            treeview1.ShowLines      = true;
            treeview1.ExpandAll();
            BildRoot(treeview1);
        }
    }
Пример #4
0
    protected void BtSend_Click(object sender, EventArgs e)
    {
        clsHoivien hoivien = new clsHoivien();

        foreach (RepeaterItem items in rptNews.Items)
        {
            Literal ltlIDNews = (Literal)items.FindControl("ltlIDNews");
            TextBox txtSTT    = (TextBox)items.FindControl("txtSTT");
            string  id        = ltlIDNews.Text.Trim();
            hoivien.UpdateIndexHoiVien(id, Convert.ToInt32(txtSTT.Text.ToString()));
        }
        Response.Redirect(Globals.UrlRoot + "temp.aspx?url=" + Request.Url);
    }
Пример #5
0
    protected void BtDelete_Click(object sender, EventArgs e)
    {
        clsHoivien hoivien = new clsHoivien();
        string     id      = string.Empty;

        foreach (RepeaterItem items in rptNews.Items)
        {
            CheckBox checkboxID = (CheckBox)items.FindControl("checkboxID");
            if (checkboxID.Checked)
            {
                Literal ltlIDNews = (Literal)items.FindControl("ltlIDNews");
                id = ltlIDNews.Text.Trim();
                //Xoa
                hoivien.Delete(id);
            }
        }
        Response.Redirect(Globals.UrlRoot + "temp.aspx?url=" + Request.Url);
    }
Пример #6
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            ltlLabTitle.Text   = Language.GetTextByID(217);
            LabHeaderCmuc.Text = Language.GetTextByID(91);
            LabTieude.Text     = Language.GetTextByID(29);
            LabNoidung.Text    = Language.GetTextByID(35);
            LabTomtat.Text     = Language.GetTextByID(31);
            LabImg.Text        = Language.GetTextByID(33);


            clsHoivien hoivien = new clsHoivien();
            DataRow    drow    = hoivien.GetInfo(newsid);

            LabTenTieude.Text  = drow["title"].ToString();
            LabND_tomtat.Text  = drow["summary"].ToString();
            LabNoidungbai.Text = hoivien.GetContent(newsid);

            string  groupid  = drow["groupid"].ToString();
            Groups  objgroup = new Groups();
            DataRow vdr      = objgroup.GetInfo(groupid);
            LabChuyenmuc.Text = vdr["title"].ToString().Trim();
            //images
            string sFile = drow["logo"].ToString().Trim();
            if (sFile.Length > 0)
            {
                string cImages = sFile.Substring(0, 4);
                if (cImages != "data")
                {
                    fImage.Attributes.Add("style", "width:100px;height:100px");
                    fImage.Src = sFile;
                }
                else
                {
                    fImage.Src = Thumbnails.viewAsThumbnails(sFile, Convert.ToInt32(drow["fwidth"].ToString()), Convert.ToInt32(drow["fheight"].ToString()), "news_m", drow["id"].ToString());
                }
            }
            else
            {
                fImage.Src = Globals.UrlRootImages + "data/images/no-image.gif";
            }
        }
    }
Пример #7
0
    protected void BtPost_Click(object sender, EventArgs e)
    {
        string sTitle   = tbxTitle.Text.Trim();
        string sTomtat  = tbxSummary.Text.Trim();
        string sImage   = txtFileImages.Value.Trim();
        string scapbac  = txtCapbac.Text.Trim();
        string sContent = txtContent.Text.Trim();
        string created  = rdpPublishDate.SelectedDate.ToString("yyyy-MM-dd HH:mm:ss");

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

        foreach (TreeNode node in treeview1.CheckedNodes)
        {
            sGroup = node.Value; //Lay da goc
        }
        if (sGroup == "" || sGroup == string.Empty || sGroup == null)
        {
            ltlRequireGroup.Visible = true;
            return;
        }
        else
        {
            ltlRequireGroup.Visible = false;
        }

        foreach (TreeNode node in treeview1.CheckedNodes)
        {
            sGroup = node.Value;    // Lay da goc
            clsHoivien hoivien = new clsHoivien();
            int        status  = 1; //Online
            string     IDNew   = hoivien.InsertHoiVien(sGroup, sTitle, sTomtat, created, status, sImage, scapbac, sContent);
        }
        Response.Redirect(Globals.URLCurrent + "manager.aspx");
    }
Пример #8
0
    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);
        }
    }