/// <summary> /// name: FillGridView /// description: method used after the "Add" POI button is clicked, fills textboxes with the new POI's information /// </summary> private void AddNewRecord() { currentContext.Trace.Warn("inside AddNewRecord Local Method"); DA_POI inventoryObject = new DA_POI(); //Declare Variables decimal latitude; decimal longitude; string title; string description; string Address1; string Address2; string City; string State; int ZipCode; string ContactName; string Phone; string URL; string categoryCode; bool isActive = false; bool petFriendly = false; //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); } //If Statements for Missing Address2/URL Values if (txtURL.Text == "") { URL = ""; } else { URL = txtURL.Text; } if (txtAddress2.Text == "") { Address2 = ""; } else { Address2 = txtAddress2.Text; } title = txtTitle.Text; description = txtDescription.Text; Address1 = txtAddress1.Text; City = txtCity.Text; State = txtState.Text; ZipCode = Convert.ToInt32(txtZipCode.Text); ContactName = txtContactName.Text; Phone = txtPhone.Text; categoryCode = ddlCategory.SelectedItem.Value; if (chkIsActive.Checked == true) { isActive = true; } else { isActive = false; } if (chkPetFriendly.Checked == true) { petFriendly = true; } else { petFriendly = false; } inventoryObject.AddPOI(latitude, longitude, title, description, Address1, Address2, City, State, ZipCode, ContactName, Phone, URL, categoryCode, isActive, petFriendly); }
/// <summary> /// name: FillGridView /// description: method used after the "Add" POI button is clicked, fills textboxes with the new POI's information /// </summary> private void AddNewRecord() { currentContext.Trace.Warn("inside AddNewRecord Local Method"); DA_POI inventoryObject = new DA_POI(); //Declare Variables decimal latitude; decimal longitude; string title; string url; string description; string categoryCode; bool isActive = false; //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 = txtTitle.Text; url = txtURL.Text; description = txtDescription.Text; categoryCode = ddlCategory.SelectedItem.Value; if (chkIsActive.Checked == true) { isActive = true; } else { isActive = false; } inventoryObject.AddPOI(latitude, longitude, title, url, description, categoryCode, isActive); }