Exemplo n.º 1
0
        private void dgMainForm_DoubleClick(object sender, EventArgs e)
        {
            var row = dgMainForm.SelectedRows[0];

            string query = "{'Company':'" + tbCompany.Text + "','Employees':[{'FirstName':'" + row.Cells[0].Value + "','LastName':'" + row.Cells[1].Value + "'}]}";

            EmployeeDetail df = new EmployeeDetail(tbCompany.Text);

            db.GetWhereElems(query).Select<EmployeeDetail>(df, "{'Employees':[!{'FirstName':$,'LastName':$,'Age':$,'Childs':[R,{'FirstName':$,'LastName':$}]}]}", false, new Serialization.DataTableBehaviour());

            df.ShowDialog();
        }
Exemplo n.º 2
0
        private void btAdd_Click(object sender, EventArgs e)
        {
            EmployeeDetail ed = new EmployeeDetail(tbCompany.Text);

            if (ed.ShowDialog() == DialogResult.OK)
            {
                string query = "{'Company':'" + tbCompany.Text + "'}";

                db.GetWhere(query).Insert<EmployeeDetail>(ed, "{'Employees':[Add,!{'FirstName':$,'LastName':$,'Age':$}]}");
            }
        }