private void About_Load(object sender, EventArgs e) { about = CallAPI.GetObjectContent <Models.About, Models.About>("GetAbout"); txtEmail.Text = about.Email; txtAddress.Text = about.Address; txtMobile.Text = about.MobileNumber; }
private void btnUpdateContact_Click(object sender, EventArgs e) { try { if (txtEmailAbout.CheckNull()) { return; } if (txtMobile.CheckNull()) { return; } if (txtLocation.CheckNull()) { return; } about.Email = txtEmailAbout.Text; about.Address = txtLocation.Text; about.MobileNumber = txtMobile.Text; about = CallAPI.PostObjectAndGetObject <Models.About, Models.About>(about, "UpdateAbout"); MessageBox.Show("Modified successfully", "Done", MessageBoxButtons.OK, MessageBoxIcon.Information); txtEmailAbout.Text = about.Email; txtLocation.Text = about.Address; txtMobile.Text = about.MobileNumber; } catch { MessageBox.Show("There Are An Error", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }