Пример #1
0
    protected void BindDatagrid(string where)
    {
        lblMsg.Visible         = false;
        dgRequestQuote.Visible = true;
        Pager1.Visible         = true;

        DataTable dtRequestQuote = requestQuote.GetRequestQuote(where);

        if (dtRequestQuote.Rows.Count > 0)
        {
            dtRequestQuote.DefaultView.Sort = (hidSort.Value == "") ? "SessionID desc" : hidSort.Value;
            dgRequestQuote.DataSource       = dtRequestQuote.DefaultView.ToTable();

            if (dtRequestQuote.Rows.Count >= 15)
            {
                Pager1.InitPager(dgRequestQuote, 15);
            }
            else
            {
                Pager1.InitPager(dgRequestQuote, dtRequestQuote.Rows.Count);
                Pager1.Visible = false;
            }
        }
        else
        {
            lblMsg.Visible         = true;
            dgRequestQuote.Visible = false;
            Pager1.Visible         = false;
        }

        upnlQuote.Update();
    }
Пример #2
0
        void PagingDataBind(DataTable dt)
        {
            DataTable itemdt = new DataTable();

            if (Null.IsNotNull(dt))
            {
                itemdt = dt;
                if (Null.IsNotNull(itemdt) && itemdt.Rows.Count > 0)
                {
                    Pager1.DataSource = itemdt;
                    Pager1.DataBind();

                    if (itemdt.Rows.Count > Pager1.PageSize)
                    {
                        Pager1.Visible = true;
                    }
                    else
                    {
                        Pager1.Visible = false;
                    }
                }
                else
                {
                    Pager1.Visible = false;
                }
            }
        }
Пример #3
0
    /// <summary>
    /// 查询按钮
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void BtnConfirm_Click(object sender, EventArgs e)
    {
        StringBuilder sb        = new StringBuilder();
        int           docTpyeId = Convert.ToInt32(QueryInStorageBLL.GetDocTypeIDEByDocTypeCode("BY"));

        sb.Append(" 1=1 and a.DocTypeID=" + docTpyeId);

        ////判断国家
        //UserControl_Country cou = Page.FindControl("Country1") as UserControl_Country;
        //if (cou.CID > 0)
        //{
        //    sb.Append(" and b.ID=" + cou.CID);
        //}
        //仓库
        if (Convert.ToInt32(ddlcangku.SelectedValue) > 0)
        {
            sb.Append(" and a.WareHouseID=" + ddlcangku.SelectedValue);
        }
        //库位
        if (Convert.ToInt32(ddlkuwei.SelectedValue) > 0)
        {
            sb.Append(" and a.DepotSeatID=" + ddlkuwei.SelectedValue);
        }


        string colunmns = " a.ID,a.DocTypeID,a.DocID,a.DocMakeTime,a.DocMaker,a.Client,d.warehousename,a.TotalMoney,c.seatname,a.TotalPV,a.ExpectNum,a.Note,a.StateFlag,a.CloseFlag,a.CloseDate,a.BatchCode,a.OriginalDocID,a.Address,a.Flag,a.Charged,a.Reason";
        string table    = "InventoryDoc a left outer join warehouse d on d.warehouseid=a.WareHouseID left outer join DepotSeat c on a.DepotSeatID=c.depotseatid";

        ViewState["SQLSTR"] = "select " + colunmns + " from " + table + " where " + sb.ToString() + " order by a.ID desc";

        Pager1.PageBind(0, 10, table, colunmns, sb.ToString(), "a.ID", "givDoc");
    }
Пример #4
0
    private void cargarProductoLista()
    {
        try
        {
            string ordenar = "order by p.[nombre] asc";

            List <Producto> _cache        = new List <Producto>();
            string          armadoDeQuery = "@familiaId in(" + familiaIdHiddenField.Value + ")";
            string          query         = consultaSql(armadoDeQuery).SqlQuery();
            _totalRows = ProductoBLL.SearchProductoPaginacion(ref _cache, query, Pager1.PageSize, Pager1.CurrentRow, ordenar);
            familiaForIdRepeater.DataSource = _cache;
            familiaForIdRepeater.DataBind();

            Pager1.TotalRows = _totalRows;
            if (_cache.Count == 0)
            {
                noResult.Visible     = true;
                Pager1.Visible       = false;
                PagesButtons.Visible = true;
                return;
            }
            noResult.Visible = false;
            Pager1.Visible   = true;
            Pager1.BuildPagination();
        }
        catch (Exception ex)
        {
            log.Error("error al cargar la lista de articulos", ex);
            throw ex;
            //return;
        }
    }
