protected void cmdInsert_Click(object sender, EventArgs e) { ContactEntity ce = new ContactEntity(txtFN.Text, txtLN.Text, txtCN.Text, lstCT.SelectedValue); TableOperation insertop = TableOperation.Insert(ce); table.Execute(insertop); Response.Redirect("Default.aspx"); }
protected void cmddb_Click(object sender, EventArgs e) { TableOperation retrieveOp = TableOperation.Retrieve <ContactEntity>(txtect.Text, txtecn.Text); TableResult result = table.Execute(retrieveOp); ContactEntity deleteEntity = (ContactEntity)result.Result; table.Execute(TableOperation.Delete(deleteEntity)); Response.Redirect("Default.aspx"); }
protected void cmdub_Click(object sender, EventArgs e) { TableOperation replaceop = TableOperation.Retrieve <ContactEntity>(txtect.Text, txtecn.Text); TableResult result = table.Execute(replaceop); ContactEntity updateEntity = (ContactEntity)result.Result; updateEntity.FirstName = txtefn.Text; updateEntity.LastName = txteln.Text; table.Execute(TableOperation.InsertOrReplace(updateEntity)); Response.Redirect("Default.aspx"); }