Esempio n. 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            intProfile = Int32.Parse(Request.Cookies["profileid"].Value);
            oPage      = new Pages(intProfile, dsn);
            oRacksNew  = new RacksNew(intProfile, dsn);
            oLocations = new Locations(intProfile, dsn);

            if (Request.QueryString["applicationid"] != null && Request.QueryString["applicationid"] != "")
            {
                intApplication = Int32.Parse(Request.QueryString["applicationid"]);
            }
            if (Request.QueryString["pageid"] != null && Request.QueryString["pageid"] != "")
            {
                intPage = Int32.Parse(Request.QueryString["pageid"]);
            }
            if (Request.Cookies["application"] != null && Request.Cookies["application"].Value != "")
            {
                intApplication = Int32.Parse(Request.Cookies["application"].Value);
            }
            lblTitle.Text = oPage.Get(intPage, "title");
            string strName = "";

            if (Request.QueryString["name"] != null)
            {
                strName = Request.QueryString["name"];
            }
            if (!IsPostBack)
            {
                btnParent.Attributes.Add("onclick", "LoadLocationRoomRack('" + "rack" + "','" + hdnParent.ClientID + "', '', '','', '" + lblParent.ClientID + "');return false;");
                btnSubmit.Attributes.Add("onclick", "return ValidateHidden0('" + hdnParent.ClientID + "','" + btnParent.ClientID + "','Please select a rack')" +
                                         " && ValidateRadioList('" + radClass.ClientID + "','Please select a class')" +
                                         " && ValidateRadioList('" + radPosition.ClientID + "','Please select a position')" +
                                         " && ProcessControlButton()" +
                                         ";");
            }
            if (strName != "")
            {
                lblName.Text    = strName;
                panName.Visible = true;
                if (strName.Length == 11)
                {
                    Page.ClientScript.RegisterClientScriptBlock(typeof(Page), "name", "<script type=\"text/javascript\">alert('Enclosure Name Generated Successfully!\\n\\nEnclosure Name: " + Request.QueryString["name"] + "');<" + "/" + "script>");
                }
                else
                {
                    Page.ClientScript.RegisterClientScriptBlock(typeof(Page), "none", "<script type=\"text/javascript\">alert('Enclosure Name Failed!');<" + "/" + "script>");
                }
            }
        }
Esempio n. 2
0
        protected void PopulateLocations()
        {
            //Populate Location Selection
            if (intPlatform == 4)
            {
                if (hdnZoneId.Value == "")
                {
                    hdnZoneId.Value = "0";
                }
                Zones oZone = new Zones(intProfile, dsn);

                if (hdnRackId.Value == "")
                {
                    hdnRackId.Value = "0";
                }

                DataSet dsLocation = oZone.Gets(Int32.Parse(hdnRackId.Value));
                if (dsLocation.Tables[0].Rows.Count > 0)
                {
                    txtLocation.Text = dsLocation.Tables[0].Rows[0]["Location"].ToString();
                    txtRoom.Text     = dsLocation.Tables[0].Rows[0]["Room"].ToString();;
                    txtZone.Text     = dsLocation.Tables[0].Rows[0]["Zone"].ToString();;
                }
            }
            else
            {
                if (hdnRackId.Value == "")
                {
                    hdnRackId.Value = "0";
                }
                RacksNew oRack = new RacksNew(intProfile, dsn);

                DataSet dsLocation = oRack.Gets(Int32.Parse(hdnRackId.Value));
                if (dsLocation.Tables[0].Rows.Count > 0)
                {
                    txtLocation.Text = dsLocation.Tables[0].Rows[0]["Location"].ToString();
                    txtRoom.Text     = dsLocation.Tables[0].Rows[0]["Room"].ToString();;
                    txtZone.Text     = dsLocation.Tables[0].Rows[0]["Zone"].ToString();;
                    txtRack.Text     = dsLocation.Tables[0].Rows[0]["Rack"].ToString();;
                }
            }
        }
