protected void Page_Load(object sender, EventArgs e) { { string idpedido = Request["IDPedido"]; if (idpedido != null) { PedidoBLL pbll = new PedidoBLL(); PessoaFisicaBLL pfbll = new PessoaFisicaBLL(); PessoaJuridicaBLL pjbll = new PessoaJuridicaBLL(); ItemBLL ibll = new ItemBLL(); ProdutoBLL prbll = new ProdutoBLL(); var pedido = pbll.GetPedido(idpedido); lblCodigoPedido.Text = pedido.CodigoPedido; lblNomePessoa.Text = pfbll.GetPessoaFisica(pedido.CodigoComprador).NomePessoa; lblNomeFornecedor.Text = pjbll.GetPessoaJuridica(pedido.CodigoVendedor).NomePessoa; var items = ibll.GetItems().Where(p => p.CodigoPedido == pedido.CodigoPedido).ToList(); double total = 0; List <Produto> produtos = new List <Produto>(); foreach (var item in items) { //var produto = prbll.GetProduto(item.CodigoProduto); //produtos.Add(produto); total += double.Parse(item.ValorTotal); //labelitens += "<br/>Produto: "+produto.Nome+"| Qtd: "+item.Qtd+"| Preço: "+produto.Preco; } grvProdutos.DataSource = items; grvProdutos.DataBind(); lblTotal.Text = total.ToString(); } } }
public IHttpActionResult GetItems() { List <ItemBO> items = itemBLL.GetItems(); if (items == null) { return(NotFound()); } return(Ok(items)); }
public StockOutForm() { InitializeComponent(); companies = companyBll.GetCompanies(); allItems = itemBll.GetItems(); ItemComboBox.Enabled = false; quantityTextBox.Enabled = false; AddButton.Enabled = false; foreach (var company in companies) { companyNameComboBox.Items.Add(company.Name); } itemGridView.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill; }
private void companyCombobox_SelectedIndexChanged(object sender, EventArgs e) { string selectedCompany = companyCombobox.SelectedItem.ToString(); // MessageBox.Show(selectedCompany); items = itemBll.GetItems(selectedCompany); if (items != null) { foreach (var item in items) { string companyName = ""; foreach (var company in companies) { if (item.CompanyId == company.Id) { companyName = company.Name; } } ItemComboBox.Items.Add(item.Name + " - " + companyName); } } ItemComboBox.Enabled = true; }
public void GetItems() { List <Item> items = itemBLL.GetItems(); ViewBag.ItemList = items; }
public List <ItemDTO> GetItems(string categoryId) { return(itemBLL.GetItems(int.Parse(categoryId))); }
private void BindGrid() { int itemTypeId = int.Parse(ViewState["ItemType"].ToString()); int paperId = int.Parse(ViewState["PaperId"].ToString()); int startRow = int.Parse(ViewState["StartRow"].ToString()); int endRow = int.Parse(ViewState["EndRow"].ToString()); int nItemcount = 0; int itemDifficultyId = -1; int itemScore = -1; int usageId = -1; if (divquery.Visible) { if (this.txtScore.Text != "") { itemScore = int.Parse(txtScore.Text); } if (ddlItemDifficulty.SelectedValue != "") { itemDifficultyId = int.Parse(ddlItemDifficulty.SelectedValue); } usageId = int.Parse(ddlUsage.SelectedValue); } IList <RailExam.Model.Item> Items = null; ItemBLL itemBll = new ItemBLL(); string knowledgeIdPath = "null"; int bookId = -1; int chapterId = -1; string trainTypeIdPath = "null"; string categoryIdPath = "null"; if (hftype.Value == "1") { knowledgeIdPath = tvView.SelectedNode.Value; } if (hftype.Value == "4") { trainTypeIdPath = tvView.SelectedNode.Value; } if (hftype.Value == "5") { categoryIdPath = tvView.SelectedNode.Value; } if (hftype.Value == "2") { bookId = int.Parse(tvView.SelectedNode.Value); } if (hftype.Value == "3") { chapterId = int.Parse(tvView.SelectedNode.Value); } Items = itemBll.GetItems(knowledgeIdPath, bookId, chapterId, trainTypeIdPath, categoryIdPath, itemTypeId, paperId, itemDifficultyId, itemScore, 1, usageId, startRow, endRow, ref nItemcount); if (Items.Count > 0) { Grid1.VirtualItemCount = nItemcount; Grid1.DataSource = Items; Grid1.DataBind(); } else { BindEmptyGrid(); } }