private void ViewNewsLog(int newsGroupID)
    {
        commonBSO  commonBSO  = new commonBSO();
        NewsLogBSO newsLogBSO = new NewsLogBSO();
        DataTable  table      = new DataTable();


        _page = new PagingInfo(10, Convert.ToInt32(hdnPage.Value), true);
        table = newsLogBSO.GetNewsLogPaging(Language.language, newsGroupID, _page);


        if (table.Rows.Count > 0)
        {
            TotalRecord = Convert.ToInt32(table.Rows[0]["Total"].ToString());
            SetAttributeGvArticle(Convert.ToInt32(table.Rows[0]["Total"].ToString()));
            commonBSO.FillToGridView(grvNewsLog, table);

            Paging.DataLoad();
            if (TotalPage(Convert.ToInt32(table.Rows[0]["Total"].ToString())) <= 1)
            {
                Paging.Visible = false;
            }
            else
            {
                Paging.Visible = true;
            }
        }
        else
        {
            SetAttributeGvArticle(0);
            grvNewsLog.DataSource = null;
            grvNewsLog.DataBind();
            Paging.Visible = false;
        }
    }
Beispiel #2
0
    public void ViewEmail()
    {
        EmailBSO  emailBSO  = new EmailBSO();
        DataTable table     = emailBSO.GetEmailAll();
        commonBSO commonBSO = new commonBSO();

        commonBSO.FillToGridView(grvEmail, table);
    }
Beispiel #3
0
    private void ViewContact()
    {
        ContactBSO contactBSO = new ContactBSO();
        DataTable  table      = contactBSO.GetContactAll();
        commonBSO  commonBSO  = new commonBSO();

        commonBSO.FillToGridView(grvContact, table);
    }
Beispiel #4
0
    private void ViewCateGroup(int group)
    {
        CateNewsBSO catenewsBSO = new CateNewsBSO();
        DataTable   table       = catenewsBSO.GetCateGroupRolesWithPage(Language.language, group, Session["Admin_UserName"].ToString());
        commonBSO   commonBSO   = new commonBSO();

        commonBSO.FillToGridView(grvCateNews, table);
    }
    private void ViewCateGroup()
    {
        CateNewsGroupBSO catenewsGroupBSO = new CateNewsGroupBSO();
        DataTable        table            = catenewsGroupBSO.GetCateNewsGroupAll(Language.language, Session["Admin_UserName"].ToString());
        commonBSO        commonBSO        = new commonBSO();

        commonBSO.FillToGridView(grvCateNewsGroup, table);
    }
Beispiel #6
0
    public void ViewModules()
    {
        ModulesBSO modulesBSO = new ModulesBSO();
        DataTable  table      = modulesBSO.MixModules();
        commonBSO  commonBSO  = new commonBSO();

        commonBSO.FillToGridView(GridView1, table);
    }
    private void ViewPageLayout()
    {
        SYS_PageLayoutBSO _pageBSO = new SYS_PageLayoutBSO();
        DataTable         table    = _pageBSO.GetSYS_PageLayoutAllTemplate(Language.language);

        commonBSO commonBSO = new commonBSO();

        commonBSO.FillToGridView(grvPageLayout, table);
    }