Esempio n. 3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Response.Cookies["loginreferrer"].Value   = "/admin/asset/asset_racks.aspx";
            Response.Cookies["loginreferrer"].Expires = DateTime.Now.AddDays(30);
            if (Request.Cookies["adminid"] != null && Request.Cookies["adminid"].Value != "")
            {
                intProfile = Int32.Parse(Request.Cookies["adminid"].Value);
            }
            else
            {
                Response.Redirect("/admin/login.aspx");
            }
            oRacks            = new RacksNew(intProfile, dsn);
            oAsset            = new Asset(intProfile, dsnAsset);
            oModelsProperties = new ModelsProperties(intProfile, dsn);
            if (!IsPostBack)
            {
                LoadList();
                if (Request.QueryString["zoneid"] != null && Request.QueryString["zoneid"] != "")
                {
                    hdnZoneId.Value = Request.QueryString["zoneid"];
                    LoadZones();
                    LoopRepeater();
                }

                btnOrder.Attributes.Add("onclick", "return OpenWindow('SUPPORTORDER','" + hdnId.ClientID + "','" + hdnOrder.ClientID + "&type=A_RACK" + "',false,400,400);");
                btnDelete.Attributes.Add("onclick", "return confirm('Are you sure you want to delete this item?');");
                btnCancel.Attributes.Add("onclick", "return Cancel();");

                btnAdd.Attributes.Add("onclick", "return ValidateHidden0('" + hdnZoneId.ClientID + "','" + btnSelectLocation.ClientID + "','Please select a location')" +
                                      " && ValidateText('" + txtName.ClientID + "','Please enter a rack name')" +
                                      " && ValidateText('" + txtAssetSerial.ClientID + "','Please enter asset serial #')" +
                                      " && ValidateText('" + txtAssetTag.ClientID + "','Please enter asset tag')" +
                                      " && ValidateDropDown('" + ddlModel.ClientID + "','Please select a model')" +
                                      " && ValidateText('" + txtDescription.ClientID + "','Please select a description')" +
                                      ";");

                btnSelectLocation.Attributes.Add("onclick", "return LoadLocationRoomRack('" + "zone" + "','" + hdnZoneId.ClientID + "', '" + txtLocation.ClientID + "', '" + txtRoom.ClientID + "','" + txtZone.ClientID + "');");
            }
        }