Пример #5
0
        getResourceByApplication(int applicationID, int curPage)
        {
            try
            {
                ResourceManager    rsMan     = new ResourceManager();
                ResourceCollection resources = rsMan.FindResourcesByApplication(applicationID);

                PagedDataSource page = new PagedDataSource();
                page.AllowPaging      = true;
                page.PageSize         = pagesize;
                page.CurrentPageIndex = curPage;
                page.DataSource       = resources;
                Pager1.SetPageNumber(page.PageCount, curPage);

                dgridResource.DataSource = page;
                dgridResource.DataBind();
                CurrentFormState = FormState.Default;
            }
            catch (Exception ex)
            {
                ucErrorBox.Message = "Get resources by Application: " + ex.Message;
                CurrentFormState   = FormState.ErrorState;
                this.SaveErrorLog(ex);
            }
        }
        protected void Button1_Click(object sender, EventArgs e)
        {
            DataTable dt = mypage.GetMainListAll(sAccount.GetAccInfo().Account.ToString().Trim(), sAccount.GetAccInfo().Com_Isempno.ToString().Trim(), tbxkeyword.Text.Trim(), tbxstartdate.Text.Trim(), tbxenddate.Text.Trim());

            Pager1.Dtdata = dt;
            Pager1.Bind();
        }
Пример #7
0
    public void getbind()
    {
        string        table  = @" withdraw w 
 left join memberinfo m1 on w.number = m1.Number ";
        string        clounm = @" w.id,w.pricejb, m1.mobiletele,  w.shenhestate  , w.auditingtime,w.actype, w.WithdrawTime,w.withdrawmoney,w.number,m1.Name as tname, w.InvestJB,
w.DrawCardtype,w.AliNo,w.WeiXNo  ";
        StringBuilder sb     = new StringBuilder();

        sb.Append(" 1=1  ");

        if (txtsnumber.Text.Trim() != "")
        {
            sb.Append(" and m1.mobiletele  = '" + txtsnumber.Text.Trim() + "'");
        }
        if (txtbeigandate.Text.Trim() != "")
        {
            sb.Append(" and w.WithdrawTime >= '" + txtbeigandate.Text.Trim() + " 00:00:00'");
        }
        if (txtenddate.Text.Trim() != "")
        {
            sb.Append(" and w.WithdrawTime <= '" + txtenddate.Text.Trim() + " 23:59:59'");
        }
        if (DropDownList1.SelectedValue != "-2")
        {
            sb.Append(" and w.shenhestate in(" + DropDownList1.SelectedValue + ")");
        }
        else
        {
            sb.Append(" and w.shenhestate  in(-1,0,1)");
        }

        Pager1.PageBind(0, 10, table, clounm, sb.ToString(), "w.id", "Repeater1");
    }
    private void BindDataGrid()
    {
        sortExpression = ((hidSort.Value != "") ?  hidSort.Value : keyColumn);

        //dtQuoteAndOrder = eCommerceReport.GetQuote2OrderData(periodMonth, periodYear,customerNo);
        //dtQuote2Order = eCommerceReport.CreateJoins(dtQuoteAndOrder, GetCustomers());
        //dtQuote2Order.DefaultView.Sort = hidSort.Value;

        dtQuote2Order = eCommerceReport.GetQuote2OrderData(periodMonth, periodYear, startDate, endDate, locationCode, customerNo, repNo, priceCdCtl);
        

        if (dtQuote2Order != null && dtQuote2Order.Rows.Count > 0)
        {
            dtQuote2Order.DefaultView.Sort = hidSort.Value;
            dgQuote2Order.DataSource = dtQuote2Order.DefaultView.ToTable();
            Pager1.Visible = true;
            Pager1.InitPager(dgQuote2Order, pagesize);
            lblStatus.Visible = false;
        }
        else
        {
            Pager1.Visible = false;
            lblStatus.Visible = true;
            lblStatus.Text = "No Records Found";
        }
    }
Пример #9
0
        private void LoadApplicationList(int curPage)
        {
            ApplicationManager    app  = new ApplicationManager();
            ApplicationCollection apps = new ApplicationCollection();

            apps = app.GetAllApplications();
            if (apps.Count == 0)
            {
                uctErrorBox.Visible = true;
                uctErrorBox.Message = "Không có dữ liệu";
                return;
            }

            PagedDataSource page = new PagedDataSource();

            page.AllowPaging      = true;
            page.PageSize         = pagesize;
            page.CurrentPageIndex = curPage;
            page.DataSource       = apps;

            //if (!IsPostBack)
            //{
            Pager1.SetPageNumber(page.PageCount, curPage);
            //}

            dgridApplicationList.DataSource = page;
            dgridApplicationList.DataBind();
        }
