protected override MasterVO FillObject() { GoalsVO goalVO = new GoalsVO(); goalVO.Id = Convert.ToInt32(txt_Id.Text); goalVO.Name = txt_Name.Text; goalVO.EndDate = dt_EndDate.Value; // goalVO.UserId = null; return(goalVO); }
public override MasterVO BiuldVO(DataRow row) { GoalsVO goal = new GoalsVO(); goal.Id = Convert.ToInt32(row["id"]); goal.UserId = Convert.ToInt32(row["userId"]); goal.Name = row["name"].ToString(); goal.EndDate = Convert.ToDateTime(row["endDate"]); return(goal); }
private void btn_Confirm_Click(object sender, EventArgs e) { if (dgv_Listing.CurrentRow != null) { GoalsVO goal = new GoalsVO(); goal.Id = Convert.ToInt32(dgv_Listing.CurrentRow.Cells[0].Value); goal.Name = dgv_Listing.CurrentRow.Cells[1].Value.ToString(); goal.UserId = Convert.ToInt32(dgv_Listing.CurrentRow.Cells[2].Value); uc_GoalRegister.Instance.FillScreen(goal); this.Visible = false; } else { MessageBox.Show("Selecione uma linha válida"); } }
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 { GoalsDAO dao = new GoalsDAO(); GoalsVO goal = new GoalsVO(); goal.Name = txt_Name.Text; DataTable table = dao.SQLSearch(goal); dgv_Listing.DataSource = table; } }