Esempio n. 4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Request.Cookies["adminid"] != null && Request.Cookies["adminid"].Value != "")
            {
                intProfile = Int32.Parse(Request.Cookies["adminid"].Value);
            }
            else
            {
                Response.Redirect("/admin/login.aspx");
            }

            oLocation = new Locations(intProfile, dsn);
            oRoom     = new RoomsNew(intProfile, dsn);
            oRack     = new RacksNew(intProfile, dsn);
            oZone     = new Zones(intProfile, dsn);

            if (!Page.IsPostBack)
            {
                if (Request.QueryString["type"] != null && Request.QueryString["type"] != "")
                {
                    strSelectionType = Request.QueryString["type"].ToString();
                }

                strSelectionType = strSelectionType.ToLower();

                //Get controls to populate on parent page
                if (Request.QueryString["Id"] != null && Request.QueryString["Id"] != "")
                {
                    intSelectionId = Int32.Parse(Request.QueryString["Id"]);
                }
                else
                {
                    chkCommonLocation.Checked = true;
                }

                if (Request.QueryString["hdnId"] != null && Request.QueryString["hdnId"] != "")
                {
                    lblParentCtrlHdnId.Text = Request.QueryString["hdnId"];
                }

                if (Request.QueryString["ctrlLocation"] != null && Request.QueryString["ctrlLocation"] != "")
                {
                    lblParentCtrlLocation.Text = Request.QueryString["ctrlLocation"];
                }

                if (Request.QueryString["ctrlRoom"] != null && Request.QueryString["ctrlRoom"] != "")
                {
                    lblParentCtrlRoom.Text = Request.QueryString["ctrlRoom"];
                }


                if (Request.QueryString["ctrlZone"] != null && Request.QueryString["ctrlZone"] != "")
                {
                    lblParentCtrlZone.Text = Request.QueryString["ctrlZone"];
                }

                if (Request.QueryString["ctrlRack"] != null && Request.QueryString["ctrlRack"] != "")
                {
                    lblParentCtrlRack.Text = Request.QueryString["ctrlRack"];
                }


                SetControls();

                if (intSelectionId > 0)
                {
                    DataSet dsLocation = null;
                    if (strSelectionType == "location")
                    {
                        dsLocation = oLocation.GetAddress(intSelectionId);
                        if (dsLocation.Tables[0].Rows.Count > 0)
                        {
                            DataRow dr            = dsLocation.Tables[0].Rows[0];
                            int     intLocationId = Int32.Parse(dr["id"].ToString());
                            int     intCityId     = Int32.Parse(oLocation.GetAddress(intLocationId, "cityid"));
                            int     intStateId    = Int32.Parse(oLocation.GetCity(intCityId, "stateid"));;
                            LoadState();
                            ddlState.SelectedValue = intStateId.ToString();
                            LoadCity();
                            ddlCity.SelectedValue = intCityId.ToString();
                            LoadAddress();
                            ddlLocation.SelectedValue = intLocationId.ToString();
                        }
                    }
                    else if (strSelectionType == "room")
                    {
                        dsLocation = oRoom.Gets(intSelectionId);
                        if (dsLocation.Tables[0].Rows.Count > 0)
                        {
                            DataRow dr = dsLocation.Tables[0].Rows[0];
                            LoadState();
                            ddlState.SelectedValue = dr["StateId"].ToString();
                            LoadCity();
                            ddlCity.SelectedValue = dr["CityId"].ToString();
                            LoadAddress();
                            ddlLocation.SelectedValue = dr["LocationId"].ToString();
                            LoadRoom();
                            ddlRoom.SelectedValue = dr["RoomId"].ToString();
                        }
                    }
                    else if (strSelectionType == "zone")
                    {
                        dsLocation = oZone.Gets(intSelectionId);
                        if (dsLocation.Tables[0].Rows.Count > 0)
                        {
                            DataRow dr = dsLocation.Tables[0].Rows[0];
                            LoadState();
                            ddlState.SelectedValue = dr["StateId"].ToString();
                            LoadCity();
                            ddlCity.SelectedValue = dr["CityId"].ToString();
                            LoadAddress();
                            ddlLocation.SelectedValue = dr["LocationId"].ToString();
                            LoadRoom();
                            ddlRoom.SelectedValue = dr["RoomId"].ToString();
                            LoadZone();
                            ddlZone.SelectedValue = dr["ZoneId"].ToString();
                        }
                    }
                    else if (strSelectionType == "rack")
                    {
                        dsLocation = oRack.Gets(intSelectionId);

                        if (dsLocation.Tables[0].Rows.Count > 0)
                        {
                            DataRow dr = dsLocation.Tables[0].Rows[0];
                            LoadState();
                            ddlState.SelectedValue = dr["StateId"].ToString();
                            LoadCity();
                            ddlCity.SelectedValue = dr["CityId"].ToString();
                            LoadAddress();
                            ddlLocation.SelectedValue = dr["LocationId"].ToString();
                            LoadRoom();
                            ddlRoom.SelectedValue = dr["RoomId"].ToString();
                            LoadZone();
                            ddlZone.SelectedValue = dr["ZoneId"].ToString();
                            LoadRack();
                            ddlRack.SelectedValue = dr["RackId"].ToString();
                        }
                    }
                }
            }
        }