Пример #10
0
        protected void LoadSearch()
        {
            int recordcount;

            List <ProductListView> p = ControllerManager.Product.GetProductList(param, out recordcount);

            param.Pagecount = Convert.ToInt32(Math.Ceiling(Convert.ToDouble(recordcount) / Convert.ToDouble(param.PageSize)));

            QuantitySelectedAndChecked(recordcount);

            if (recordcount == 0)
            {
                recordcount = param.PageSize;
            }

            Pager1.PageCount   = Convert.ToInt32(Math.Ceiling(Convert.ToDouble(recordcount) / Convert.ToDouble(param.PageSize)));
            Pager1.CurrentPage = param.PageNumber;
            Pager1.Step        = 10;
            Pager1.DataBind();

            rpterProductList.DataSource = p;
            rpterProductList.DataBind();

            ScriptManager.RegisterStartupScript(this.UpdatePanel1, GetType(), "closePopup", "<script>closePopup();</script>", false);
            ScriptManager.RegisterStartupScript(this.upFilters, GetType(), "closePopup", "<script>closePopup();</script>", false);
            ScriptManager.RegisterStartupScript(this.upFilters_Data, GetType(), "closePopup", "<script>closePopup();</script>", false);
        }
Пример #11
0
    public void getbind()
    {
        string        table  = "MemberAccount";
        string        clounm = "id, Number,HappenTime,HappenMoney,BalanceMoney,Direction,SfType,KmType,Remark	";
        StringBuilder sb     = new StringBuilder();

        sb.Append("   KmType =0 and Remark like '%违约'  ");

        if (txtnumber.Text.Trim() != "")
        {
            sb.Append(" and r.remitnumber = '" + txtnumber.Text.Trim() + "'");
        }

        if (txtbeigandate.Text.Trim() != "")
        {
            sb.Append(" and r.remittancesdate >= '" + txtbeigandate.Text.Trim() + " 00:00:00'");
        }
        if (txtenddate.Text.Trim() != "")
        {
            sb.Append(" and r.remittancesdate <= '" + txtenddate.Text.Trim() + " 23:59:59'");
        }


        object obj = DAL.DBHelper.ExecuteScalar("select  sum(isnull(HappenMoney,0))  from " + table + "  where " + sb);

        lblwyjzj.Text = Convert.ToDouble((obj == null || obj == DBNull.Value)?0:obj).ToString("0.00");



        Pager1.PageBind(0, 10, table, clounm, sb.ToString(), "id", "Repeater1");
    }
Пример #12
0
    private void BindDataGrid()
    {
        sortExpression = ((hidSort.Value != "") ?  hidSort.Value : keyColumn);

        //dtQuoteAndOrder = eCommerceReport.GetQuote2OrderData(periodMonth, periodYear,customerNo);
        //dtQuote2Order = eCommerceReport.CreateJoins(dtQuoteAndOrder, GetCustomers());
        //dtQuote2Order.DefaultView.Sort = hidSort.Value;

        DataTable dtCCR = CCR.GetContactReport(strBranch, strCustType, strContactType, strBG, strFilterDt);

        if (dtCCR.Rows.Count > 0)
        {
            dtCCR.DefaultView.Sort = hidSort.Value;
            dgReport.DataSource    = dtCCR.DefaultView.ToTable();
            //dgReport.DataBind();
            Pager1.Visible = true;
            Pager1.InitPager(dgReport, pagesize);
            lblStatus.Visible = false;
        }
        else
        {
            Pager1.Visible    = false;
            lblStatus.Visible = true;
            lblStatus.Text    = "No Records Found";
        }
    }
Пример #13
0
 public void BindDataGrid(DataTable dtCerts)
 {
     Session["CertsInformation"] = dtCerts;
     gvCertificates.DataSource   = dtCerts;
     gvCertificates.DataBind();
     Pager1.InitPager(gvCertificates, pageSize);
 }
