//Biniding content
    protected void BindContents(string search = "")
    {
        this.Form.DefaultButton = imgbtnSearch.UniqueID;

        languageManager objlanguage = new languageManager();
        DataTable       dtcontents  = new DataTable();

        try
        {
            objlanguage.languageName = Server.HtmlEncode(txtsearch.Text.Trim());
            if (pageNo == 0)
            {
                pageNo = 1;
            }
            objlanguage.pageNo         = pageNo;
            objlanguage.pageSize       = pageSize;
            objlanguage.SortExpression = SortExpression;
            querystring = "&key=" + txtsearch.Text;
            //querystring = "&pageSize=" + ddlpageSize.SelectedValue + "&key=" + txtsearch.Text;
            dtcontents = objlanguage.SearchItem();
            totalrecs  = objlanguage.TotalRecord;
            if (pageNo == 1)
            {
                objlanguage.pageNo = 1;
                pageNo             = 1;
            }
            else if (pageNo == 0)
            {
                objlanguage.pageNo = 1;
                pageNo             = 1;
            }
            else
            {
                objlanguage.pageNo = (pageNo - 1) * pageSize;
            }
            objlanguage.pageSize = pageSize;
            totalpages           = totalrecs / pageSize;
            if ((totalrecs % pageSize) > 0 && (totalrecs > pageSize))
            {
                totalpages += 1;
            }
            gvAdmin.DataSource = dtcontents;
            gvAdmin.DataBind();
            if (dtcontents.Rows.Count > 0)
            {
                int startRowOnPage = (gvAdmin.PageIndex * gvAdmin.PageSize) + 1;
                int lastRowOnPage  = startRowOnPage + gvAdmin.Rows.Count - 1;
                int totalRows      = totalrecs;
                ltrcountrecord.Text = "<div class=\"countdiv\">Showing " + startRowOnPage.ToString() + " to " + lastRowOnPage + " of " + totalRows + " entries</div>";
            }
            String strpaging = CommonFunctions.AdminPaging(totalpages, pageNo, querystring, "viewlanguage.aspx");
            ltrpaggingbottom.Text = strpaging;
            //Ltrup.Text = strpaging;
            LoadDropDownList();
        }
        catch (Exception ex) { throw ex; }
    }
Esempio n. 2
0
    //Biniding content
    protected void BindContents(string search = "")
    {
        importjobManager objimportjob = new importjobManager();
        DataTable        dtcontents   = new DataTable();

        try
        {
            objimportjob.id          = Convert.ToInt32(Request.QueryString["id"]);
            objimportjob.productname = "";

            //objlanguage.languagename = Server.HtmlEncode(txtsearch.Text.Trim());
            if (pageNo == 0)
            {
                pageNo = 1;
            }
            objimportjob.pageNo         = pageNo;
            objimportjob.pageSize       = pageSize;
            objimportjob.SortExpression = SortExpression;
            querystring = "&id=" + Request.QueryString["id"] + "&filename=" + Request.QueryString["filename"] + "&filetp=" + Request.QueryString["filetp"] + "&pageSize=" + ddlpageSize.SelectedValue;
            //if (Convert.ToInt32(Request.QueryString["iptp"]) == 1)
            //{
            //    dtcontents = objimportjob.SearchImportJobs();
            //}
            //else
            //{
            dtcontents = objimportjob.SearchImportJobs();
            //}
            totalrecs = objimportjob.TotalRecord;

            if (pageNo == 1)
            {
                objimportjob.pageNo = 1;
                pageNo = 1;
            }
            else if (pageNo == 0)
            {
                objimportjob.pageNo = 1;
                pageNo = 1;
            }
            else
            {
                objimportjob.pageNo = (pageNo - 1) * pageSize;
            }
            objimportjob.pageSize = pageSize;
            totalpages            = totalrecs / pageSize;
            if ((totalrecs % pageSize) > 0 && (totalrecs > pageSize))
            {
                totalpages += 1;
            }
            gvImportjob.DataSource = dtcontents;
            gvImportjob.DataBind();
            if (dtcontents.Rows.Count > 0)
            {
                lblinsertfilecount.Text = "Proccessed <b>" + dtcontents.Rows[0]["Proccessed"] + "</b> rows of which <b>" + dtcontents.Rows[0]["NoErrorLine"] + "</b> passed validation and <b>" + dtcontents.Rows[0]["ErrorLine"] + "</b> failed.";
                int startRowOnPage = (gvImportjob.PageIndex * gvImportjob.PageSize) + 1;
                int lastRowOnPage  = startRowOnPage + gvImportjob.Rows.Count - 1;
                int totalRows      = totalrecs;
                ltrcountrecord.Text = "<div class=\"countdiv\">Showing " + startRowOnPage.ToString() + " to " + lastRowOnPage + " of " + totalRows + " entries</div>";
            }
            String strpaging = CommonFunctions.AdminPaging(totalpages, pageNo, querystring, "ViewImportJobDetails.aspx");
            ltrpaggingbottom.Text = strpaging;
            //LoadDropDownList();
        }
        catch (Exception ex) { throw ex; }
    }