Esempio n. 5
0
 protected void Page_Load(object sender, EventArgs e)
 {
     Response.Cookies["loginreferrer"].Value   = "/admin/asset/asset_switches.aspx";
     Response.Cookies["loginreferrer"].Expires = DateTime.Now.AddDays(30);
     if (Request.Cookies["adminid"] != null && Request.Cookies["adminid"].Value != "")
     {
         intProfile = Int32.Parse(Request.Cookies["adminid"].Value);
     }
     else
     {
         Response.Redirect("/admin/login.aspx");
     }
     oAsset            = new Asset(intProfile, dsnAsset, dsn);
     oEnvironment      = new Environments(intProfile, dsn);
     oClass            = new Classes(intProfile, dsn);
     oRacksNew         = new RacksNew(intProfile, dsn);
     oPlatform         = new Platforms(intProfile, dsn);
     oType             = new Types(intProfile, dsn);
     oModel            = new Models(intProfile, dsn);
     oModelsProperties = new ModelsProperties(intProfile, dsn);
     if (!IsPostBack)
     {
         LoadLists();
     }
     if (Request.QueryString["id"] == null)
     {
         if (Request.QueryString["parent"] == null)
         {
             LoadSwitches();
         }
         else
         {
             panAdd.Visible = true;
             int intParent = Int32.Parse(Request.QueryString["parent"]);
             if (!IsPostBack)
             {
                 hdnParent.Value = intParent.ToString();
                 if (intParent > 0)
                 {
                     lblParent.Text = oRacksNew.Get(intParent, "rack");
                 }
                 else
                 {
                     lblParent.Text = "** Please Select **";
                 }
                 txtBlades.Text = "0";
                 txtPorts.Text  = "0";
             }
         }
     }
     else
     {
         panAdd.Visible = true;
         intID          = Int32.Parse(Request.QueryString["id"]);
         if (!IsPostBack)
         {
             DataSet ds        = oAsset.GetSwitch(intID);
             int     intParent = Int32.Parse(ds.Tables[0].Rows[0]["rackid"].ToString());
             hdnParent.Value = intParent.ToString();
             txtSerial.Text  = ds.Tables[0].Rows[0]["serial"].ToString();
             txtAsset.Text   = ds.Tables[0].Rows[0]["asset"].ToString();
             int intModel = Int32.Parse(ds.Tables[0].Rows[0]["modelid"].ToString());
             hdnModel.Value = intModel.ToString();
             int intModelParent = Int32.Parse(oModelsProperties.Get(intModel, "modelid"));
             int intType        = oModel.GetType(intModelParent);
             int intPlatform    = oType.GetPlatform(intType);
             if (intPlatform > 0)
             {
                 ddlPlatform.SelectedValue = intPlatform.ToString();
                 // Load Types
                 LoadDDL(ddlType, "name", "id", oType.Gets(intPlatform, 1), intType.ToString());
                 if (intType > 0)
                 {
                     // Load Models
                     LoadDDL(ddlModel, "name", "id", oModel.Gets(intType, 1), intModelParent.ToString());
                     if (intModelParent > 0)
                     {
                         // Load Model Properties
                         LoadDDL(ddlModelProperty, "name", "id", oModelsProperties.GetModels(1, intModelParent, 1), intModel.ToString());
                     }
                 }
             }
             txtName.Text         = ds.Tables[0].Rows[0]["name"].ToString();
             lblParent.Text       = ds.Tables[0].Rows[0]["rack"].ToString();
             txtRackPosition.Text = ds.Tables[0].Rows[0]["rackposition"].ToString();
             txtBlades.Text       = ds.Tables[0].Rows[0]["blades"].ToString();
             txtPorts.Text        = ds.Tables[0].Rows[0]["ports"].ToString();
             chkIsIOS.Checked     = (ds.Tables[0].Rows[0]["is_ios"].ToString() == "1");
             chkIsNexus.Checked   = (ds.Tables[0].Rows[0]["nexus"].ToString() == "1");
             chkEnabled.Checked   = (ds.Tables[0].Rows[0]["enabled"].ToString() == "1");
         }
     }
     btnParent.Attributes.Add("onclick", "LoadLocationRoomRack('" + "rack" + "','" + hdnParent.ClientID + "', '', '','', '" + lblParent.ClientID + "');return false;");
     ddlClass.Attributes.Add("onchange", "PopulateEnvironments('" + ddlClass.ClientID + "','" + ddlEnvironment.ClientID + "',1);");
     ddlEnvironment.Attributes.Add("onchange", "UpdateDropDownHidden('" + ddlEnvironment.ClientID + "','" + hdnEnvironment.ClientID + "');");
     ddlPlatform.Attributes.Add("onchange", "PopulatePlatformTypes('" + ddlPlatform.ClientID + "','" + ddlType.ClientID + "','" + ddlModel.ClientID + "','" + ddlModelProperty.ClientID + "');ResetDropDownHidden('" + hdnModel.ClientID + "');");
     ddlType.Attributes.Add("onchange", "PopulatePlatformModels('" + ddlType.ClientID + "','" + ddlModel.ClientID + "','" + ddlModelProperty.ClientID + "');ResetDropDownHidden('" + hdnModel.ClientID + "');");
     ddlModel.Attributes.Add("onchange", "PopulatePlatformModelProperties('" + ddlModel.ClientID + "','" + ddlModelProperty.ClientID + "');ResetDropDownHidden('" + hdnModel.ClientID + "');");
     ddlModelProperty.Attributes.Add("onchange", "UpdateDropDownHidden('" + ddlModelProperty.ClientID + "','" + hdnModel.ClientID + "');");
     btnDelete.Attributes.Add("onclick", "return confirm('Are you sure you want to delete this item?');");
 }
        protected void Page_Load(object sender, EventArgs e)
        {
            AuthenticateUser();

            oUser             = new Users(intProfile, dsn);
            oServer           = new Servers(intProfile, dsn);
            oAsset            = new Asset(intProfile, dsnAsset, dsn);
            oAssetOrder       = new AssetOrder(intProfile, dsn, dsnAsset, intEnvironment);
            oForecast         = new Forecast(intProfile, dsn);
            oPlatform         = new Platforms(intProfile, dsn);
            oType             = new Types(intProfile, dsn);
            oModel            = new Models(intProfile, dsn);
            oModelsProperties = new ModelsProperties(intProfile, dsn);
            oIPAddresses      = new IPAddresses(intProfile, dsnIP, dsn);
            oFunction         = new Functions(intProfile, dsn, intEnvironment);
            oOperatingSystem  = new OperatingSystems(intProfile, dsn);
            oServicePack      = new ServicePacks(intProfile, dsn);
            oClass            = new Classes(intProfile, dsn);
            oEnvironment      = new Environments(intProfile, dsn);
            oLocation         = new Locations(intProfile, dsn);
            oSolaris          = new Solaris(intProfile, dsn);
            oRoom             = new RoomsNew(intProfile, dsn);
            oRack             = new RacksNew(intProfile, dsn);
            oResiliency       = new Resiliency(intProfile, dsn);
            if (Request.Cookies["profileid"] != null && Request.Cookies["profileid"].Value != "")
            {
                intProfile = Int32.Parse(Request.Cookies["profileid"].Value);
            }
            if (Request.QueryString["applicationid"] != null && Request.QueryString["applicationid"] != "")
            {
                intApplication = Int32.Parse(Request.QueryString["applicationid"]);
            }
            if (Request.Cookies["application"] != null && Request.Cookies["application"].Value != "")
            {
                intApplication = Int32.Parse(Request.Cookies["application"].Value);
            }

            if ((Request.QueryString["assetid"] != null && Request.QueryString["assetid"] != "") &&
                (Request.QueryString["orderid"] != null && Request.QueryString["orderid"] != ""))
            {
                hdnAssetId.Value = oFunction.decryptQueryString(Request.QueryString["assetid"]);
                hdnOrderId.Value = oFunction.decryptQueryString(Request.QueryString["orderid"]);
                //hdnAssetId.Value = "11049";  //Balde"24188";
                if (!IsPostBack)
                {
                    LoadList();
                    LoadAssetInformation();
                    populateLocations();
                }

                ddlClass.Attributes.Add("onchange", "PopulateEnvironments('" + ddlClass.ClientID + "','" + ddlEnvironment.ClientID + "',0);");
                ddlEnvironment.Attributes.Add("onchange", "UpdateDropDownHidden('" + ddlEnvironment.ClientID + "','" + hdnEnvironment.ClientID + "');");


                btnAddWWPortName.Attributes.Add("onclick", "return ValidateText('" + txtWWPortName.ClientID + "','Please enter a World Wide Port name') && ProcessControlButton()" +
                                                ";");
            }
            else
            {
                pnlAllow.Visible  = false;
                pnlDenied.Visible = true;
            }
        }
