private void btnGravarEmp_Click(object sender, EventArgs e) { CAMADAS.MODEL.Emprestimo emprestimo = new CAMADAS.MODEL.Emprestimo(); emprestimo.id = Convert.ToInt32(lblEmpID.Text); emprestimo.clienteId = Convert.ToInt32(txtClienteID.Text); emprestimo.data = dtpData.Value; CAMADAS.BLL.Emprestimo bllEmp = new CAMADAS.BLL.Emprestimo(); if (lblEmpID.Text == "-1") { bllEmp.Insert(emprestimo); } else { bllEmp.Update(emprestimo); } dgvEmprestimo.DataSource = bllEmp.Select(); habilitaControlesEmprestimo(false); }
private void btnGravar_Click(object sender, EventArgs e) { CAMADAS.MODEL.Emprestimo emprestimo = new CAMADAS.MODEL.Emprestimo(); emprestimo.id = Convert.ToInt32(lblEmpID.Text); emprestimo.clienteID = Convert.ToInt32(cmbCliente.SelectedValue.ToString()); emprestimo.data = dtpData.Value; CAMADAS.BLL.Emprestimo bllEmp = new CAMADAS.BLL.Emprestimo(); if (lblEmpID.Text == "-1") { bllEmp.Insert(emprestimo); } else { bllEmp.Update(emprestimo); } List <CAMADAS.MODEL.Emprestimo> lstEmp = bllEmp.Select(); dgvEmprestimo.DataSource = ""; dgvEmprestimo.DataSource = lstEmp; }
private void ButGravarEmp_Click(object sender, EventArgs e) { CAMADAS.MODEL.Emprestimo emprestimo = new CAMADAS.MODEL.Emprestimo(); emprestimo.ID = Convert.ToInt32(lblIDEmp.Text); emprestimo.CLIENTE_ID = Convert.ToInt32(CbNomeEmp.SelectedValue.ToString()); emprestimo.DATA = DtpEmp.Value; CAMADAS.BLL.Emprestimo bllemprestimo = new CAMADAS.BLL.Emprestimo(); if (lblIDEmp.Text == "-1") { bllemprestimo.Insert(emprestimo); } else { bllemprestimo.Update(emprestimo); } List <CAMADAS.MODEL.Emprestimo> LstEmprestimo = bllemprestimo.Select(); DgvEmprestimo.DataSource = ""; DgvEmprestimo.DataSource = LstEmprestimo; }