private int addContact() { try { int contID = 0; DataCommunicator.ContactItem contact = new ContactItem(); contact.Address1 = txtAddress.Value; contact.Address2 = ""; // I might need this later contact.City = txtCity.Value; //contact.CoachLevel Make sure I don't overwrite this unless it needs to be == Add these to different table //contact.RefLevel Same for this one contact.Email = txtEmail.Value; contact.FName = txtFName.Value; contact.InstructorEmail = txtInstrEmail.Value; contact.IntructorName = txtInstrName.Value; contact.LName = txtLName.Value; contact.ContactID = "0"; contact.OptOut = "false"; contact.Rank = ddlRank.Value; contact.School = txtSchool.Value; contact.SchoolWeb = txtInstrWebsite.Value; contact.State = ddlStates.Value; String zip = ""; String zip4 = ""; try { if (postal.Value.Length > 4) { zip = postal.Value.Substring(0, 5); if (postal.Value.Length > 8) { zip4 = postal.Value.Substring(5, 4); } } } catch (Exception ex) { string x = ex.Message; throw ex; } contact.Zip = zip; contact.Zip4 = zip4; DateTime db = new DateTime(); if (!DateTime.TryParse(dateOfBirth.Value, out db)) { throw new Exception("date of birth not completed"); } contact.Dob = db; contID = contact.addContact(); return(contID); } catch (Exception ex) { throw ex; } }
private int addContact() { try { int contID = 0; DataCommunicator.ContactItem contact = new ContactItem(); contact.Address1 = txtAddress.Value; contact.City = txtCity.Value; contact.Email = txtEmail.Value; contact.FName = txtFName.Value; contact.InstructorEmail = txtInstrEmail.Value; contact.IntructorName = txtInstrName.Value; contact.LName = txtLName.Value; contact.ContactID = "0"; contact.OptOut = "false"; contact.Rank = "none"; contact.School = txtSchool.Value; contact.SchoolWeb = txtInstrWebsite.Value; contact.State = ddlStates.Value; String zip = ""; String zip4 = ""; try { if (postal.Value.Length > 4) { zip = postal.Value.Substring(0, 5); if (postal.Value.Length > 8) { zip4 = postal.Value.Substring(5, 4); } } } catch (Exception ex) { string x = ex.Message; throw ex; } contact.Zip = zip; contact.Zip4 = zip4; contID = contact.addContact(); return(contID); } catch (Exception ex) { throw ex; } }