//protected void gvPurchaseOrder_PageIndexChanging(object sender, GridViewPageEventArgs e) //{ // this.gvPurchaseOrder.PageIndex = e.NewPageIndex; // DataBindPurchaseOrdersGridView(criteria); //} protected void DataBindPurchaseOrdersGridView(PurchaseOrderSearchDTO criteria) { using (PurchaseOrderManager pom = new PurchaseOrderManager()) { List<PurchaseOrder> orders = pom.FindPurchaseOrderByCriteria(criteria); this.gvPurchaseOrder.DataSource = orders; this.gvPurchaseOrder.DataBind(); } }
protected void ButtonUpdate_Click(object sender, EventArgs e) { PurchaseOrderSearchDTO dto = new PurchaseOrderSearchDTO(); dto.SupplierID = 3; using (PurchaseOrderManager pom = new PurchaseOrderManager()) { List<PurchaseOrder> po = pom.FindPurchaseOrderByCriteria(dto); po[0].DONumber = "88888"; PurchaseOrder poUpdated = pom.UpdatePurchaseOrder(po[0]); } }
protected void ButtonFind_Click(object sender, EventArgs e) { PurchaseOrderSearchDTO criteria = new PurchaseOrderSearchDTO(); criteria.SupplierID = Convert.ToInt32(TextBoxSupplier.Text.ToString()); using (PurchaseOrderManager pom = new PurchaseOrderManager()) { List<PurchaseOrder> pos = pom.FindPurchaseOrderByCriteria(criteria); this.GridView1.DataSource = pos; this.GridView1.DataBind(); } }
protected void Button1_Click(object sender, EventArgs e) { PurchaseOrderSearchDTO criteria = new PurchaseOrderSearchDTO(); criteria.SupplierID = Convert.ToInt32(ddlSupplier.SelectedValue); if (txtPONumber.Text != string.Empty) criteria.PONumber = txtPONumber.Text; if (txtStartDateOfOrder.Text != string.Empty) criteria.StartDateOfOrder = Convert.ToDateTime(txtStartDateOfOrder.Text.ToString()); if (txtEndDateOfOrder.Text != string.Empty) criteria.EndDateOfOrder = Convert.ToDateTime(txtEndDateOfOrder.Text.ToString()); using (PurchaseOrderManager pom = new PurchaseOrderManager()) { List<PurchaseOrder> purchaseOrders = pom.FindPurchaseOrderByCriteria(criteria); gvPurchaseOrder.DataSource = purchaseOrders; gvPurchaseOrder.DataBind(); } }
public List<PurchaseOrder> FindPurchaseOrderByCriteria(PurchaseOrderSearchDTO poSearchDTO) { return purchaseOrderDAO.FindPurchaseOrderByCriteria(poSearchDTO); }