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; } }
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(); }
private void DisplayInfo(int pageSize, int currentPage) { PagedDataSource pagedItems = new PagedDataSource(); int cod = 0; DateTime date = new DateTime(); if (TextBox1.Text != "") { cod = Convert.ToInt32(TextBox1.Text); } if (TextBox2.Text != "") { date = Convert.ToDateTime(TextBox2.Text); } else { date = Convert.ToDateTime("01/01/1900"); } IList <PurchaseOrderInformation> poinfo = ControllerManager.PurchaseOrder.GetPurchaseOrders(cod, date, Convert.ToInt32(DropDownList1.SelectedValue), Convert.ToInt32(DropDownList3.SelectedValue), 0, 0); foreach (PurchaseOrderInformation information in poinfo) { IList <PurchaseOrderItem> poi = ControllerManager.PurchaseOrderItem.GetPurchaseOrderItemList(ControllerManager.PurchaseOrder.GetById(information.Id)); information.Amount = 0; information.Totalcount = 0; foreach (PurchaseOrderItem item in poi) { Grundfos.ScalaConnector.Product prodscala = Grundfos.ScalaConnector.ControllerManager.Product.GetProductInfo(item.Product.ProductCode); information.Amount = information.Amount + (item.Quantity * prodscala.PurchasePrice); information.Totalcount = information.Totalcount + item.Quantity; information.Arrivaldate = information.Orderdate.AddDays(item.Product.LeadTime); } } pagedItems.DataSource = poinfo; 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(); }
private void DisplayInfo(int pageSize, int currentPage) { txtCodigoOc.Text = txtCodigoOc.Text.Trim(); int cod = 0; DateTime date = new DateTime(); DateTime dateEnd = new DateTime(); if (txtCodigoOc.Text != "") { cod = Convert.ToInt32(txtCodigoOc.Text); } if (txtFechaDesde.Text != "") { date = Convert.ToDateTime(txtFechaDesde.Text); } else { date = Convert.ToDateTime("01/01/1900"); } if (txtFechaHasta.Text != "") { dateEnd = Convert.ToDateTime(txtFechaHasta.Text); } else { dateEnd = Convert.ToDateTime("01/01/1900"); } int totalCount; IList <PurchaseOrderInformation> poinfo = ControllerManager.PurchaseOrder.GetPurchaseOrdersBetweenDates(cod, date, dateEnd, Convert.ToInt32(ddlProveedor.SelectedValue), Convert.ToInt32(ddlEstados.SelectedValue), 0, 0, Convert.ToInt32(ddlOrigen.SelectedValue), out totalCount); 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 = poinfo; repItems.DataBind(); Pager1.Step = 4; Pager2.Step = 4; Pager1.DataBind(); Pager2.DataBind(); if (poinfo.Count == 0) { lblBuscarError.Visible = true; repItems.Visible = false; } else { lblBuscarError.Visible = false; repItems.Visible = true; } }