Beispiel #8
0
    private void ViewWidgetType()
    {
        SYS_WidgetTypeBSO _widgetTypeBSO = new SYS_WidgetTypeBSO();
        DataTable         table          = _widgetTypeBSO.GetSYS_WidgetTypeAll();

        commonBSO commonBSO = new commonBSO();

        commonBSO.FillToGridView(grvWidgetType, table);
    }
    private void ViewTemplate()
    {
        SYS_TemplatePageBSO templateBSO = new SYS_TemplatePageBSO();
        DataTable           table       = templateBSO.GetSYS_TemplatePageAll(Language.language);

        commonBSO commonBSO = new commonBSO();

        commonBSO.FillToGridView(grvTemplate, table);
    }
    protected void ddlCateNewsSearch_SelectedIndexChanged(object sender, EventArgs e)
    {
        commonBSO    commonBSO    = new commonBSO();
        NewsGroupBSO newsGroupBSO = new NewsGroupBSO();
        DataTable    table        = new DataTable();


        _page = new PagingInfo(20, Convert.ToInt32(hdnPage.Value), true);

        if (ddlCateNewsSearch.SelectedValue == "0")
        {
            if (!Session["Admin_UserName"].Equals("administrator"))
            {
                string strCate = GetCateParentIDArrayByID(Convert.ToInt32(ddlCateNewsGroup.SelectedValue));
                if (strCate != "")
                {
                    table = newsGroupBSO.GetNewsGroupPagingbyUser(Language.language, Convert.ToInt32(ddlCateNewsGroup.SelectedValue), strCate, _page, Session["Admin_UserName"].ToString(), 0, -1);
                }
            }
            else
            {
                table = newsGroupBSO.GetNewsGroupPagingApproved(Language.language, Convert.ToInt32(ddlCateNewsGroup.SelectedValue), "", _page, 0, -1);
            }
        }
        else
        {
            table = newsGroupBSO.GetNewsGroupPagingApproved(Language.language, Convert.ToInt32(ddlCateNewsGroup.SelectedValue), Convert.ToInt32(ddlCateNewsSearch.SelectedValue), _page, 0, -1);
        }

        if (table.Rows.Count > 0)
        {
            TotalRecord = Convert.ToInt32(table.Rows[0]["Total"].ToString());
            SetAttributeGvArticle(Convert.ToInt32(table.Rows[0]["Total"].ToString()));
            commonBSO.FillToGridView(grvNewsGroup, table);

            Paging.DataLoad();
            if (TotalPage(Convert.ToInt32(table.Rows[0]["Total"].ToString())) <= 1)
            {
                Paging.Visible = false;
            }
            else
            {
                Paging.Visible = true;
            }
        }
        else
        {
            SetAttributeGvArticle(0);
            grvNewsGroup.DataSource = null;
            grvNewsGroup.DataBind();
            Paging.Visible = false;
        }
    }
Beispiel #11
0
    protected void ViewRoles()
    {
        RolesBSO  rolesBSO = new RolesBSO();
        DataTable table    = rolesBSO.GetAllRoles();
        DataView  dataView = new DataView(table);

        dataView.RowFilter = "Roles_Name not in ('adminsys32','Administrators')";
        DataTable dataTable = dataView.ToTable();
        commonBSO commonBSO = new commonBSO();

        commonBSO.FillToGridView(grvRoles, dataTable);
    }
