private void dgChilds_DoubleClick(object sender, EventArgs e) { var row = dgChilds.SelectedRows[0]; string query = "{'Company':'" + _company + "', 'Employees':[{'FirstName':'" + tbFirstName.Text + "','LastName':'" + tbLastName.Text + "','Childs':[{'FirstName':'" + row.Cells[0].Value + "','LastName':'" + row.Cells[1].Value + "'}]}]}"; EmployeeChildDetail df = new EmployeeChildDetail(_company, tbFirstName.Text, tbLastName.Text); db.GetWhereElems(query).Select<EmployeeChildDetail>(df, "{'Employees':[{'Childs':[!{'FirstName':$,'LastName':$,'Age':$}]}]}", false, new Serialization.DataTableBehaviour()); df.ShowDialog(); }
private void btAdd_Click(object sender, EventArgs e) { EmployeeChildDetail ecd = new EmployeeChildDetail(_company, tbFirstName.Text, tbLastName.Text); if (ecd.ShowDialog() == DialogResult.OK) { string query = "{'Company':'" + _company + "', 'Employees':[{'FirstName':'" + _oldFirstName + "','LastName':'" + _oldLastName + "'}]}"; db.GetWhereElems(query).Insert<EmployeeChildDetail>(ecd, "{'Employees':[{'Childs':[Add,!{'FirstName':$,'LastName':$,'Age':$}]}]}"); } }