Пример #14
0
    private void GetShopList()
    {
        StringBuilder sb    = new StringBuilder();
        string        table = "V_DroppedMessage";

        sb.Append(" Operator='" + Session["Member"].ToString() + "' and OperatorType=2 ");

        if (this.txtBeginTime.Text != "" && this.txtEndTime.Text != "")
        {
            string beginDate = this.txtBeginTime.Text.Trim() + " 00:00:00";
            string endDate   = this.txtEndTime.Text.Trim() + " 23:59:59";
            if (Convert.ToDateTime(beginDate) > Convert.ToDateTime(endDate))
            {
                Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert("" + GetTran("000755", "起始时间不能大于终止之间") + "!"));
                return;
            }
            sb.Append(" and dateadd(hour," + BLL.other.Company.WordlTimeBLL.ConvertAddHours() + ",Senddate)>='" + beginDate + "'" + "and dateadd(hour," + BLL.other.Company.WordlTimeBLL.ConvertAddHours() + ",Senddate)<='" + endDate + "'");
        }
        ViewState["SQLSTR"] = "select * from V_DroppedMessage where " + sb.ToString();

        Pager1.Pageindex   = 0;
        Pager1.PageSize    = 10;
        Pager1.PageTable   = table;
        Pager1.Condition   = sb.ToString();
        Pager1.PageColumn  = "* ";
        Pager1.ControlName = "GridView1";
        Pager1.PageCount   = 0;
        Pager1.key         = "id";
        Pager1.PageBind();
    }
Пример #15
0
    private void BindDataGrid()
    {
        dtUnrcvdPO = (DataTable)Session["dtPO"];

        TotLines             = dtUnrcvdPO.DefaultView.ToTable().Rows.Count;
        lblTotLines.Text     = "Total number of lines: " + String.Format("{0:n0}", TotLines);
        TotQtyOrd            = Convert.ToDecimal(dtUnrcvdPO.Compute("sum(QtyOrdered)", ""));
        lblTotQtyOrd.Text    = String.Format("{0:n0}", TotQtyOrd);
        TotQtyRcvd           = Convert.ToDecimal(dtUnrcvdPO.Compute("sum(QtyReceived)", ""));
        lblTotQtyRcvd.Text   = String.Format("{0:n0}", TotQtyRcvd);
        TotQtyDue            = Convert.ToDecimal(dtUnrcvdPO.Compute("sum(QtyDue)", ""));
        lblTotQtyDue.Text    = String.Format("{0:n0}", TotQtyDue);
        TotExtCost           = Convert.ToDecimal(dtUnrcvdPO.Compute("sum(ExtendedCost)", ""));
        lblTotExtCost.Text   = String.Format("{0:c}", TotExtCost);
        tblGrdTotals.Visible = true;

        dtUnrcvdPOCat = SelectDistinct(dtUnrcvdPO.DefaultView.ToTable(), "CatNo");
        //if (!string.IsNullOrEmpty(txtCat.Text.ToString()))
        //    dtUnrcvdPOCat.DefaultView.RowFilter = "CatNo = '" + txtCat.Text.ToString() + "'";
        dtUnrcvdPOCat.DefaultView.Sort = "CatNo ASC";
        dgUnrcvdPOCat.DataSource       = dtUnrcvdPOCat.DefaultView.ToTable();
        dgUnrcvdPOCat.AllowPaging      = true;
        dgUnrcvdPOCat.DataBind();

        pnlRptGrid.Update();

        Pager1.InitPager(dgUnrcvdPOCat, 1);
        Pager1.Visible = true;
        pnlPager.Update();
    }
Пример #16
0
    protected void BindGrid()
    {
        string GridColumns = "Hdr.BOLNo, max(BOLDate) as BolDate, sum(Det.UOMatlAmt) as BOLMatl";

        GridColumns += ", sum(UODutyAmt + UOOceanFrghtAmt + UOBrokerageAmt + UODrayAmt + UOMerchProcFee + UOHarborMaintFee + isnull(UOMiscWghtFee,0) + UOTrkFrghtAmt) as BOLLanded";
        GridColumns += ", 0.0 as APMatl, 0.0 as APLanded, 0.0 as GERvsAP, 0.0 as APVariance, 0.0 as GERTot, 0.0 as APTot, 0.0 as TotalVariance";
        ds           = SqlHelper.ExecuteDataset(ConfigurationManager.AppSettings["ReportsConnectionString"].ToString(), "[UGEN_SP_Select]",
                                                new SqlParameter("@tableName", "GERHeaderHist Hdr inner join GERDetailHist Det on Hdr.BOLNo=Det.BOLNo"),
                                                new SqlParameter("@displayColumns", GridColumns),
                                                new SqlParameter("@whereCondition", "Hdr.BOLNo='" + BOL + "' group by Hdr.BOLNo order by Hdr.BOLNo"));
        dt = ds.Tables[0];
        if (dt.Rows.Count == 0)
        {
            lblErrorMessage.Text = "Nothing on file for BOL " + BOL;
        }
        else
        {
            //lblSuccessMessage.Text = "BOL " + BOL + " processed";
            foreach (DataRow row in dt.Rows)
            {
                row["GERTot"] = (decimal)row["BOLMatl"] + (decimal)row["BOLLanded"];
                GetNVData(row);
                row["APTot"]         = (decimal)row["APMatl"] + (decimal)row["APLanded"] + (decimal)row["APVariance"];
                row["GERvsAP"]       = (decimal)row["GERTot"] - ((decimal)row["APMatl"] + (decimal)row["APLanded"]);
                row["TotalVariance"] = (decimal)row["GERTot"] - (decimal)row["APTot"];
            }
        }
        ReconGrid.DataSource = dt.DefaultView.ToTable();
        Pager1.InitPager(ReconGrid, pagesize);
    }
