/// <summary> /// Deprecated Method for adding a new object to the acaHealthPlans EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToacaHealthPlans(acaHealthPlans acaHealthPlans) { base.AddObject("acaHealthPlans", acaHealthPlans); }
protected void btnAddApplicant_Click(object sender, EventArgs e) { chsi.dat.CHSIEntities db = new chsi.dat.CHSIEntities(); int _appId = 0; if (!String.IsNullOrEmpty(Request.QueryString["appId"])) { string appId = Request.QueryString["appId"]; int.TryParse(appId, out _appId); } if (_appId == 0) { chsi.dat.acaApplicants app = new acaApplicants(); app.FirstName = this.txtFirstName.Text.Trim(); app.LastName = this.txtLastName.Text.Trim(); //app.Email = this.txtEmail.Text.Trim(); //app.Address = this.txtAddress.Text.Trim(); //app.City = this.txtCity.Text.Trim(); app.isPrimary = true; app.DateOfBirth = Convert.ToDateTime(this.txtDOB.Text); app.Phone = this.txtPhone.Text.Trim(); app.RegionId = int.Parse(this.ddRegion.SelectedValue); app.isActive = this.chkActive.Checked; //app.Zip = this.txtZip.Text.Trim(); app.Notes = this.txtNotes.Text.Trim(); db.acaApplicants.AddObject(app); db.SaveChanges(); int appId = app.ApplicantId; acaHealthPlans hp = new acaHealthPlans(); hp.ApplicantId = appId; db.acaHealthPlans.AddObject(hp); db.SaveChanges(); Response.Redirect(string.Format("/aca/assists?appId={0}", appId)); } else { acaApplicants app = (from a in db.acaApplicants where a.ApplicantId == _appId select a).FirstOrDefault(); app.FirstName = this.txtFirstName.Text.Trim(); app.LastName = this.txtLastName.Text.Trim(); //app.Email = this.txtEmail.Text.Trim(); //app.Address = this.txtAddress.Text.Trim(); //app.City = this.txtCity.Text.Trim(); app.DateOfBirth = Convert.ToDateTime(this.txtDOB.Text); app.isPrimary = true; app.Phone = this.txtPhone.Text.Trim(); app.RegionId = int.Parse(this.ddRegion.SelectedValue); app.isActive = this.chkActive.Checked; //app.Zip = this.txtZip.Text.Trim(); app.Notes = this.txtNotes.Text.Trim(); db.SaveChanges(); Response.Redirect(string.Format("/aca/assists?appId={0}", _appId)); } }
/// <summary> /// Create a new acaHealthPlans object. /// </summary> /// <param name="healthPlanId">Initial value of the HealthPlanId property.</param> public static acaHealthPlans CreateacaHealthPlans(global::System.Int32 healthPlanId) { acaHealthPlans acaHealthPlans = new acaHealthPlans(); acaHealthPlans.HealthPlanId = healthPlanId; return acaHealthPlans; }