protected void btnSaveNew_Click(Object Sender, EventArgs e) { if (Request.QueryString["new"] != null) { TextInfo oText = new CultureInfo("en-US", false).TextInfo; string strState = oText.ToTitleCase(txtState.Text.ToLower()); int intState = oLocation.GetState(strState); if (intState == 0) { oLocation.AddState(strState, "", 1); intState = oLocation.GetState(strState); } string strCity = oText.ToTitleCase(txtCity.Text.ToLower()); int intCity = oLocation.GetCity(strCity); if (intCity == 0) { oLocation.AddCity(intState, strCity, "", "", "", 1); intCity = oLocation.GetCity(strCity); } string strAddress = oText.ToTitleCase(txtAddress.Text.ToLower()); int intAddress = oLocation.GetAddress(strAddress); if (intAddress == 0) { oLocation.AddAddress(intCity, strAddress, "", 0, "", 0, 0, 0, 0, 1, "", "", 0, 0, 0, 0, 0, 1); intAddress = oLocation.GetAddress(strAddress); } Page.ClientScript.RegisterClientScriptBlock(typeof(Page), "new_saved", "<script type=\"text/javascript\">alert('Location Added Successfully');window.parent.UpdateLocation('" + intAddress.ToString() + "','" + Request.QueryString["control"] + "','" + oLocation.GetFull(intAddress) + "','" + Request.QueryString["controltext"] + "');window.parent.HidePanel();<" + "/" + "script>"); } }
protected void btnAdd_Click(Object Sender, EventArgs e) { int intParent = Int32.Parse(Request.Form[hdnParent.UniqueID]); if (Request.Form[hdnId.UniqueID] == "0") { oLocation.AddAddress(intParent, txtName.Text, txtCode.Text, (chkCommon.Checked ? 1 : 0), txtCommonName.Text, (chkStorage.Checked ? 1 : 0), (chkTSM.Checked ? 1 : 0), (chkDR.Checked ? 1 : 0), (radTypeOffsite.Checked ? 1 : 0), (radTypeManual.Checked ? 1 : 0), txtBuildingCode.Text, txtServiceNow.Text, (chkRecovery.Checked ? 1 : 0), (chkVMwareIP.Checked ? 1 : 0), (chkProd.Checked ? 1 : 0), (chkQA.Checked ? 1 : 0), (chkTest.Checked ? 1 : 0), (chkEnabled.Checked ? 1 : 0)); } else { oLocation.UpdateAddress(Int32.Parse(Request.Form[hdnId.UniqueID]), intParent, txtName.Text, txtCode.Text, (chkCommon.Checked ? 1 : 0), txtCommonName.Text, (chkStorage.Checked ? 1 : 0), (chkTSM.Checked ? 1 : 0), (chkDR.Checked ? 1 : 0), (radTypeOffsite.Checked ? 1 : 0), (radTypeManual.Checked ? 1 : 0), txtBuildingCode.Text, txtServiceNow.Text, (chkRecovery.Checked ? 1 : 0), (chkVMwareIP.Checked ? 1 : 0), (chkProd.Checked ? 1 : 0), (chkQA.Checked ? 1 : 0), (chkTest.Checked ? 1 : 0), (chkEnabled.Checked ? 1 : 0)); } if (Request.Form[hdnOrder.UniqueID] != "") { string strOrder = Request.Form[hdnOrder.UniqueID]; int intCount = 0; while (strOrder != "") { intCount++; int intId = Int32.Parse(strOrder.Substring(0, strOrder.IndexOf("&"))); strOrder = strOrder.Substring(strOrder.IndexOf("&") + 1); oLocation.UpdateAddressOrder(intId, intCount); } } Response.Redirect(Request.Path); }
protected void btnLocationAdd_Click(object sender, EventArgs e) { oLocation.AddAddress(0, txtLocationAddress.Text, txtLocationCode.Text, 1, txtLocationName.Text, chkLocationStorage.Checked ? 1 : 0, chkLocationTSM.Checked ? 1 : 0, chkLocationDR.Checked ? 1 : 0, 0, 0, txtLocationCode.Text, "", 0, chkLocationAssignIP.Checked ? 1 : 0, chkLocationProd.Checked ? 1 : 0, chkLocationQA.Checked ? 1 : 0, chkLocationTest.Checked ? 1 : 0, chkLocationAvailable.Checked ? 1 : 0); Response.Redirect(FormURL("")); }