Пример #17
0
        protected void SearchAndFillRepeater(IList <IFilter> filters)
        {
            int    totalRecords = 0;
            object o            = OnSetDataSource(filters, out totalRecords);

            GridHelper.PageNumber    = Utils.AdjustPageNumber(GridHelper.PageNumber, GridHelper.PageSize, totalRecords);
            this.grdItems.DataSource = o;

            this.grdItems.DataBind();

            GridHelper.SetSearchDate(DateTime.Now);
            GridHelper.TotalRecords = totalRecords;

            hidTotal.Value = GridHelper.TotalRecords.ToString();

            //lnkCheckAll.Enabled = true;
            //if (GridHelper.TotalRecords == 0)
            //    lnkCheckAll.Enabled = false;

            QuantitySelectedAndChecked();

            Pager1.PageCount   = Convert.ToInt32(Math.Ceiling(Convert.ToDouble(GridHelper.TotalRecords) / Convert.ToDouble(GridHelper.PageSize)));
            Pager1.CurrentPage = GridHelper.PageNumber;
            Pager1.Step        = 10;
            Pager1.DataBind();
        }
Пример #18
0
    protected void Page_Load(object sender, EventArgs e)
    {
        Ajax.Utility.RegisterTypeForAjax(typeof(WOFind));

        if (!IsPostBack)
        {
            GetSecurity();

            dgFind.PageSize = PageSize;

            ViewState["MaxRowCount"] = BusinessLogic.GetSQLWarningRowCount();
            //ViewState["MaxRowCount"] = "9999";

            BindFindControls();
            ClearFindControls();

            dtStartDt.SelectedDate = DateTime.Now.AddDays(-7).ToShortDateString();
            dtEndDt.SelectedDate   = DateTime.Now.ToShortDateString();

            dtEmpty.Clear();
            dgFind.DataSource = dtEmpty.DefaultView.ToTable();
            dgFind.DataBind();
            Pager1.InitPager(dgFind, PageSize);
        }
    }
Пример #19
0
    public void BindDataGrid()
    {
        stDate  = Convert.ToDateTime(ddlStMonth.SelectedValue.ToString() + "/01/" + ddlStYear.SelectedValue.ToString());
        endDate = Convert.ToDateTime(ddlEndMonth.SelectedValue.ToString() + "/28/" + ddlEndYear.SelectedValue.ToString());

        PrintDialogue1.CustomerNo = custNumber;
        PrintDialogue1.PageTitle  = "Sales history for " + custNumber;
        string TempUrl = "saleshistoryExport.aspx?CustomerNumber=" + custNumber + "&SONumber=" + hidSoNumber.Value.ToString() + "&frmMonth=" + ddlStMonth.SelectedValue.ToString() + "&frmYear=" + ddlStYear.SelectedValue.ToString() + "&endMonth=" + ddlEndMonth.SelectedValue.ToString() + "&endYear=" + ddlEndYear.SelectedValue.ToString();

        PrintDialogue1.PageUrl = Server.UrlEncode(TempUrl);

        dsSalesHistory = salesHis.GetSalesHistory(custNumber, stDate, endDate);
        if (dsSalesHistory.Rows.Count > 0 && dsSalesHistory != null)
        {
            lblMsg.Visible = false;
        }
        else
        {
            lblMsg.Text    = "No Records found";
            lblMsg.Visible = true;
        }

        dsSalesHistory.DefaultView.Sort = (hidSort.Value == "") ? "itemNo asc" : hidSort.Value;
        dgSalesHistory.DataSource       = dsSalesHistory;
        Pager1.InitPager(dgSalesHistory, pagesize);
        upSalesHistoryGrid.Update();
    }
