protected void Delete_Profile(object sender, EventArgs e) { //Create the client. Only the CopernicaKeyField property is required to delete the profile. var client = new Client { ID = Int32.Parse(ProfileID.Text) }; try { //Delete the client profile CopernicaHandler.Instance.Delete(client); StatusLabel.Text = "The profile has been deleted"; } catch (CopernicaException ex) { StatusLabel.Text = ex.Message; } }
protected void Update_Profile(object sender, EventArgs e) { //Create the client var client = new Client { ID = Int32.Parse(ProfileID.Text), Name = ProfileName.Text, Email = ProfileEmail.Text }; try { //Update the client profile CopernicaHandler.Instance.Update(client); StatusLabel.Text = "The profile has been updated"; } catch (CopernicaException ex) { StatusLabel.Text = ex.Message; } }
protected void Add_SubProfile(object sender, EventArgs e) { //Create the product var product = new Product { Name = SubProfileName.Text, Price = Int32.Parse(Price.Text) }; //Create the client. Only the identifier is needed. var client = new Client() { ID = Int32.Parse(ProfileID.Text) }; //Add the product to the client. try { CopernicaHandler.Instance.Add(product, client); StatusLabel.Text = "The subprofile has been added"; } catch (CopernicaException ex) { StatusLabel.Text = ex.Message; } }