コード例 #1
0
ファイル: Volunteer.aspx.cs プロジェクト: Devang83/csc131
 protected void ButtonSave_Click(object sender, EventArgs e)
 {
     long id = long.Parse(Request["Id"]);
     VolunteerTracker.Volunteer v = new VolunteerTracker.Volunteer(id);
     v.Address = Address.Text.Trim();
     v.CellPhone = CellPhone.Text.Trim();
     v.Email = Email.Text.Trim();
     v.FirstName = FirstName.Text.Trim();
     v.HomePhone = HomePhone.Text.Trim();
     v.LastName = LastName.Text.Trim();
     v.OfficePhone = OfficePhone.Text.Trim();
     v.Employer = Employer.Text.Trim();
     v.Save();
     message = "<font color=\"red\">Saved</font>";
 }
コード例 #2
0
ファイル: AddVolunteer.aspx.cs プロジェクト: Devang83/csc131
 protected void ButtonAdd_Click(object sender, EventArgs e)
 {
     VolunteerTracker.Volunteer v = new VolunteerTracker.Volunteer();
     v.Address = Address.Text.Trim();
     v.CellPhone = CellPhone.Text.Trim();
     v.Email = Email.Text.Trim();
     v.FirstName = FirstName.Text.Trim();
     v.HomePhone = HomePhone.Text.Trim();
     v.LastName = LastName.Text.Trim();
     v.OfficePhone = OfficePhone.Text.Trim();
     v.Ethnicity = Ethnicity.Text.Trim();
     v.Employer = Employer.Text.Trim();
     v.JobTitle = JobTitle.Text.Trim();
     v.Male = (Male.Text.Trim().ToLower() == "m") ? 1 : 0;
     v.Interests = new System.Collections.Generic.List<string>();
     v.Save();
     message = "<font color=\"red\">Volunteer Added <br/> Go to <a href=\"../Volunteer/Volunteer.aspx?Id=" + v.Id + "\">volunteer</a></font>";
 }