protected void txtLocationZipCode_TextChanged(object sender, EventArgs e) { DataTable dt = null; dt = OrganizationInfo.GetCityStateAndCountryByZipCode(txtZipCode.Text.Trim(), _GlobalCountryID); if (dt.Rows.Count > 0) { hdnLocationZipCodeID.Value = Convert.ToString(dt.Rows[0]["ZipcodeID"]); // ToolkitScriptManager.RegisterStartupScript(this, this.GetType(), "txtLocationZipCode_TextChanged", String.Format("SetHiddenFieldValue('{0}','{1}');", hdnLocationZipCodeID.ClientID, Convert.ToString(dt.Rows[0]["ZipcodeID"])), true); txtCity.Text = Convert.ToString(dt.Rows[0]["CityName"]); //if (ddlLocationCountry.Items.FindByValue(Convert.ToString(dt.Rows[0]["CountryId"])) != null) // ddlLocationCountry.SelectedValue = Convert.ToString(dt.Rows[0]["CountryId"]); //if (Convert.ToBoolean(dt.Rows[0]["IsETF"]) == true) //{ // chkboxetf.Checked = true; //} //else //{ // chkboxetf.Checked = false; //} System.Data.SqlClient.SqlParameter[] prm; prm = new System.Data.SqlClient.SqlParameter[1]; prm[0] = new System.Data.SqlClient.SqlParameter("@CountryId", _GlobalCountryID); Utils.GetLookUpData <DropDownList>(ref ddlState, LookUps.State, prm); prm = null; if (ddlState.Items.FindByValue(Convert.ToString(dt.Rows[0]["StateId"])) != null) { ddlState.SelectedValue = Convert.ToString(dt.Rows[0]["StateId"]); } txtPhoneNum.Focus(); lblLocationZipCode.Text = ""; } else { lblLocationZipCode.Text = "* Zipcode does not exist."; } }
protected void txtBusinessZipCode_TextChanged(object sender, EventArgs e) { DataTable dt = null; double stateId = OrganizationInfo.getStateId(OrganizationID); dt = OrganizationInfo.GetCityStateAndCountryByZipCode(txtZipCode.Text.Trim(), GlobalCountryID, stateId); if (dt.Rows.Count > 0) { hdnBusinessZipCodeId.Value = Convert.ToString(dt.Rows[0]["ZipcodeID"]); txtCity.Text = Convert.ToString(dt.Rows[0]["CityName"]); if (ddlCountry.Items.FindByValue(Convert.ToString(dt.Rows[0]["CountryId"])) != null) { ddlCountry.SelectedValue = Convert.ToString(dt.Rows[0]["CountryId"]); } System.Data.SqlClient.SqlParameter[] prm; prm = new System.Data.SqlClient.SqlParameter[1]; prm[0] = new System.Data.SqlClient.SqlParameter("@CountryId", ddlCountry.SelectedValue); Utils.GetLookUpData <DropDownList>(ref ddlState, LookUps.State, prm); prm = null; if (ddlState.Items.FindByValue(Convert.ToString(dt.Rows[0]["StateId"])) != null) { ddlState.SelectedValue = Convert.ToString(dt.Rows[0]["StateId"]); } txtBusinessAddress1.Focus(); lblBusinessZipCode.Text = ""; } else { txtZipCode.Text = ""; txtZipCode.Focus(); lblBusinessZipCode.Text = "* Zipcode does not exist in this state."; } lblinfo.Visible = false; }
protected void lnkbtnUpdate_Click(object sender, EventArgs e) { // int stateId = OrganizationInfo.getStateId(OrganizationID); //int organizationIdWithSimilerEmail = OrganizationInfo.getOrganizationIdByEmail(txtPrimaryEmail.Text.Trim(), stateId); //if (organizationIdWithSimilerEmail > 0) //{ // lblemailalreadyexists.Text = "Email already exists for this state. Choose another"; // lblemailalreadyexists.Visible = true; // return; //} DataTable dt = null; double stateId = OrganizationInfo.getStateId(OrganizationID); dt = OrganizationInfo.GetCityStateAndCountryByZipCode(txtZipCode.Text.Trim(), GlobalCountryID, stateId); if (dt.Rows.Count > 0) { } else { txtZipCode.Text = ""; txtZipCode.Focus(); lblBusinessZipCode.Text = "* Zipcode does not exist in this state."; return; } OrganizationInfo objOrg = new OrganizationInfo(OrganizationID); if (dddlcelltextmsgs.SelectedValue == "1") { objOrg.CellAcceptTextMessages = true; } else { objOrg.CellAcceptTextMessages = false; } if (ddlbusinesstextmsgs.SelectedValue == "1") { objOrg.AcceptTextMessages = true; } else { objOrg.AcceptTextMessages = false; } objOrg.OrganizationId = OrganizationID; // objOrg.Fax = txtFax.Text.Trim(); // objOrg.Address = txtAddress.Text.Trim(); // objOrg.BusinessType = txtBusinessType.Text.Trim(); // objOrg.BillMailAddress = txtBillingMailAddress.Text.Trim(); // objOrg.BillingContact = txtBillingContact.Text.Trim(); // objOrg.CellExtension = txtCellPhoneExtension.Text.Trim(); objOrg.LegalName = txtBusinessName.Text.Trim(); objOrg.DBAName = txtDBAName.Text.Trim(); objOrg.Website = txtWebsite.Text.Trim(); objOrg.IsActive = true; objOrg.IsOrganization = true; objOrg.LanguageId = LanguageId; objOrg.ContactTitleName = txtContactTitle.Text.Trim(); objOrg.RoleId = Conversion.ParseInt(UserInfo.UserRole.Stewardship); objOrg.UpdateOrganizationInfo(); ContactInfo objPrimaryContact = new ContactInfo(); objPrimaryContact.FirstName = txtFirstName.Text.Trim(); objPrimaryContact.LastName = txtLastName.Text.Trim(); objPrimaryContact.Email = txtPrimaryEmail.Text.Trim(); objPrimaryContact.IsActive = true; objPrimaryContact.IsPrimary = true; objPrimaryContact.LanguageId = LanguageId; objPrimaryContact.ContactTypeId = Convert.ToInt32(LookupsManagement.LookupType.ContactTypes_Business); Phones objPrimaryContactBusinessPhone = new Phones(); objPrimaryContactBusinessPhone.Number = txtPhoneNumber.Text.Trim().ToString(); objPrimaryContactBusinessPhone.Extension = txtPhoneExtension.Text.Trim().ToString(); objPrimaryContactBusinessPhone.IsActive = true; objPrimaryContactBusinessPhone.PhoneTypeId = Convert.ToInt32(LookupsManagement.LookupType.PhoneType_Business); Phones objPrimaryContactCellPhone = new Phones(); objPrimaryContactCellPhone.Number = txtCellPhoneNumber.Text.Trim(); objPrimaryContactCellPhone.IsActive = true; objPrimaryContactCellPhone.PhoneTypeId = Convert.ToInt32(LookupsManagement.LookupType.PhoneType_Cell); ContactInfo objBillingContact = new ContactInfo(); // objBillingContact.Email = txtBillingMailAddress.Text.Trim(); objBillingContact.IsActive = true; objBillingContact.IsPrimary = false; objBillingContact.LanguageId = LanguageId; objBillingContact.ContactTypeId = Convert.ToInt32(ContactInfo.ContactTypes.Billing); objBillingContact.ContactTypeId = Convert.ToInt32(LookupsManagement.LookupType.ContactTypes_Billing); Phones objBillingContactBusinessPhone = new Phones(); objBillingContactBusinessPhone.IsActive = true; objBillingContactBusinessPhone.PhoneTypeId = Convert.ToInt32(LookupsManagement.LookupType.PhoneType_Business); Phones objBillingContactCellPhone = new Phones(); objBillingContactCellPhone.IsActive = true; objBillingContactCellPhone.PhoneTypeId = Convert.ToInt32(LookupsManagement.LookupType.PhoneType_Cell); OrganizationInfo.Organization_Address objBusinessOrganization_Address = new OrganizationInfo.Organization_Address(); objBusinessOrganization_Address.ZipCodeID = Convert.ToInt32(hdnBusinessZipCodeId.Value); objBusinessOrganization_Address.ZipPostalCode = txtZipCode.Text.Trim().ToString(); objBusinessOrganization_Address.Address1 = txtBusinessAddress1.Text.Trim(); objBusinessOrganization_Address.Address2 = txtBusinessAddress2.Text.Trim(); objBusinessOrganization_Address.City = txtCity.Text.Trim().ToString(); objBusinessOrganization_Address.StateID = Convert.ToInt32(ddlState.SelectedValue); objBusinessOrganization_Address.CountryID = Convert.ToInt32(ddlCountry.SelectedValue); objBusinessOrganization_Address.DateCreated = DateTime.Now; objBusinessOrganization_Address.IsActive = true; objBusinessOrganization_Address.Organization_AddressTypeId = Convert.ToInt32(LookupsManagement.LookupType.OrganizationAddressType_Business); OrganizationInfo.Organization_Address objMailingOrganization_Address = new OrganizationInfo.Organization_Address(); objMailingOrganization_Address.DateCreated = DateTime.Now; objMailingOrganization_Address.IsActive = true; objMailingOrganization_Address.Organization_AddressTypeId = Convert.ToInt32(LookupsManagement.LookupType.OrganizationAddressType_Mailing); OrganizationInfo.UpdateStewardshipInfo(objOrg, objPrimaryContact, objPrimaryContactBusinessPhone, objPrimaryContactCellPhone, objBillingContact, objBillingContactBusinessPhone, objBillingContactCellPhone, objBusinessOrganization_Address, objMailingOrganization_Address); lblinfo.Visible = true; lblinfo.Text = "Successfully updated"; viewStakeholdersForApproval(); pnlDisplay.Visible = true; pnlEdit.Visible = false; }