Пример #20
0
    private void BindDataGrid()
    {
        if (PageMode != "pircemode")
        {
            string    dbSourcetype = (PageMode != "itemhistory" ? "getgriditems" : "getitemhistory");
            DataTable dtCompItems  = GetCompetitorTablesData(dbSourcetype, hidRegionId.Value, ddlCompName.SelectedItem.Value, PFCItemNo, "");

            if (dtCompItems != null)
            {
                if (PageMode == "itemhistory")
                {
                    dgCompPrice.Columns[0].Visible = false;
                }

                dtCompItems.DefaultView.Sort = (hidSort.Value == "") ? "" : hidSort.Value;
                dgCompPrice.DataSource       = dtCompItems.DefaultView.ToTable();
                Pager1.InitPager(dgCompPrice, 50);
                Pager1.Visible = true;
                //dgCompPrice.DataBind();
                upnlGrid.Update();
                if (dtCompItems.Rows.Count == 0)
                {
                    DisplaStatusMessage("No Records Found", "Fail");
                }
            }
            else
            {
                DisplaStatusMessage("No Records Found", "Fail");
            }
        }
    }
Пример #21
0
        /// <summary>
        /// 绑定角色信息
        /// </summary>
        private void DBindMyRole(string rName)
        {
            #region 分页
            string sqlWhere = "";
            int    pageNum  = 1;
            if (!string.IsNullOrEmpty(Request.QueryString["RName"]))
            {
                rName = Request.QueryString["RName"];
            }
            if (!string.IsNullOrEmpty(rName))
            {
                sqlWhere = "  Role_Name like '%" + rName.Trim() + "%'";
            }

            try
            {
                if (!string.IsNullOrEmpty(Request.QueryString["Page"]))             //页数判断
                {
                    pageNum = Convert.ToInt32(Request.QueryString["Page"]);
                }
            }
            catch (Exception)
            {
                pageNum = 1;
            }
            string sql = mRole.GetListRoleInfo(rName);
            //分页方法
            Pager1.GetDataBind("Repeater", "RepeaterMyRole", sql, pageNum, 10, "", "rownum", "SystemRoleInfo.aspx?id=" + Request.QueryString["id"] + "&RName=" + rName + "&");

            #endregion
        }
Пример #22
0
        protected void LoadSearch()
        {
            int recordcount = 0;

            param.PageSize = Convert.ToInt32(ddlPageSize.SelectedValue);

            List <ProductListView> p = ControllerManager.Product.GetProductList(param, out recordcount);

            param.Pagecount = Convert.ToInt32(Math.Ceiling(Convert.ToDouble(recordcount) / Convert.ToDouble(param.PageSize)));

            TotalCount = recordcount;

            QuantitySelectedAndChecked();

            if (recordcount == 0)
            {
                recordcount = param.PageSize;
            }

            Pager1.PageCount   = Convert.ToInt32(Math.Ceiling(Convert.ToDouble(recordcount) / Convert.ToDouble(param.PageSize)));
            Pager1.CurrentPage = param.PageNumber;
            Pager1.Step        = 10;
            Pager1.DataBind();

            rpterProductList.DataSource = p;
            rpterProductList.DataBind();

            searchDate = DateTime.Now;
        }
Пример #23
0
    private void BindDataGrid()
    {
        sortExpression = ((hidSort.Value != "") ?  hidSort.Value : keyColumn);

        dsQuoteAnalysis = eCommerceReport.GetDtlData(periodMonth, periodYear, startDate, endDate, branchNo, customerNo, orderSource, sourceType, itemNotOrd, quoteNumber);
        dtQuoteAnalysis = eCommerceReport.AverageCostJoins(dsQuoteAnalysis.Tables[0], eCommerceReport.GetAverageCost(dsQuoteAnalysis.Tables[0]));

        DataColumn dcAverageCost = new DataColumn("MarginPercentage", System.Type.GetType("System.Double"));

        dcAverageCost.Expression = "IIF([UnitPrice]=0, 0,(((UnitPrice - AvgCost) / UnitPrice) * 100))";
        dtQuoteAnalysis.Columns.Add(dcAverageCost);
        dtQuoteAnalysis.DefaultView.Sort = sortExpression;

        if (dtQuoteAnalysis.Rows.Count > 0)
        {
            dgQuoteAnalysis.DataSource = dtQuoteAnalysis.DefaultView.ToTable();
            Pager1.Visible             = true;
            Pager1.InitPager(dgQuoteAnalysis, pagesize);
            lblStatus.Visible = false;
        }
        else
        {
            Pager1.Visible    = false;
            lblStatus.Visible = true;
            lblStatus.Text    = "No Records Found";
        }
    }