Esempio n. 7
0
        protected void Page_Load(object sender, EventArgs e)
        {
            intProfile = Int32.Parse(Request.Cookies["profileid"].Value);
            oPage      = new Pages(intProfile, dsn);
            oLocation  = new Locations(intProfile, dsn);
            oRoomsNew  = new RoomsNew(intProfile, dsn);
            oZone      = new Zones(intProfile, dsn);
            oRacksNew  = new RacksNew(intProfile, dsn);

            if (Request.QueryString["applicationid"] != null && Request.QueryString["applicationid"] != "")
            {
                intApplication = Int32.Parse(Request.QueryString["applicationid"]);
            }
            if (Request.QueryString["pageid"] != null && Request.QueryString["pageid"] != "")
            {
                intPage = Int32.Parse(Request.QueryString["pageid"]);
            }
            if (Request.Cookies["application"] != null && Request.Cookies["application"].Value != "")
            {
                intApplication = Int32.Parse(Request.Cookies["application"].Value);
            }

            if (!IsPostBack)
            {
                if (String.IsNullOrEmpty(Request.QueryString["ra"]) == false)
                {
                    DataSet rec = oRacksNew.Gets(Int32.Parse(Request.QueryString["ra"]));
                    if (rec.Tables[0].Rows.Count > 0)
                    {
                        lblRackZone.ToolTip      = rec.Tables[0].Rows[0]["zoneid"].ToString();
                        txtRackName.Text         = rec.Tables[0].Rows[0]["rack"].ToString();
                        txtRackU.Text            = "50";
                        txtRackAmp.Text          = "100";
                        txtRackDescription.Text  = rec.Tables[0].Rows[0]["description"].ToString();
                        chkRackAvailable.Checked = (rec.Tables[0].Rows[0]["enabled"].ToString() == "1");
                        btnRackUpdate.Visible    = true;
                        btnRackUpdate.Attributes.Add("onclick", "return ValidateText('" + txtRackName.ClientID + "','Please enter a name')" +
                                                     " && ProcessButton(this) && LoadWait()" +
                                                     ";");
                        btnRackDelete.Visible = true;
                        btnRackDelete.Attributes.Add("onclick", "return confirm('Are you sure you want to delete this item') && ProcessButton(this) && LoadWait();");
                    }
                    else if (String.IsNullOrEmpty(Request.QueryString["z"]) == false)
                    {
                        lblRackZone.ToolTip = Request.QueryString["z"];
                        btnRackAdd.Visible  = true;
                        btnRackAdd.Attributes.Add("onclick", "return ValidateText('" + txtRackName.ClientID + "','Please enter a name')" +
                                                  " && ProcessButton(this) && LoadWait()" +
                                                  ";");
                    }
                    lblRackZone.Text = oZone.Get(Int32.Parse(lblRackZone.ToolTip), "zone");
                    btnRackCancel.Attributes.Add("onclick", "return ProcessButton(this) && LoadWait();");
                    panRack.Visible = true;
                }
                else if (String.IsNullOrEmpty(Request.QueryString["z"]) == false)
                {
                    DataSet rec = oZone.Gets(Int32.Parse(Request.QueryString["z"]));
                    if (rec.Tables[0].Rows.Count > 0)
                    {
                        lblZoneRoom.ToolTip      = rec.Tables[0].Rows[0]["roomid"].ToString();
                        txtZoneName.Text         = rec.Tables[0].Rows[0]["zone"].ToString();
                        txtZoneDescription.Text  = rec.Tables[0].Rows[0]["description"].ToString();
                        chkZoneAvailable.Checked = (rec.Tables[0].Rows[0]["enabled"].ToString() == "1");
                        btnZoneUpdate.Visible    = true;
                        btnZoneUpdate.Attributes.Add("onclick", "return ValidateText('" + txtZoneName.ClientID + "','Please enter a name')" +
                                                     " && ProcessButton(this) && LoadWait()" +
                                                     ";");
                        btnZoneDelete.Visible = true;
                        btnZoneDelete.Attributes.Add("onclick", "return confirm('Are you sure you want to delete this item') && ProcessButton(this) && LoadWait();");

                        rptRacks.DataSource = oLocation.GetInventory(null, null, Int32.Parse(Request.QueryString["z"]));
                        rptRacks.DataBind();
                        lblRacks.Visible = (rptRacks.Items.Count == 0);
                    }
                    else if (String.IsNullOrEmpty(Request.QueryString["ro"]) == false)
                    {
                        lblZoneRoom.ToolTip = Request.QueryString["ro"];
                        btnZoneAdd.Visible  = true;
                        btnZoneAdd.Attributes.Add("onclick", "return ValidateText('" + txtZoneName.ClientID + "','Please enter a name')" +
                                                  " && ProcessButton(this) && LoadWait()" +
                                                  ";");
                        btnAddRack.Enabled = false;
                    }
                    lblZoneRoom.Text = oRoomsNew.Get(Int32.Parse(lblZoneRoom.ToolTip), "room");
                    btnZoneCancel.Attributes.Add("onclick", "return ProcessButton(this) && LoadWait();");
                    panZone.Visible = true;
                }
                else if (String.IsNullOrEmpty(Request.QueryString["ro"]) == false)
                {
                    DataSet rec = oRoomsNew.Gets(Int32.Parse(Request.QueryString["ro"]));
                    if (rec.Tables[0].Rows.Count > 0)
                    {
                        lblRoomLocation.ToolTip  = rec.Tables[0].Rows[0]["locationid"].ToString();
                        txtRoomName.Text         = rec.Tables[0].Rows[0]["room"].ToString();
                        txtRoomDescription.Text  = rec.Tables[0].Rows[0]["description"].ToString();
                        chkRoomAvailable.Checked = (rec.Tables[0].Rows[0]["enabled"].ToString() == "1");
                        btnRoomUpdate.Visible    = true;
                        btnRoomUpdate.Attributes.Add("onclick", "return ValidateText('" + txtRoomName.ClientID + "','Please enter a name')" +
                                                     " && ProcessButton(this) && LoadWait()" +
                                                     ";");
                        btnRoomDelete.Visible = true;
                        btnRoomDelete.Attributes.Add("onclick", "return confirm('Are you sure you want to delete this item') && ProcessButton(this) && LoadWait();");

                        rptZones.DataSource = oLocation.GetInventory(null, Int32.Parse(Request.QueryString["ro"]), null);
                        rptZones.DataBind();
                        lblZones.Visible = (rptZones.Items.Count == 0);
                    }
                    else if (String.IsNullOrEmpty(Request.QueryString["l"]) == false)
                    {
                        lblRoomLocation.ToolTip = Request.QueryString["l"];
                        btnRoomAdd.Visible      = true;
                        btnRoomAdd.Attributes.Add("onclick", "return ValidateText('" + txtRoomName.ClientID + "','Please enter a name')" +
                                                  " && ProcessButton(this) && LoadWait()" +
                                                  ";");
                        btnAddZone.Enabled = false;
                    }
                    lblRoomLocation.Text = oLocation.GetAddress(Int32.Parse(lblRoomLocation.ToolTip), "commonname");
                    btnRoomCancel.Attributes.Add("onclick", "return ProcessButton(this) && LoadWait();");
                    panRoom.Visible = true;
                }
                else if (String.IsNullOrEmpty(Request.QueryString["l"]) == false)
                {
                    DataSet rec = oLocation.GetAddress(Int32.Parse(Request.QueryString["l"]));
                    if (rec.Tables[0].Rows.Count > 0)
                    {
                        txtLocationName.Text         = rec.Tables[0].Rows[0]["commonname"].ToString();
                        txtLocationAddress.Text      = rec.Tables[0].Rows[0]["name"].ToString();
                        txtLocationCode.Text         = rec.Tables[0].Rows[0]["factory_code"].ToString();
                        chkLocationStorage.Checked   = (rec.Tables[0].Rows[0]["storage"].ToString() == "1");
                        chkLocationTSM.Checked       = (rec.Tables[0].Rows[0]["tsm"].ToString() == "1");
                        chkLocationProd.Checked      = (rec.Tables[0].Rows[0]["prod"].ToString() == "1");
                        chkLocationQA.Checked        = (rec.Tables[0].Rows[0]["qa"].ToString() == "1");
                        chkLocationTest.Checked      = (rec.Tables[0].Rows[0]["test"].ToString() == "1");
                        chkLocationDR.Checked        = (rec.Tables[0].Rows[0]["dr"].ToString() == "1");
                        txtLocationBuildingCode.Text = rec.Tables[0].Rows[0]["building_code"].ToString();
                        chkLocationAssignIP.Checked  = (rec.Tables[0].Rows[0]["vmware_ipaddress"].ToString() == "1");
                        chkLocationAvailable.Checked = (rec.Tables[0].Rows[0]["enabled"].ToString() == "1");
                        lblLocationCityID.Text       = rec.Tables[0].Rows[0]["cityid"].ToString();

                        btnLocationUpdate.Visible = true;
                        btnLocationUpdate.Attributes.Add("onclick", "return ValidateText('" + txtRoomName.ClientID + "','Please enter a name')" +
                                                         " && ProcessButton(this) && LoadWait()" +
                                                         ";");
                        btnLocationDelete.Visible = true;
                        btnLocationDelete.Attributes.Add("onclick", "return confirm('Are you sure you want to delete this item') && ProcessButton(this) && LoadWait();");

                        rptRooms.DataSource = oLocation.GetInventory(Int32.Parse(Request.QueryString["l"]), null, null);
                        rptRooms.DataBind();
                        lblRooms.Visible = (rptRooms.Items.Count == 0);
                    }
                    else
                    {
                        btnLocationAdd.Visible = true;
                        btnLocationAdd.Attributes.Add("onclick", "return ValidateText('" + txtLocationName.ClientID + "','Please enter a name')" +
                                                      " && ProcessButton(this) && LoadWait()" +
                                                      ";");
                        btnAddRoom.Enabled = false;
                    }
                    btnLocationCancel.Attributes.Add("onclick", "return ProcessButton(this) && LoadWait();");
                    panLocation.Visible = true;
                }
                else
                {
                    panLocations.Visible    = true;
                    rptLocations.DataSource = oLocation.GetInventory(null, null, null);
                    rptLocations.DataBind();
                }
            }
        }