private void btn_costcenter_delete_Click(object sender, EventArgs e) { var costcenter = new Four51WebCostCenter(txt_sharedsecret.Text, txt_serviceid.Text) { InteropID = txt_costcenter_interopid.Text, CompanyInteropID = txt_costcenter_companyinteropid.Text }; try { costcenter.Delete(); MessageBox.Show("Deleted: " + costcenter.InteropID); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void btn_costcenter_save_Click(object sender, EventArgs e) { var costcenter = new Four51WebCostCenter(txt_sharedsecret.Text, txt_serviceid.Text) { InteropID = txt_costcenter_interopid.Text == "" ? Guid.NewGuid().To <string>() : txt_costcenter_interopid.Text, CompanyInteropID = txt_costcenter_companyinteropid.Text, Name = txt_costcenter_name.Text, Description = txt_costcenter_description.Text }; try { costcenter.Save(); MessageBox.Show("Saved: " + costcenter.Name); } catch (Exception ex) { MessageBox.Show(ex.Message); } }