Пример #24
0
    protected void BindDataGrid()
    {
        if (txtSearchCustNo.Text.ToString() == (txtOrganizationNo.Text.ToString()))    // keeps both grids if customer is requested again
        {
            dsItemAlias = SqlHelper.ExecuteDataset(cnxERP, CommandType.StoredProcedure, "[pMaintItemAlias]"
                                                   , new SqlParameter("@ItemNo", txtSearchItemNo.Text)
                                                   , new SqlParameter("@OrganizationNo", txtSearchCustNo.Text));  //See stored procedure to for code to allow null by case of LIKE statement

            dgItemAliasGrid.DataSource = dsItemAlias.Tables[0].DefaultView.ToTable();
        }
        else
        {
            dsItemAlias = SqlHelper.ExecuteDataset(cnxERP, CommandType.StoredProcedure, "[pMaintItemAlias]"
                                                   , new SqlParameter("@ItemNo", txtSearchItemNo.Text)
                                                   , new SqlParameter("@OrganizationNo", txtSearchCustNo.Text));  //See stored procedure to for code to allow null by case of LIKE statement

            dgItemAliasGrid.DataSource = dsItemAlias.Tables[0].DefaultView.ToTable();

            ClearControls();
        }

        Pager1.InitPager(dgItemAliasGrid, 14);
        divAliasGrid.Visible = true;    //make div visible since it is set as false in page  (grid)
        pnlAliasGrid.Update();          //Refresh panels when clicking, all the time !
    }
Пример #25
0
        private void DisplayInfo(int pageSize, int currentPage)
        {
            txtDescripcion.Text = txtDescripcion.Text.Trim();
            int totalCount;
            IList <ProductInformation> lst = ControllerManager.Product.GetProductInformation(txtDescripcion.Text, ddlCategoria.SelectedValue, Convert.ToInt32(ddlSeleccion.SelectedValue), Convert.ToInt32(ddlEstado.SelectedValue), currentPage, pageSize, out totalCount, chbViejos.Checked);

            if (totalCount == 0)
            {
                totalCount = pageSize;
            }

            Pager1.PageCount   = Convert.ToInt32(Math.Ceiling(Convert.ToDouble(totalCount) / Convert.ToDouble(pageSize)));
            Pager2.PageCount   = Pager1.PageCount;
            Pager1.CurrentPage = currentPage;
            Pager2.CurrentPage = Pager1.CurrentPage;

            repItems.DataSource = lst;
            repItems.DataBind();

            Pager1.Step = 10;
            Pager2.Step = 10;
            Pager1.DataBind();
            Pager2.DataBind();
            if (lst.Count == 0)
            {
                lblBuscarError.Visible = true;
                repItems.Visible       = false;
            }
            else
            {
                lblBuscarError.Visible = false;
                repItems.Visible       = true;
            }
        }
Пример #26
0
        private void DisplayInfo(int pageSize, int currentPage)
        {
            PagedDataSource pagedItems = new PagedDataSource();

            pagedItems.DataSource       = ControllerManager.Product.GetProductInformation(TextBox1.Text, DropDownList2.SelectedValue, Convert.ToInt32(DropDownList3.SelectedValue), Convert.ToInt32(DropDownList1.SelectedValue), Config.CurrentWeek, Config.CurrentDate.Year, 0, 0);
            pagedItems.AllowPaging      = true;
            pagedItems.PageSize         = pageSize;
            pagedItems.CurrentPageIndex = currentPage - 1;
            Pager1.PageCount            = pagedItems.PageCount;
            Pager2.PageCount            = Pager1.PageCount;
            Pager1.CurrentPage          = currentPage;
            Pager2.CurrentPage          = Pager1.CurrentPage;
            repItems.DataSource         = pagedItems;
            repItems.DataBind();
            if (pagedItems.PageCount < 1)
            {
                Pager1.Visible = false;
                Pager2.Visible = false;
            }

            Pager1.Step = 4;
            Pager2.Step = 4;
            Pager1.DataBind();
            Pager2.DataBind();
        }
