public void Devolver(MODEL.Itens item) { BLL.Cacambas bllCacambas = new Cacambas(); List <MODEL.Cacambas> lstCacambas = bllCacambas.SelectByID(item.cacambas_id); MODEL.Cacambas cacambas = lstCacambas[0]; cacambas.situacao = 1; bllCacambas.Update(cacambas); item.entrega = Convert.ToDateTime(DateTime.Now.ToShortDateString()); DAL.Itens dalItens = new DAL.Itens(); dalItens.Update(item); }
public void Insert(MODEL.Itens item) { BLL.Cacambas bllCacambas = new Cacambas(); List <MODEL.Cacambas> lstCacambas = bllCacambas.SelectByID(item.cacambas_id); MODEL.Cacambas cacambas = lstCacambas[0]; cacambas.situacao = 2; bllCacambas.Update(cacambas); DAL.Itens dalItens = new DAL.Itens(); dalItens.Insert(item); }
private void verificaCacamba() { int id = Convert.ToInt32(txtCacambaID.Text); CAMADAS.BLL.Cacambas bllCacambas = new CAMADAS.BLL.Cacambas(); List <CAMADAS.MODEL.Cacambas> lstCacambas = bllCacambas.SelectByID(id); if (lstCacambas.Count() != 0) { if (lstCacambas[0].situacao != 1) { MessageBox.Show("Caçamba " + lstCacambas[0].tipo.Trim() + " Alugada"); cmbCacamba.Focus(); } } else { MessageBox.Show("Cacamba Invalida"); cmbCacamba.Focus(); } cmbCacamba.SelectedValue = Convert.ToInt32(txtCacambaID.Text); }
private void btnFiltrar_Click(object sender, EventArgs e) { CAMADAS.BLL.Cacambas bllCacambas = new CAMADAS.BLL.Cacambas(); List <CAMADAS.MODEL.Cacambas> lstCacambas = new List <CAMADAS.MODEL.Cacambas>(); if (rdbTodos.Checked) { lstCacambas = bllCacambas.Select(); } else if (rdbTipo.Checked) { lstCacambas = bllCacambas.SelectByTipo(txtFiltro.Text); } else { int id = Convert.ToInt32(txtFiltro.Text); lstCacambas = bllCacambas.SelectByID(id); } dgvCacambas.DataSource = ""; dgvCacambas.DataSource = lstCacambas; }