/// <summary> /// name: ChangeRecord /// description: This method contains the front end code needed to update a POI, it uses the UpdatePOI method in the DA_POI class /// </summary> private void ChangeRecord() { //Get ID value string locationID = (Request.QueryString["qrypoiID"]); //Declare Variables string title; decimal latitude; decimal longitude; string description; string Address1; string Address2; string City; string State; int ZipCode; string ContactName; string Phone; string URL; string Category; bool isActive; bool petFriendly; //Get values for variables //If Statements for Missing Long/Lat Values if (txtLongitude.Text == "") { longitude = 0; } else { longitude = Convert.ToDecimal(txtLongitude.Text); } if (txtLatitude.Text == "") { latitude = 0; } else { latitude = Convert.ToDecimal(txtLatitude.Text); } //If Statements for Missing Address2/URL Values if (txtURL.Text == "") { URL = ""; } else { URL = txtURL.Text; } if (txtAddress2.Text == "") { Address2 = ""; } else { Address2 = txtAddress2.Text; } title = Convert.ToString(txtTitle.Text); description = Convert.ToString(txtDescription.Text); Address1 = txtAddress1.Text; City = txtCity.Text; State = txtState.Text; ZipCode = Convert.ToInt32(txtZipCode.Text); ContactName = txtContactName.Text; Phone = txtPhone.Text; Category = ddlCategory.SelectedValue; if (chkIsActive.Checked == true) { isActive = true; } else { isActive = false; } if (chkPetFriendly.Checked == true) { petFriendly = true; } else { petFriendly = false; } DA_POI inventoryObject = new DA_POI(); inventoryObject.UpdatePOI(latitude, longitude, title, description, Address1, Address2, City, State, ZipCode, ContactName, Phone, URL, Category, isActive, locationID, petFriendly); lblDisplay.Text = "The POI information has been saved."; this.DisplayRecord(); }
/// <summary> /// name: ChangeRecord /// description: This method contains the front end code needed to update a POI, it uses the UpdatePOI method in the DA_POI class /// </summary> private void ChangeRecord() { //Get ID value string locationID = (Request.QueryString["qrypoiID"]); //Declare Variables string title; decimal latitude; decimal longitude; string description; string Address1; string Address2; string City; string State; int ZipCode; string ContactName; string Phone; string URL; string Category; bool isActive; bool petFriendly; string image1Desc=""; string image2Desc=""; string image3Desc=""; //Get values for variables //If Statements for Missing Long/Lat Values if (txtLongitude.Text == "") { longitude = 0; } else { longitude = Convert.ToDecimal(txtLongitude.Text); } if (txtLatitude.Text == "") { latitude = 0; } else { latitude = Convert.ToDecimal(txtLatitude.Text); } //If Statements for Missing Address2/URL Values if (txtURL.Text == "") { URL = ""; } else { URL = txtURL.Text; } if (txtAddress2.Text == "") { Address2 = ""; } else { Address2 = txtAddress2.Text; } title = Convert.ToString(txtTitle.Text); description = Convert.ToString(txtDescription.Text); Address1 = txtAddress1.Text; City = txtCity.Text; State = txtState.Text; ZipCode = Convert.ToInt32(txtZipCode.Text); ContactName = txtContactName.Text; Phone = txtPhone.Text; Category = ddlCategory.SelectedValue; image1Desc = txtImage1Desc.Text; image2Desc = txtImage2Desc.Text; image3Desc = txtImage3Desc.Text; if (chkIsActive.Checked == true) { isActive = true; } else { isActive = false; } if (chkPetFriendly.Checked == true) { petFriendly = true; } else { petFriendly = false; } Trace.Warn("1" + image1Desc); Trace.Warn("2" + image2Desc); Trace.Warn("3" + image3Desc); DA_POI inventoryObject = new DA_POI(); inventoryObject.UpdatePOI(latitude, longitude, title, description, Address1, Address2, City, State, ZipCode, ContactName, Phone, URL, Category, isActive, locationID, petFriendly, image1Desc, image2Desc, image3Desc); lblDisplay.Text = "The POI information has been saved."; this.DisplayRecord(); }
/// <summary> /// name: ChangeRecord /// description: This method contains the front end code needed to update a POI, it uses the UpdatePOI method in the DA_POI class /// </summary> private void ChangeRecord() { //Get ID value string locationID = (Request.QueryString["qrypoiID"]); //Declare Variables string title; decimal latitude; decimal longitude; string url; string description; string Category; bool isActive ; //Get values for variables //If Statements for Missing Long/Lat Values if (txtLatitude.Text == "") { latitude = 0; } else { latitude = Convert.ToDecimal(txtLatitude.Text); } if (txtLongitude.Text == "") { longitude = 0; } else { longitude = Convert.ToDecimal(txtLongitude.Text); } title = Convert.ToString(txtTitle.Text); url = Convert.ToString(txtURL.Text); description = Convert.ToString(txtDescription.Text); Category = ddlCategory.SelectedValue; if (chkIsActive.Checked == true) { isActive = true; } else { isActive = false; } DA_POI inventoryObject = new DA_POI(); inventoryObject.UpdatePOI(latitude, longitude, title, url, description, Category, isActive, locationID); lblDisplay.Text = "The POI information has been saved."; this.DisplayRecord(); }