Пример #27
0
    /// <summary>
    /// 绑定库位产品明细
    /// </summary>
    private void BindDepotSeatProductDetails()
    {
        dt = WareHouseProductDetailsBLL.GetMoreProductInfoByWareHouseIDDepotSeatID(Convert.ToInt32(Session["WareHouseID"]), Convert.ToInt32(Session["DepotSeatID"]));
        this.lbl_storename.Visible = false;
        if (dt.Rows.Count < 1)
        {
            this.lbl_flag.Text = GetTran("001946", "没有相关数据");
        }
        else
        {
            this.lbl_flag.Text = GetTran("000357", "库位名称") + ":" + dt.Rows[0][1].ToString();
        }
        this.lbl_title.Text = GetTran("000390", "库位");

        string table   = " ProductQuantity a,Product b,WareHouse c ,DepotSeat j";
        string columus = " C.WareHouseName,j.SeatName,a.ProductID,b.ProductCode,b.ProductName," +
                         " (select d.ProductUnitName from ProductUnit as d where ProductUnitID=b.BigProductUnitID) as ProductBigUnitName," +
                         " (select d.ProductUnitName from ProductUnit as d where ProductUnitID=b.SmallProductUnitID) as ProductSmallUnitName ," +
                         " b.Weight," +
                         " convert(nvarchar(20),b.Length)+'*'+Convert(nvarchar(20),b.Width)+'*'+Convert(nvarchar(20),b.High) as Cubage," +
                         " sum(a.TotalIn) as TotalIn," +
                         " sum(a.TotalOut) as TotalOut ," +
                         " sum(a.TotalIn-a.TotalOut) as TotalEnd," +
                         " sum(b.AlertnessCount)as AlertnessCount ";

        string where = " a.ProductID=b.ProductID and a.WareHouseID=c.WareHouseID and c.WareHouseID=j.WareHouseID and a.DepotSeatID=j.DepotSeatID and a.DepotSeatID=" + Session["DepotSeatID"] + "  and a.wareHouseID=" + Session["WareHouseID"];

        string group = " C.WareHouseName,j.SeatName,a.ProductID,b.ProductCode,b.ProductName, b.BigProductUnitID,b.SmallProductUnitID, b.Weight,b.Length,b.Width,b.High";

        Pager1.PageBindGroup(0, 10, table, columus, where, " a.ProductID ", group, "gvProduct");
        //this.gvProduct.DataSource = dt;
        //this.gvProduct.DataBind();
    }
Пример #28
0
        private void BindData(bool isFirstPage)
        {
            var user = HttpContext.Current.Session["CurrentUser"] as Admin.Model.OrgUsers;

            #region 分页
            //当前页码
            int pageNum  = 1;
            int pageSize = 10;
            //分页查询语句
            string sql = "select row_number() over(order by CreateDate desc,PTID DESC) as rownum,* FROM ProfType where 1=1 ";
            if (!isFirstPage)
            {
                try {
                    if (!string.IsNullOrEmpty(Request.QueryString["Page"])) //页数判断
                    {
                        pageNum = Convert.ToInt32(Request.QueryString["Page"]);
                    }
                }
                catch (Exception ex) {
                    pageNum = 1;
                }
            }
            //分页方法
            Pager1.GetDataBind("Repeater", "rptList", sql, pageNum, pageSize, "", "rownum", "ProfType.aspx?id=" + Request.QueryString["id"] + "&");
            #endregion
        }
Пример #29
0
 private void BindDataGrid()
 {
     try
     {
         if (dtTotal.Rows.Count > 0)
         {
             GetTotal();
             dgDayReport.DataSource = dsReport.Tables[0];
             dgDayReport.Visible    = true;
             lblStatus.Visible      = false;
             Pager1.InitPager(dgDayReport, pagesize);
             Pager1.Visible = true;
             udpReportContent.Update();
         }
         else
         {
             dgDayReport.Visible = false;
             Pager1.Visible      = false;
             lblStatus.Visible   = true;
             lblStatus.Text      = "No Records Found";
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
     //lblStatus.Text = "No Records Found";
     //lblStatus.Visible = (dgDayReport.Items.Count < 1) ? true : false;
 }
Пример #30
0
 /// <summary>
 /// 绑定数据
 /// </summary>
 /// <param name="isFirstPage">搜索和删除用true IsPostBack用false</param>
 private void BindData(bool isFirstPage)
 {
     #region 分页
     //当前页码
     int pageNum  = 1;
     int pageSize = 10;
     //分页查询语句
     string sql    = "select row_number() over(order by CreateDate desc) as rownum,* FROM AdvisoryList where 1=1 and AdvisoryList.MType=1 ";
     var    name   = string.Empty;
     var    status = string.Empty;
     //if (!string.IsNullOrEmpty(ddlStatus.SelectedValue) && ddlStatus.SelectedValue != "-1") {
     //    status = ddlStatus.SelectedValue;
     //    sql += " and Status =" + status;
     //}
     if (!string.IsNullOrEmpty(txtRealName.Value))
     {
         name = txtRealName.Value;
         sql += " and Contact like '%" + name.Trim() + "%'";
     }
     if (!isFirstPage)
     {
         try {
             if (!string.IsNullOrEmpty(Request.QueryString["Page"])) //页数判断
             {
                 pageNum = Convert.ToInt32(Request.QueryString["Page"]);
             }
         }
         catch (Exception ex) {
             pageNum = 1;
         }
     }
     //分页方法
     Pager1.GetDataBind("Repeater", "rptListWork", sql, pageNum, pageSize, "", "rownum", "Advisory.aspx?ProName=" + name + "&Status=" + status + "&");
     #endregion
 }