public void LoadUnSelectedProduct(bool IsResetPageIndex, bool IsSort)
 {
     if (ddlProductCategory.SelectedIndex > 0)
     {
         objCouponCodeProduct = new tblCouponCodeProduct();
         objDataTable         = objCouponCodeProduct.LoadUnSelectedCategories(Convert.ToInt32(hdnType.Value), hdnPKID.Value, ddlProductCategory.SelectedValue, ddlSubCate.SelectedValue);
         if (IsResetPageIndex)
         {
             if (dgvProduct.PageCount > 0)
             {
                 dgvProduct.PageIndex = 0;
             }
         }
         dgvProduct.DataSource = null;
         dgvProduct.DataBind();
         lblProductCount.Text = 0.ToString();
         hdnSelectedIDs.Value = "";
         //'Check for data into datatable
         if (objDataTable.Rows.Count <= 0)
         {
             DinfoProduct.ShowMessage("No data found", Enums.MessageType.Information);
             return;
         }
         else
         {
             dgvProduct.AllowPaging = false;
             lblProductCount.Text   = objDataTable.Rows.Count.ToString();
             objDataTable           = SortDatatable(objDataTable, ViewState["SortColumn"].ToString(), (appFunctions.Enum_SortOrderBy)ViewState["SortOrder"], IsSort);
             dgvProduct.DataSource  = objDataTable;
             dgvProduct.DataBind();
         }
         objCouponCodeProduct = null;
     }
 }
Beispiel #2
0
    public void LoadBestSeller1(bool IsResetPageIndex, bool IsSort, string strFieldName = "", string strFieldValue = "")
    {
        tblBestSeller objBestSeller = new tblBestSeller();

        // objDataTable = objProduct.LoadBestSeller(ddlCategory.SelectedValue, ddlSubCate.SelectedValue, ddlColor.SelectedValue);
        objDataTable = objBestSeller.LoadBestSelllerList(ddlCategory.SelectedValue, ddlSubCate.SelectedValue, ddlColor.SelectedValue);


        if (IsResetPageIndex)
        {
            if (dgvProduct.PageCount > 0)
            {
                dgvProduct.PageIndex = 0;
            }
        }

        dgvProduct.DataSource = null;
        dgvProduct.DataBind();
        lblProductCount.Text = 0.ToString();
        hdnSelectedIDs.Value = "";

        //'Check for data into datatable
        if (objDataTable.Rows.Count <= 0)
        {
            DinfoProduct.ShowMessage("No data found", Enums.MessageType.Information);
            return;
        }
        else
        {
            if (ddlPerPage.SelectedItem.Text.ToLower() == "all")
            {
                dgvProduct.AllowPaging = false;
            }
            else
            {
                dgvProduct.AllowPaging = true;
                dgvProduct.PageSize    = Convert.ToInt32(ddlPerPage.SelectedItem.Text);
            }

            lblProductCount.Text  = objDataTable.Rows.Count.ToString();
            objDataTable          = SortDatatable(objDataTable, ViewState["SortColumn"].ToString(), (appFunctions.Enum_SortOrderBy)ViewState["SortOrder"], IsSort);
            dgvProduct.DataSource = objDataTable;
            dgvProduct.DataBind();
        }

        objBestSeller = null;
    }