Beispiel #12
0
    protected void ViewAdmin()
    {
        AdminBSO  adminBSO = new AdminBSO();
        DataTable table    = adminBSO.GetAllAdminRoles();
        DataView  dataView = new DataView(table);

        //dataView.RowFilter = "Admin_Username <> 'administrator' and Admin_Username <> 'Administrator'";
        dataView.RowFilter = "Admin_Username not in ('administrator','Administrator')";
        dataView.Sort      = "Admin_Username ASC";
        DataTable dataTable = dataView.ToTable();
        commonBSO commonBSO = new commonBSO();

        commonBSO.FillToGridView(grvAdmin, dataTable);
    }
    protected void NewsCommentView(int group)
    {
        NewsCommentBSO newsCommentBSO = new NewsCommentBSO();
        DataTable      table          = new DataTable();

        if (hddNewsID.Value != "-1")
        {
            table = newsCommentBSO.GetAllNewsGroupComment(Convert.ToInt32(hddNewsID.Value), group);
        }
        else
        {
            table = newsCommentBSO.GetAllNewsGroupComment(group);
        }
        commonBSO commonBSO = new commonBSO();

        commonBSO.FillToGridView(grvNewsComment, table);
    }
    private void ViewNewsGroup(int group)
    {
        commonBSO    commonBSO    = new commonBSO();
        NewsGroupBSO newsGroupBSO = new NewsGroupBSO();
        DataTable    table        = new DataTable();


        _page = new PagingInfo(20, Convert.ToInt32(hdnPage.Value), true);

        if (!Session["Admin_UserName"].Equals("administrator"))
        {
            string strCate = GetCateParentIDArrayByID();
            if (strCate != "")
            {
                table = newsGroupBSO.GetNewsGroupPagingApproved(Language.language, group, strCate, _page, -1, 0);
            }
        }
        else
        {
            table = newsGroupBSO.GetNewsGroupPagingApproved(Language.language, group, "", _page, -1, 0);
        }

        if (table.Rows.Count > 0)
        {
            TotalRecord = Convert.ToInt32(table.Rows[0]["Total"].ToString());
            SetAttributeGvArticle(Convert.ToInt32(table.Rows[0]["Total"].ToString()));
            commonBSO.FillToGridView(grvNewsGroup, table);

            Paging.DataLoad();
            if (TotalPage(Convert.ToInt32(table.Rows[0]["Total"].ToString())) <= 1)
            {
                Paging.Visible = false;
            }
            else
            {
                Paging.Visible = true;
            }
        }
        else
        {
            SetAttributeGvArticle(0);
            grvNewsGroup.DataSource = null;
            grvNewsGroup.DataBind();
            Paging.Visible = false;
        }
    }
    private void ViewFiles(int cId)
    {
        NewsGroupFileBSO newsgroupFileBSO = new NewsGroupFileBSO();
        DataTable        table            = new DataTable();

        if (cId != 0)
        {
            table = newsgroupFileBSO.GetNewsGroupFileByNewsGroup(cId);
        }
        else
        {
            table = newsgroupFileBSO.GetNewsGroupFileAll();
        }

        commonBSO commonBSO = new commonBSO();

        commonBSO.FillToGridView(grvFiles, table);
    }
    protected void ddlGroupCate_SelectedIndexChanged(object sender, EventArgs e)
    {
        commonBSO    commonBSO    = new commonBSO();
        NewsGroupBSO newsGroupBSO = new NewsGroupBSO();
        DataTable    table        = new DataTable();


        _page = new PagingInfo(20, Convert.ToInt32(hdnPage.Value), true);

        if (ddlGroupCate.SelectedValue == "0")
        {
            table = newsGroupBSO.GetNewsGroupPaging(Language.language, -1, _page);
        }
        else
        {
            table = newsGroupBSO.GetNewsGroupPaging(Language.language, Convert.ToInt32(ddlGroupCate.SelectedValue), _page);
        }

        if (table.Rows.Count > 0)
        {
            TotalRecord = Convert.ToInt32(table.Rows[0]["Total"].ToString());
            SetAttributeGvArticle(Convert.ToInt32(table.Rows[0]["Total"].ToString()));
            commonBSO.FillToGridView(grvNewsGroup, table);

            Paging.DataLoad();
            if (TotalPage(Convert.ToInt32(table.Rows[0]["Total"].ToString())) <= 1)
            {
                Paging.Visible = false;
            }
            else
            {
                Paging.Visible = true;
            }
        }
        else
        {
            SetAttributeGvArticle(0);
            grvNewsGroup.DataSource = null;
            grvNewsGroup.DataBind();
            Paging.Visible = false;
        }

        BindCateNews(Convert.ToInt32(ddlGroupCate.SelectedValue));
    }
