protected override MasterVO FillObject() { InvestmentsVO investmentsVO = new InvestmentsVO(); investmentsVO.Id = Convert.ToInt32(txt_Id.Text); investmentsVO.Name = txt_Name.Text; investmentsVO.StartDate = dt_StartDate.Value; investmentsVO.EndDate = dt_EndDate.Value; //investmentsVO.UserId = ; return(investmentsVO); }
public override MasterVO BiuldVO(DataRow row) { InvestmentsVO investment = new InvestmentsVO(); investment.Id = Convert.ToInt32(row["id"]); investment.Name = row["name"].ToString(); investment.UserId = Convert.ToInt32(row["userId"]); investment.Value = Convert.ToDouble(row["value"]); investment.StartDate = Convert.ToDateTime(row["startDate"]); investment.EndDate = Convert.ToDateTime(row["endDate"]); return(investment); }
private void btn_Pesquisar_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(txt_Name.Text)) { MessageBox.Show("Digite um valor válido para o nome."); } else { InvestmentsDAO dao = new InvestmentsDAO(); InvestmentsVO statement = new InvestmentsVO(); statement.Name = txt_Name.Text; DataTable table = dao.SQLSearch(statement); dgv_Listing.DataSource = table; } }
private void btn_Confirm_Click(object sender, EventArgs e) { if (dgv_Listing.CurrentRow != null) { InvestmentsVO investment = new InvestmentsVO(); investment.Id = Convert.ToInt32(dgv_Listing.CurrentRow.Cells[0].Value); investment.Name = dgv_Listing.CurrentRow.Cells[1].Value.ToString(); investment.StartDate = Convert.ToDateTime(dgv_Listing.CurrentRow.Cells[2].Value.ToString()); investment.Value = Convert.ToDouble(dgv_Listing.CurrentRow.Cells[3].Value); //uc_InvestimentRegister.FillScreen(investment); this.Visible = false; } else { MessageBox.Show("Selecione uma linha válida"); } }