示例#1
0
        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");
        }
示例#2
0
        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");
        }
示例#3
0
        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");
        }