Beispiel #17
0
    protected void btn_search_Click(object sender, EventArgs e)
    {
        int cId = Convert.ToInt32(ddlRoles.SelectedValue);

        DataTable dataTable = new DataTable();
        commonBSO commonBSO = new commonBSO();
        string    SQL       = "";

        SQL = "SELECT * FROM tblAdmin as a INNER JOIN tblAdminRoles as b ON a.Admin_Username = b.Admin_UserName Where a.Admin_Username not in ('administrator','Administrator')";

        if (txtKeyword.Text != "")
        {
            SQL += " and a.Admin_Username like '%' + '" + Tool.safeString(txtKeyword.Text) + "' + '%'";
        }
        if (cId != 0)
        {
            SQL += " and b.RolesID=" + cId;
        }
        SQL      += " Order by a.Admin_Username ASC";
        dataTable = commonBSO.CreateDataView(SQL);
        commonBSO.FillToGridView(grvAdmin, dataTable);
    }
    private void ViewNewsReleation(int newsID)
    {
        commonBSO       commonBSO        = new commonBSO();
        NewsRelationBSO _newsRelationBSO = new NewsRelationBSO();
        DataTable       table            = new DataTable();


        _page2 = new PagingInfo(20, Convert.ToInt32(hdnPage2.Value), true);


        table = _newsRelationBSO.GetNewsRelationPaging(Language.language, newsID, _page2);


        if (table.Rows.Count > 0)
        {
            TotalRecord2 = Convert.ToInt32(table.Rows[0]["Total"].ToString());
            SetAttributeGvArticle2(Convert.ToInt32(table.Rows[0]["Total"].ToString()));
            commonBSO.FillToGridView(grvRelation, table);

            paging2.DataLoad();
            if (TotalPage2(Convert.ToInt32(table.Rows[0]["Total"].ToString())) <= 1)
            {
                paging2.Visible = false;
            }
            else
            {
                paging2.Visible = true;
            }
        }
        else
        {
            SetAttributeGvArticle2(0);
            grvRelation.DataSource = null;
            grvRelation.DataBind();
            paging2.Visible = false;
        }
    }
    protected void btn_search_Click(object sender, EventArgs e)
    {
        commonBSO    commonBSO    = new commonBSO();
        NewsGroupBSO newsGroupBSO = new NewsGroupBSO();

        string _finter = "";

        _page = new PagingInfo(20, Convert.ToInt32(hdnPage.Value), true);

        if (txtKeyword.Text != "")
        {
            if (ddlType.SelectedValue == "1")
            {
                _finter += " AND Title like N'%" + Tool.safeString(txtKeyword.Text) + "%'";
            }
            else if (ddlType.SelectedValue == "2")
            {
                _finter += " AND ShortDescribe like N'%" + Tool.safeString(txtKeyword.Text) + "%'";
            }
            else if (ddlType.SelectedValue == "0")
            {
                _finter += " AND (Title like N'%" + Tool.safeString(txtKeyword.Text) + "%' OR ShortDescribe like N'%" + Tool.safeString(txtKeyword.Text) + "%')";
            }
        }

        _finter += " And Language = '" + Language.language + "'";

        if (ddlGroupCate.SelectedValue != "0")
        {
            _finter += " And GroupCate = " + ddlGroupCate.SelectedValue;
        }

        if (ddlCateNewsSearch.SelectedValue != "0" && ddlCateNewsSearch.SelectedValue != string.Empty)
        {
            _finter += " And CateNewsID = " + ddlCateNewsSearch.SelectedValue;
        }

        IFormatProvider culture = new System.Globalization.CultureInfo("en-US", true);

        if (txtStartDateTime.Text != "")
        {
            _finter += " AND PostDate >= '" + DateTime.ParseExact(txtStartDateTime.Text, "dd/MM/yyyy HH:mm", culture) + "'";
        }

        if (txtEndDateTime.Text != "")
        {
            _finter += " AND PostDate <= '" + DateTime.ParseExact(txtEndDateTime.Text, "dd/MM/yyyy HH:mm", culture) + "'";
        }

        DataTable table = newsGroupBSO.NewsGroupSearchPaging(_finter, _page);

        if (table.Rows.Count > 0)
        {
            TotalRecord = Convert.ToInt32(table.Rows[0]["Total"].ToString());
            SetAttributeGvArticle(Convert.ToInt32(table.Rows[0]["Total"].ToString()));
            commonBSO.FillToGridView(grvNewsGroup, table);

            Paging.DataLoad();
            if (TotalPage(Convert.ToInt32(table.Rows[0]["Total"].ToString())) <= 1)
            {
                Paging.Visible = false;
            }
            else
            {
                Paging.Visible = true;
            }
        }
        else
        {
            SetAttributeGvArticle(0);
            grvNewsGroup.DataSource = null;
            grvNewsGroup.DataBind();
            Paging.Visible = false;
        }
    }
    protected void ddlTypeApproved_SelectedIndexChanged(object sender, EventArgs e)
    {
        commonBSO    commonBSO    = new commonBSO();
        NewsGroupBSO newsGroupBSO = new NewsGroupBSO();

        string _finter = "";

        _page = new PagingInfo(20, Convert.ToInt32(hdnPage.Value), true);

        if (txtKeyword.Text != "")
        {
            if (ddlType.SelectedValue == "1")
            {
                _finter += " AND Title like N'%" + Tool.safeString(txtKeyword.Text) + "%'";
            }
            else if (ddlType.SelectedValue == "2")
            {
                _finter += " AND ShortDescribe like N'%" + Tool.safeString(txtKeyword.Text) + "%'";
            }
            else if (ddlType.SelectedValue == "0")
            {
                _finter += " AND (Title like N'%" + Tool.safeString(txtKeyword.Text) + "%' OR ShortDescribe like N'%" + Tool.safeString(txtKeyword.Text) + "%')";
            }
        }

        _finter += " And Language = '" + Language.language + "'";

        if (ddlCateNewsGroup.SelectedValue != "-1" && ddlCateNewsGroup.SelectedIndex > 0)
        {
            _finter += " And GroupCate = " + ddlCateNewsGroup.SelectedValue;
        }

        if (ddlCateNewsSearch.SelectedValue != "0" && ddlCateNewsSearch.SelectedIndex > 0)
        {
            _finter += " And CateNewsID = " + ddlCateNewsSearch.SelectedValue;
        }
        else
        if (!Session["Admin_UserName"].Equals("administrator"))
        {
            string strCate = GetCateParentIDArrayByID(Convert.ToInt32(ddlCateNewsGroup.SelectedValue));
            if (strCate != "")
            {
                _finter += " AND [CateNewsID] in('" + strCate.Remove(strCate.LastIndexOf(",")).Replace(",", "','") + "')";
            }
        }
        if (!Session["Admin_UserName"].Equals("administrator"))
        {
            _finter += " AND [CreatedUserName] ='" + Session["Admin_UserName"].ToString() + "'";
        }
        _finter += " AND isDelete = 0";

        IFormatProvider culture = new System.Globalization.CultureInfo("en-US", true);

        if (txtStartDateTime.Text != "")
        {
            _finter += " AND PostDate >= '" + DateTime.ParseExact(txtStartDateTime.Text, "dd/MM/yyyy HH:mm", culture) + "'";
        }

        if (txtEndDateTime.Text != "")
        {
            _finter += " AND PostDate <= '" + DateTime.ParseExact(txtEndDateTime.Text, "dd/MM/yyyy HH:mm", culture) + "'";
        }

        if (ddlTypeApproved.SelectedValue == "1")
        {
            _finter += " AND isApproval = 0";
        }
        else if (ddlTypeApproved.SelectedValue == "2")
        {
            _finter += " AND isApproval = 1 AND status = 1";
        }
        else if (ddlTypeApproved.SelectedValue == "3")
        {
            _finter += " AND status = 0";
        }

        DataTable table = newsGroupBSO.NewsGroupSearchPaging(_finter, _page);

        if (table.Rows.Count > 0)
        {
            TotalRecord = Convert.ToInt32(table.Rows[0]["Total"].ToString());
            SetAttributeGvArticle(Convert.ToInt32(table.Rows[0]["Total"].ToString()));
            commonBSO.FillToGridView(grvNewsGroup, table);

            Paging.DataLoad();
            if (TotalPage(Convert.ToInt32(table.Rows[0]["Total"].ToString())) <= 1)
            {
                Paging.Visible = false;
            }
            else
            {
                Paging.Visible = true;
            }
        }
        else
        {
            SetAttributeGvArticle(0);
            grvNewsGroup.DataSource = null;
            grvNewsGroup.DataBind();
            Paging.Visible = false;
        }
    }