protected override void SaveForm() { try { hccUserProfilePhone currentPhone = hccUserProfilePhone.GetById(this.PrimaryKeyIndex); Enums.PhoneType currentPhoneType = (Enums.PhoneType)Enum.Parse(typeof(Enums.PhoneType), ddlPhoneTypes.SelectedValue); if (currentPhone == null) { currentPhone = new hccUserProfilePhone { PhoneNumber = txtPhoneNumber.Text, PhoneTypeID = (int)currentPhoneType, IsPrimary = chkIsPrimary.Checked, IsActive = true }; if (this.ParentProfileID > 0) { currentPhone.UserProfileID = this.ParentProfileID; currentPhone.Save(); OnSaved(new ControlSavedEventArgs(currentPhone.PhoneID)); } else { OnPhoneNotSaved(new PhoneNotSavedEventArgs(currentPhone)); } } else { currentPhone.PhoneNumber = txtPhoneNumber.Text.Trim(); currentPhone.PhoneTypeID = (int)currentPhoneType; currentPhone.IsPrimary = chkIsPrimary.Checked; currentPhone.IsActive = true; currentPhone.Save(); OnSaved(new ControlSavedEventArgs(currentPhone.PhoneID)); } } catch { throw; } }
public void Bind(hccUserProfilePhone phone) { CurrentPhone = phone; Bind(); }
public PhoneNotSavedEventArgs(hccUserProfilePhone unsavedPhone) { UnSavedPhone = unsavedPhone; }