Example #1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     Response.Cookies["loginreferrer"].Value   = "/admin/admin_hosts.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");
     }
     oHost             = new Host(intProfile, dsn);
     oModelsProperties = new ModelsProperties(intProfile, dsn);
     oPlatform         = new Platforms(intProfile, dsn);
     if (!IsPostBack)
     {
         LoopRepeater();
         btnOrder.Attributes.Add("onclick", "return OpenWindow('SUPPORTORDER','" + hdnId.ClientID + "','" + hdnOrder.ClientID + "&type=HOST" + "',false,400,400);");
         btnBrowse.Attributes.Add("onclick", "return OpenWindow('FILEBROWSER','" + txtPath.ClientID + "','',false,400,600);");
         btnDelete.Attributes.Add("onclick", "return confirm('Are you sure you want to delete this item?');");
         btnCancel.Attributes.Add("onclick", "return Cancel();");
         btnParent.Attributes.Add("onclick", "return OpenWindow('SUBMODELBROWSER','" + hdnParent.ClientID + "','&control=" + hdnParent.ClientID + "&controltext=" + lblParent.ClientID + "',false,400,600);");
         btnPlatform.Attributes.Add("onclick", "return OpenWindow('PLATFORMBROWSER','" + hdnPlatform.ClientID + "','&control=" + hdnPlatform.ClientID + "&controltext=" + lblPlatform.ClientID + "',false,400,600);");
     }
 }
        protected void Page_Load(object sender, EventArgs e)
        {
            ModelsProperties oModelsProperties = new ModelsProperties(0, dsn);

            if (Request.QueryString["u"] != null && Request.QueryString["u"] == "GET")
            {
                XmlDocument oDoc = new XmlDocument();
                oDoc.Load(Request.InputStream);
                Response.ContentType = "application/xml";
                StringBuilder sb        = new StringBuilder("<values>");
                string        strValue  = Server.UrlDecode(oDoc.FirstChild.InnerXml);
                int           intParent = Int32.Parse(strValue);
                DataSet       ds        = oModelsProperties.GetModels(1, intParent, 1);
                foreach (DataRow dr in ds.Tables[0].Rows)
                {
                    sb.Append("<value>");
                    sb.Append(dr["id"].ToString());
                    sb.Append("</value><text>");
                    sb.Append(dr["name"].ToString());
                    sb.Append("</text>");
                }
                sb.Append("</values>");
                Response.Write(sb.ToString());
                Response.End();
            }
        }
Example #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Response.Cookies["loginreferrer"].Value   = "/admin/asset/asset_models_other.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");
            }
            oPlatform         = new Platforms(intProfile, dsn);
            oType             = new Types(intProfile, dsn);
            oModel            = new Models(intProfile, dsn);
            oModelsProperties = new ModelsProperties(intProfile, dsn);
            oAssetCategory    = new AssetCategory(intProfile, dsn);
            oDell             = new Dells(intProfile, dsn);

            if (!IsPostBack)
            {
                LoadList();
                LoadPlatforms();
                btnParent.Attributes.Add("onclick", "return OpenWindow('MODELBROWSER','" + hdnParent.ClientID + "','&control=" + hdnParent.ClientID + "&controltext=" + lblParent.ClientID + "',false,400,600);");
                btnDelete.Attributes.Add("onclick", "return confirm('Are you sure you want to delete this item?');");
                btnCancel.Attributes.Add("onclick", "return Cancel();");
            }
        }
Example #4
0
 protected void Page_Load(object sender, EventArgs e)
 {
     Response.Cookies["loginreferrer"].Value   = "/admin/forecast/solution_codes.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");
     }
     oSolution         = new Solution(intProfile, dsn);
     oService          = new Services(intProfile, dsn);
     oModelsProperties = new ModelsProperties(intProfile, dsn);
     if (!IsPostBack)
     {
         LoopRepeater();
         btnOrder.Attributes.Add("onclick", "return OpenWindow('SUPPORTORDER','" + hdnId.ClientID + "','" + hdnOrder.ClientID + "&type=S_CODE" + "',false,400,400);");
         btnDelete.Attributes.Add("onclick", "return confirm('Are you sure you want to delete this item?');");
         btnCancel.Attributes.Add("onclick", "return Cancel();");
         btnParent.Attributes.Add("onclick", "return OpenWindow('SERVICEBROWSER','" + hdnParent.ClientID + "','&control=" + hdnParent.ClientID + "&controltext=" + lblParent.ClientID + "',false,400,600);");
         btnModel.Attributes.Add("onclick", "return OpenWindow('SUBMODELBROWSER','" + hdnModel.ClientID + "','&control=" + hdnModel.ClientID + "&controltext=" + lblModel.ClientID + "',false,400,600);");
     }
 }
        protected void Page_Load(object sender, EventArgs e)
        {
            intProfile   = Int32.Parse(Request.Cookies["profileid"].Value);
            oPage        = new Pages(intProfile, dsn);
            oUser        = new Users(intProfile, dsn);
            oPlatform    = new Platforms(intProfile, dsn);
            oStatusLevel = new StatusLevels(intProfile, dsn);
            oAssetOrder  = new AssetOrder(intProfile, dsn, dsnAsset, intEnvironment);

            oLocation         = new Locations(intProfile, dsn);
            oClass            = new Classes(intProfile, dsn);
            oModel            = new Models(intProfile, dsn);
            oModelsProperties = new ModelsProperties(intProfile, dsn);



            oRequest         = new Requests(intProfile, dsn);
            oResourceRequest = new ResourceRequest(intProfile, dsn);
            oService         = new Services(intProfile, dsn);
            oServiceRequest  = new ServiceRequests(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 (Request.QueryString["id"] != null && Request.QueryString["id"] != "")
            {
                intPlatform = Int32.Parse(Request.QueryString["id"]);
            }

            intPlatform = 1;
            if (intPlatform != 0)
            {
                pnlAllow.Visible = true;
                if (!IsPostBack)
                {
                    LoadDefaultValues(intPlatform);

                    btnApplyFilter.Attributes.Add("onclick", "return ValidateDate('" + txtStartDate.ClientID + "','Please enter start date')" +
                                                  " && ValidateDate('" + txtEndDate.ClientID + "','Please enter end date')" +
                                                  ";");
                }
                else
                {
                    Page.ClientScript.RegisterStartupScript(typeof(Page), "loadCurrentTab", "<script type=\"text/javascript\">window.top.LoadCurrentTab();<" + "/" + "script>");
                }
            }
            else
            {
                pnlDenied.Visible = true;
            }
        }
Example #6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            intProfile        = Int32.Parse(Request.Cookies["profileid"].Value);
            oPlatform         = new Platforms(intProfile, dsn);
            oType             = new Types(intProfile, dsn);
            oModelsProperties = new ModelsProperties(intProfile, dsn);
            oAsset            = new Asset(intProfile, dsnAsset);
            oServiceRequest   = new ServiceRequests(intProfile, dsn);
            oForecast         = new Forecast(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);
            }
            int intPlatform = 0;

            if (Request.QueryString["id"] != null && Request.QueryString["id"] != "")
            {
                intPlatform = Int32.Parse(Request.QueryString["id"]);
            }
            if (intPlatform > 0)
            {
                if (!IsPostBack)
                {
                }
            }
        }
        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
            {
                Reload();
            }
            oModel            = new Models(intProfile, dsn);
            oType             = new Types(intProfile, dsn);
            oPlatform         = new Platforms(intProfile, dsn);
            oModelsProperties = new ModelsProperties(intProfile, dsn);
            if (Request.QueryString["id"] != null && Request.QueryString["id"] != "")
            {
                lblId.Text = Request.QueryString["id"];
            }
            string strControl     = "";
            string strControlText = "";

            if (Request.QueryString["control"] != null)
            {
                strControl = Request.QueryString["control"];
            }
            if (Request.QueryString["controltext"] != null)
            {
                strControlText = Request.QueryString["controltext"];
            }
            btnNone.Attributes.Add("onclick", "return Reset(0,'" + hdnId.ClientID + "','None','" + txtName.ClientID + "');");
            btnSave.Attributes.Add("onclick", "return Update('" + hdnId.ClientID + "','" + strControl + "','" + txtName.ClientID + "','" + strControlText + "');");
            btnClose.Attributes.Add("onclick", "return HidePanel();");
            LoadTree();
        }
Example #8
0
 protected void Page_Load(object sender, EventArgs e)
 {
     AuthenticateUser();
     intProfile        = Int32.Parse(Request.Cookies["profileid"].Value);
     oAsset            = new Asset(0, dsnAsset);
     oModelsProperties = new ModelsProperties(0, dsn);
     if (Request.QueryString["id"] != null && Request.QueryString["id"] != "")
     {
         intID = Int32.Parse(Request.QueryString["id"]);
     }
     if (Request.QueryString["save"] != null)
     {
         Page.ClientScript.RegisterClientScriptBlock(typeof(Page), "saved", "<script type=\"text/javascript\">window.parent.navigate(window.parent.location);<" + "/" + "script>");
     }
     if (!IsPostBack)
     {
         DataSet ds = oAsset.Get(intID);
         if (ds.Tables[0].Rows.Count > 0)
         {
             lblTracking.Text = ds.Tables[0].Rows[0]["tracking"].ToString();
             lblSerial.Text   = ds.Tables[0].Rows[0]["serial"].ToString();
             lblModel.Text    = ds.Tables[0].Rows[0]["modelname"].ToString();
             lblAsset.Text    = ds.Tables[0].Rows[0]["asset"].ToString();
         }
         LoadLists();
     }
     ddlClass.Attributes.Add("onchange", "PopulateEnvironments('" + ddlClass.ClientID + "','" + ddlEnvironment.ClientID + "',0);");
     ddlEnvironment.Attributes.Add("onchange", "UpdateDropDownHidden('" + ddlEnvironment.ClientID + "','" + hdnEnvironment.ClientID + "');");
     btnSubmit.Attributes.Add("onclick", "return ValidateDropDown('" + ddlLocation.ClientID + "','Please select a location')" +
                              " && ValidateDropDown('" + ddlRoom.ClientID + "','Please select a room')" +
                              " && ValidateDropDown('" + ddlShelf.ClientID + "','Please select a rack')" +
                              ";");
     btnClose.Attributes.Add("onclick", "return parent.HidePanel();");
 }
 protected void Page_Load(object sender, EventArgs e)
 {
     intProfile        = Int32.Parse(Request.Cookies["profileid"].Value);
     oPlatform         = new Platforms(intProfile, dsn);
     oType             = new Types(intProfile, dsn);
     oModel            = new Models(intProfile, dsn);
     oModelsProperties = new ModelsProperties(intProfile, dsn);
     oForecast         = new Forecast(intProfile, dsn);
     oPage             = new Pages(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 (Request.QueryString["id"] != null && Request.QueryString["id"] != "")
     {
         intPlatform = Int32.Parse(Request.QueryString["id"]);
     }
     if (intPlatform > 0)
     {
         LoadLists();
     }
     ddlTypes.Attributes.Add("onchange", "WaitDDL('" + divTypes.ClientID + "');");
 }
Example #10
0
        protected void Page_Load(object sender, EventArgs e)
        {
            intProfile        = Int32.Parse(Request.Cookies["profileid"].Value);
            oPlatform         = new Platforms(intProfile, dsn);
            oType             = new Types(intProfile, dsn);
            oModelsProperties = new ModelsProperties(intProfile, dsn);
            oServiceRequest   = new ServiceRequests(intProfile, dsn);
            oForecast         = new Forecast(intProfile, dsn);
            oPage             = new Pages(intProfile, dsn);
            oIM       = new InventoryManager(intProfile, dsn);
            oLocation = 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);
            }

            if (Request.QueryString["id"] != null && Request.QueryString["id"] != "")
            {
                intPlatform = Int32.Parse(Request.QueryString["id"]);
            }

            if (intPlatform > 0)
            {
                intMax = Int32.Parse(oPlatform.Get(intPlatform, "max_inventory1"));

                if (!IsPostBack)
                {
                    LoadLists();
                }
                else
                {
                    Page.ClientScript.RegisterStartupScript(typeof(Page), "loadCurrentTab", "<script type=\"text/javascript\">window.top.LoadCurrentTab();<" + "/" + "script>");
                }

                btnProjects.Attributes.Add("onclick", "return MakeWider(this, '" + lstProjects.ClientID + "');");
                btnProjectsClear.Attributes.Add("onclick", "return ClearList('" + lstProjects.ClientID + "');");
                btnClasses.Attributes.Add("onclick", "return MakeWider(this, '" + lstClasses.ClientID + "');");
                btnClassesClear.Attributes.Add("onclick", "return ClearList('" + lstClasses.ClientID + "');");
                btnConfidences.Attributes.Add("onclick", "return MakeWider(this, '" + lstConfidences.ClientID + "');");
                btnConfidencesClear.Attributes.Add("onclick", "return ClearList('" + lstConfidences.ClientID + "');");
                btnEnvironments.Attributes.Add("onclick", "return MakeWider(this, '" + lstEnvironments.ClientID + "');");
                btnEnvironmentsClear.Attributes.Add("onclick", "return ClearList('" + lstEnvironments.ClientID + "');");
                btnLocations.Attributes.Add("onclick", "return MakeWider(this, '" + lstLocations.ClientID + "');");
                btnLocationsClear.Attributes.Add("onclick", "return ClearList('" + lstLocations.ClientID + "');");
                lstClasses.Attributes.Add("onchange", "PopulateEnvironmentsList('" + lstClasses.ClientID + "','" + lstEnvironments.ClientID + "',0);");
                lstEnvironments.Attributes.Add("onchange", "UpdateListHidden('" + lstEnvironments.ClientID + "','" + hdnEnvironment.ClientID + "');");
                imgStart.Attributes.Add("onclick", "return ShowCalendar('" + txtStart.ClientID + "');");
                imgEnd.Attributes.Add("onclick", "return ShowCalendar('" + txtEnd.ClientID + "');");
            }
        }
Example #11
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string strDirectory = Request.PhysicalApplicationPath + "images\\temp\\barcode";

            if (Directory.Exists(strDirectory) == false)
            {
                Directory.CreateDirectory(strDirectory);
            }
            else
            {
                DirectoryInfo        oDir   = new DirectoryInfo(strDirectory);
                DirectoryInfo[]      oDirs  = oDir.GetDirectories();
                System.IO.FileInfo[] oFiles = oDir.GetFiles();
                foreach (System.IO.FileInfo oFile in oFiles)
                {
                    if ((File.GetAttributes(strDirectory + "\\" + oFile.Name) & FileAttributes.ReadOnly) != FileAttributes.ReadOnly)
                    {
                        File.Delete(strDirectory + "\\" + oFile.Name);
                    }
                }
            }
            oModelsProperties = new ModelsProperties(0, dsn);
            int intCol = 0;

            if (Request.QueryString["modelid"] != null)
            {
                string strFile = LoadImage(Int32.Parse(Request.QueryString["modelid"]), strDirectory);
                strCodes1 = "<p><img src=\"/images/temp/barcode/" + strFile + "\" border=\"0\" align=\"absmiddle\"/></p>";
            }
            else if (Request.QueryString["id"] != null)
            {
                DataSet ds = oModelsProperties.GetTypes(0, Int32.Parse(Request.QueryString["id"]), 1);
                foreach (DataRow dr in ds.Tables[0].Rows)
                {
                    intCol++;
                    string strFile = LoadImage(Int32.Parse(dr["id"].ToString()), strDirectory);
                    if (intCol == 3)
                    {
                        intCol = 1;
                    }
                    if (intCol == 1)
                    {
                        strCodes1 += "<p class=\"header\">" + dr["name"].ToString() + "<br/><img src=\"/images/temp/barcode/" + strFile + "\" border=\"0\" align=\"absmiddle\"/></p>";
                    }
                    else if (intCol == 2)
                    {
                        strCodes2 += "<p class=\"header\">" + dr["name"].ToString() + "<br/><img src=\"/images/temp/barcode/" + strFile + "\" border=\"0\" align=\"absmiddle\"/></p>";
                    }
                    else if (intCol == 3)
                    {
                        strCodes3 += "<p class=\"header\">" + dr["name"].ToString() + "<br/><img src=\"/images/temp/barcode/" + strFile + "\" border=\"0\" align=\"absmiddle\"/></p>";
                    }
                }
            }
        }
Example #12
0
        private void LoadSecurity()
        {
            ModelsProperties oModelsProperties = new ModelsProperties(intProfile, dsn);
            Servers          oServer           = new Servers(intProfile, dsn);
            OnDemand         oOnDemand         = new OnDemand(0, dsn);

            int     intAnswer  = 0;
            int     intModel   = 0;
            DataSet dsSecurity = oOnDemandTasks.GetServerOther(intRequest, intService, intNumber);

            if (dsSecurity.Tables[0].Rows.Count > 0)
            {
                intAnswer = Int32.Parse(dsSecurity.Tables[0].Rows[0]["answerid"].ToString());
                intModel  = Int32.Parse(dsSecurity.Tables[0].Rows[0]["modelid"].ToString());
            }
            //intAnswer = 2681;
            //intModel = 395;
            int intStep = (oModelsProperties.IsTypeVMware(intModel) ? 6 : 4);

            if (intAnswer > 0)
            {
                panSecurity.Visible = true;
                string strRequestResult = "";

                // PRE (creation of groups)
                DataSet dsServers = oServer.GetAnswer(intAnswer);
                foreach (DataRow drServer in dsServers.Tables[0].Rows)
                {
                    strRequestResult += "<tr>";
                    int intServer = Int32.Parse(drServer["id"].ToString());
                    strRequestResult += "<td valign=\"top\"><b>" + oServer.GetName(intServer, true) + ":</b></td>";
                    DataSet dsStep = oOnDemand.GetStepDoneServer(intServer, intStep);
                    if (dsStep.Tables[0].Rows.Count > 0)
                    {
                        strRequestResult += "<td valign=\"top\">" + dsStep.Tables[0].Rows[0]["result"].ToString() + "</td>";
                    }
                    strRequestResult += "</tr>";
                }
                if (strRequestResult != "")
                {
                    strRequestResult = "<table cellpadding=\"3\" cellspacing=\"2\" border=\"0\">" + strRequestResult + "</table>";
                }
                lblSecurityPre.Text = strRequestResult;

                // POST (account generation and ties to groups)
                strRequestResult = "";
                int     intRequestAD    = oForecast.GetRequestID(intAnswer, true);
                DataSet dsRequestResult = oRequest.GetResult(intRequestAD);
                foreach (DataRow drRequestResult in dsRequestResult.Tables[0].Rows)
                {
                    strRequestResult += drRequestResult["result"].ToString();
                }
                lblSecurityPost.Text = strRequestResult;
            }
        }
Example #13
0
        protected void Page_Load(object sender, EventArgs e)
        {
            intProfile        = Int32.Parse(Request.Cookies["profileid"].Value);
            oPlatform         = new Platforms(intProfile, dsn);
            oType             = new Types(intProfile, dsn);
            oModelsProperties = new ModelsProperties(intProfile, dsn);
            oServiceRequest   = new ServiceRequests(intProfile, dsn);
            oForecast         = new Forecast(intProfile, dsn);
            oPage             = new Pages(intProfile, dsn);
            oClass            = new Classes(intProfile, dsn);
            oAsset            = new Asset(intProfile, dsnAsset);
            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);
            }
            int intPlatform = 0;

            if (Request.QueryString["id"] != null && Request.QueryString["id"] != "")
            {
                intPlatform = Int32.Parse(Request.QueryString["id"]);
            }
            if (intPlatform > 0)
            {
                intMax = Int32.Parse(oPlatform.Get(intPlatform, "max_inventory1"));
                if (!IsPostBack)
                {
                    LoadLists();
                    LoadFilters();
                    LoadGroups(intPlatform);
                }
                btnProjects.Attributes.Add("onclick", "return MakeWider(this, '" + lstProjects.ClientID + "');");
                btnProjectsClear.Attributes.Add("onclick", "return ClearList('" + lstProjects.ClientID + "');");
                btnClasses.Attributes.Add("onclick", "return MakeWider(this, '" + lstClasses.ClientID + "');");
                btnClassesClear.Attributes.Add("onclick", "return ClearList('" + lstClasses.ClientID + "');");
                btnConfidences.Attributes.Add("onclick", "return MakeWider(this, '" + lstConfidences.ClientID + "');");
                btnConfidencesClear.Attributes.Add("onclick", "return ClearList('" + lstConfidences.ClientID + "');");
                btnEnvironments.Attributes.Add("onclick", "return MakeWider(this, '" + lstEnvironments.ClientID + "');");
                btnEnvironmentsClear.Attributes.Add("onclick", "return ClearList('" + lstEnvironments.ClientID + "');");
                btnLocations.Attributes.Add("onclick", "return MakeWider(this, '" + lstLocations.ClientID + "');");
                btnLocationsClear.Attributes.Add("onclick", "return ClearList('" + lstLocations.ClientID + "');");
                lstClasses.Attributes.Add("onchange", "PopulateEnvironmentsList('" + lstClasses.ClientID + "','" + lstEnvironments.ClientID + "',0);");
                lstEnvironments.Attributes.Add("onchange", "UpdateListHidden('" + lstEnvironments.ClientID + "','" + hdnEnvironment.ClientID + "');");
                imgStart.Attributes.Add("onclick", "return ShowCalendar('" + txtStart.ClientID + "');");
                imgEnd.Attributes.Add("onclick", "return ShowCalendar('" + txtEnd.ClientID + "');");
            }
        }
Example #14
0
 protected void Page_Load(object sender, EventArgs e)
 {
     intProfile        = Int32.Parse(Request.Cookies["profileid"].Value);
     oPage             = new Pages(intProfile, dsn);
     oAsset            = new Asset(intProfile, dsnAsset);
     oIPAddresses      = new IPAddresses(intProfile, dsnIP, dsn);
     oOrder            = new Orders(intProfile, dsnAsset);
     oModelsProperties = new ModelsProperties(intProfile, dsn);
     oType             = new Types(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 (Request.QueryString["add_deploy"] != null)
     {
         Page.ClientScript.RegisterClientScriptBlock(typeof(Page), "add_deploy", "<script type=\"text/javascript\">alert('The device was successfully deployed');<" + "/" + "script>");
     }
     if (Request.QueryString["add_return"] != null)
     {
         Page.ClientScript.RegisterClientScriptBlock(typeof(Page), "add_return", "<script type=\"text/javascript\">alert('The device was successfully returned');<" + "/" + "script>");
     }
     if (!IsPostBack)
     {
         int intPlatform = 0;
         if (Request.QueryString["id"] != null && Request.QueryString["id"] != "")
         {
             intPlatform = Int32.Parse(Request.QueryString["id"]);
         }
         if (intPlatform > 0)
         {
             rptDevices.DataSource = oAsset.Gets(intPlatform, (int)AssetStatus.Arrived);
             rptDevices.DataBind();
             foreach (RepeaterItem ri in rptDevices.Items)
             {
                 Button btnReturn = (Button)ri.FindControl("btnReturn");
                 btnReturn.Attributes.Add("onclick", "return confirm('Are you sure you want to return this device?');");
                 Button btnDeploy = (Button)ri.FindControl("btnDeploy");
                 int    intType   = oModelsProperties.GetType(Int32.Parse(btnDeploy.CommandName));
                 btnDeploy.Attributes.Add("onclick", "return OpenWindow('ASSET_DEPLOY','" + oType.Get(intType, "asset_deploy_path") + "?id=" + btnDeploy.CommandArgument + "');");
             }
             lblNone.Visible = (rptDevices.Items.Count == 0);
         }
     }
 }
Example #15
0
        protected void Page_Load(object sender, EventArgs e)
        {
            intProfile        = Int32.Parse(Request.Cookies["profileid"].Value);
            oPage             = new Pages(intProfile, dsn);
            oUser             = new Users(intProfile, dsn);
            oServer           = new Servers(intProfile, dsn);
            oResourceRequest  = new ResourceRequest(intProfile, dsn);
            oModelsProperties = new ModelsProperties(intProfile, dsn);
            oAsset            = new Asset(intProfile, dsnAsset);
            oFunctions        = new Functions(intProfile, dsn, intEnvironment);
            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");
            bool boolAdmin = false;

            string[] strProfile;
            char[]   strSplit = { ';' };
            strProfile = strAssetAdmins.Split(strSplit);
            for (int ii = 0; ii < strProfile.Length; ii++)
            {
                if (strProfile[ii].Trim() != "")
                {
                    if (Int32.Parse(strProfile[ii].Trim()) == intProfile)
                    {
                        boolAdmin = true;
                    }
                }
            }
            btnStatus.Enabled = boolAdmin;
            if (!IsPostBack)
            {
                if (Request.QueryString["serial"] != null)
                {
                    string strQuery = oFunctions.decryptQueryString(Request.QueryString["serial"]);
                    txtSerial.Text = strQuery;
                    CheckResults(strQuery);
                }
                txtSerial.Attributes.Add("onkeydown", "if(event.which || event.keyCode){if ((event.which == 13) || (event.keyCode == 13)) {document.getElementById('" + btnSearch.ClientID + "').click();return false;}} else {return true}; ");
                btnSearch.Attributes.Add("onclick", "return ValidateText('" + txtSerial.ClientID + "','Please enter a serial number');");
                btnStatus.Attributes.Add("onclick", "return (ValidateText('" + txtName.ClientID + "','Please enter the server name') && confirm('NOTE: Changing the status of a device could greatly impact the ability of ClearView to auto-provision devices.\\n\\nAre you sure you want to update the status?'));");
            }
        }
Example #16
0
        protected void Page_Load(object sender, EventArgs e)
        {
            intProfile = Int32.Parse(Request.Cookies["profileid"].Value);
            Workstations     oWorkstation      = new Workstations(0, dsn);
            OnDemand         oOnDemand         = new OnDemand(0, dsn);
            Forecast         oForecast         = new Forecast(0, dsn);
            ModelsProperties oModelsProperties = new ModelsProperties(0, dsn);

            if (Request.QueryString["id"] != null && Request.QueryString["id"] != "")
            {
                Functions oFunction      = new Functions(0, dsn, intEnvironment);
                int       intWorkstation = Int32.Parse(oFunction.decryptQueryString(Request.QueryString["id"]));
                int       intType        = oModelsProperties.GetType(intModelVirtual);
                DataSet   dsSteps        = oOnDemand.GetSteps(intType, 1);
                DataSet   ds             = oWorkstation.GetVirtual(intWorkstation);
                if (ds.Tables[0].Rows.Count > 0)
                {
                    int          intAnswer   = Int32.Parse(ds.Tables[0].Rows[0]["answerid"].ToString());
                    int          intRemote   = Int32.Parse(ds.Tables[0].Rows[0]["remoteid"].ToString());
                    int          intCurrent  = Int32.Parse(ds.Tables[0].Rows[0]["step"].ToString());
                    Workstations workstation = new Workstations(0, dsnRemote);
                    DataSet      dsResult    = workstation.GetWorkstationVirtualRemoteStatus(intRemote);
                    if (dsResult.Tables[0].Rows.Count > 0)
                    {
                        int intStep = Int32.Parse(dsResult.Tables[0].Rows[0]["step"].ToString());
                        int intID   = Int32.Parse(dsResult.Tables[0].Rows[0]["id"].ToString());
                        if (intStep == 1)
                        {
                            oWorkstation.AssignHost(intWorkstation, dsnRemote, dsnAsset, intEnvironment, dsnZeus);
                            Page.ClientScript.RegisterClientScriptBlock(typeof(Page), "completed", "<script type=\"text/javascript\">window.onload = new Function(\"redirectWait();\");<" + "/" + "script>");
                        }
                        else if (intCurrent < intStep)
                        {
                            oOnDemand.UpdateStepDoneWorkstation(intWorkstation, intCurrent, oOnDemand.GetStep(intStep, "done"), 0, false, false);
                            oWorkstation.NextVirtualStep(intWorkstation);
                            Page.ClientScript.RegisterClientScriptBlock(typeof(Page), "completed", "<script type=\"text/javascript\">window.onload = new Function(\"redirect();\");<" + "/" + "script>");
                        }
                        else if (intCurrent == dsSteps.Tables[0].Rows.Count)
                        {
                            oWorkstation.NextVirtualStep(intWorkstation);
                            //SqlHelper.ExecuteNonQuery(dsnRemote, CommandType.Text, "UPDATE cv_virtual_workstations SET deleted = 1 WHERE id = " + intID.ToString() + " AND deleted = 0");
                            oForecast.UpdateAnswerCompleted(intAnswer);
                            oWorkstation.UpdateVirtualCompleted(intWorkstation);
                            Page.ClientScript.RegisterClientScriptBlock(typeof(Page), "completed", "<script type=\"text/javascript\">window.onload = new Function(\"redirect();\");<" + "/" + "script>");
                        }
                    }
                }
                Page.ClientScript.RegisterClientScriptBlock(typeof(Page), "completed", "<script type=\"text/javascript\">window.onload = new Function(\"redirectWait();\");<" + "/" + "script>");
            }
        }
Example #17
0
        public void Begin()
        {
            datStart     = DateTime.Now;
            arProcessing = new int[4] {
                45, 47, 92, 124
            };                                               // 92 = \, 124 = |, 47 = /, 45 = -
            strSSH            = "";
            oModel            = new Models(0, dsn);
            oModelsProperties = new ModelsProperties(0, dsn);
            oServer           = new Servers(0, dsn);
            oSetting          = new Settings(0, dsn);
            oOnDemand         = new OnDemand(0, dsn);
            oSolaris          = new Solaris(0, dsn);
            oEventLog         = new Log(0, dsn);
            oFunction         = new Functions(0, dsn, intEnvironment);
            strTo             = oFunction.GetGetEmailAlertsEmailIds("EMAILGRP_PROVISIONING_SUPPORT");
            intModel          = Int32.Parse(oServer.Get(intServer, "modelid"));
            if (intModel > 0)
            {
                strModel = oModelsProperties.Get(intModel, "name");
                Int32.TryParse(oModelsProperties.Get(intModel, "modelid"), out intModelParent);
                if (intModelParent > 0)
                {
                    Int32.TryParse(oModel.Get(intModelParent, "boot_groupid"), out intModelBootGroup);
                }
            }

            if (intModelBootGroup > 0)
            {
                string strUsername = oModel.GetBootGroup(intModelBootGroup, "username");
                string strPassword = oModel.GetBootGroup(intModelBootGroup, "password");
                strReturnToALOM = oModel.GetBootGroup(intModelBootGroup, "return_to_alom");
                oEventLog.AddEvent(strName, strSerial, "Connecting to " + strILO + "... (U:" + strUsername + ", P:****)", LoggingType.Information);
                oSSHshell = new SshShell(strILO, strUsername, strPassword);
                oSSHshell.RemoveTerminalEmulationCharacters = true;
                oSSHshell.Connect();
                oEventLog.AddEvent(strName, strSerial, "Connected to " + strILO + "...sending commands...", LoggingType.Information);

                ThreadStart oReadingDoneSSH    = new ThreadStart(ReadingDoneSSH);
                Thread      oJobReadingDoneSSH = new Thread(oReadingDoneSSH);
                oJobReadingDoneSSH.Start();

                ReadingSSH();
            }
            else
            {
                AddResult("The boot group of the model has not been configured ~ (ModelPropertyID = " + intModel.ToString() + ") (ModelID = " + intModelParent.ToString() + ") (ModelBootGroupID = " + intModelBootGroup.ToString() + ")");
            }
        }
Example #18
0
 protected void Page_Load(object sender, EventArgs e)
 {
     AuthenticateUser();
     intProfile        = Int32.Parse(Request.Cookies["profileid"].Value);
     oAsset            = new Asset(0, dsnAsset);
     oIPAddresses      = new IPAddresses(0, dsnIP, dsn);
     oModel            = new Models(0, dsn);
     oModelsProperties = new ModelsProperties(0, dsn);
     if (Request.QueryString["id"] != null && Request.QueryString["id"] != "")
     {
         intID = Int32.Parse(Request.QueryString["id"]);
     }
     if (Request.QueryString["add"] != null)
     {
         Page.ClientScript.RegisterClientScriptBlock(typeof(Page), "add", "<script type=\"text/javascript\">alert('The HBA was successfully added');<" + "/" + "script>");
     }
     if (Request.QueryString["delete"] != null)
     {
         Page.ClientScript.RegisterClientScriptBlock(typeof(Page), "delete", "<script type=\"text/javascript\">alert('The HBA was successfully deleted');<" + "/" + "script>");
     }
     if (!IsPostBack)
     {
         DataSet ds = oAsset.Get(intID);
         if (ds.Tables[0].Rows.Count > 0)
         {
             lblTracking.Text = ds.Tables[0].Rows[0]["tracking"].ToString();
             lblSerial.Text   = ds.Tables[0].Rows[0]["serial"].ToString();
             int intModel = Int32.Parse(ds.Tables[0].Rows[0]["modelid"].ToString());
             intModel          = Int32.Parse(oModelsProperties.Get(intModel, "modelid"));
             lblModel.Text     = ds.Tables[0].Rows[0]["modelname"].ToString();
             lblAsset.Text     = ds.Tables[0].Rows[0]["asset"].ToString();
             rptHBA.DataSource = oAsset.GetHBA(intID);
             rptHBA.DataBind();
             lblHBA.Visible = (rptHBA.Items.Count == 0);
             foreach (RepeaterItem ri in rptHBA.Items)
             {
                 LinkButton btnDelete = (LinkButton)ri.FindControl("btnDelete");
                 btnDelete.Attributes.Add("onclick", "return confirm('Are you sure you want to delete this item?');");
             }
             btnAdd.Attributes.Add("onclick", "return ValidateText('" + txtName.ClientID + "','Please enter a name')" +
                                   ";");
             txtName.Attributes.Add("onkeydown", "if(event.which || event.keyCode){if ((event.which == 13) || (event.keyCode == 13)) {document.getElementById('" + btnAdd.ClientID + "').click();return false;}} else {return true}; ");
         }
         else
         {
             btnAdd.Enabled = false;
         }
     }
 }
 protected void Page_Load(object sender, EventArgs e)
 {
     intProfile        = Int32.Parse(Request.Cookies["profileid"].Value);
     oPage             = new Pages(intProfile, dsn);
     oAsset            = new Asset(intProfile, dsnAsset);
     oPlatform         = new Platforms(intProfile, dsn);
     oType             = new Types(intProfile, dsn);
     oModel            = new Models(intProfile, dsn);
     oModelsProperties = new ModelsProperties(intProfile, dsn);
     oDepot            = new Depot(intProfile, dsn);
     oDepotRoom        = new DepotRoom(intProfile, dsn);
     oShelf            = new Shelf(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 (Request.QueryString["save"] != null && Request.QueryString["save"] != "")
     {
         Page.ClientScript.RegisterClientScriptBlock(typeof(Page), "saved", "<script type=\"text/javascript\">alert('Asset Successfully Added');window.navigate('" + oPage.GetFullLink(intPage) + "?pid=" + Request.QueryString["pid"] + "&tid=" + Request.QueryString["tid"] + "&mid=" + Request.QueryString["mid"] + "');<" + "/" + "script>");
     }
     if (Request.QueryString["duplicate"] != null && Request.QueryString["duplicate"] != "")
     {
         Page.ClientScript.RegisterClientScriptBlock(typeof(Page), "duplicated", "<script type=\"text/javascript\">alert('Duplicate Asset Information Found.\\n\\nAnother asset has the same serial number or asset tag as the one you entered. You can locate this device by using the search page.');window.navigate('" + oPage.GetFullLink(intPage) + "?pid=" + Request.QueryString["pid"] + "&tid=" + Request.QueryString["tid"] + "&mid=" + Request.QueryString["mid"] + "');<" + "/" + "script>");
     }
     if (!IsPostBack)
     {
         LoadLists();
         txtDate.Text = DateTime.Today.ToShortDateString();
     }
     imgDate.Attributes.Add("onclick", "return ShowCalendar('" + txtDate.ClientID + "');");
     btnSubmit.Attributes.Add("onclick", "return ValidateDropDown('" + ddlModel.ClientID + "','Please make a selection for the model')" +
                              " && ValidateText('" + txtSerial.ClientID + "','Please enter the serial number')" +
                              " && ValidateDropDown('" + ddlDepot.ClientID + "','Please make a selection for the location of the asset')" +
                              " && ValidateText('" + txtDepotRoom.ClientID + "','Please enter the depot room')" +
                              " && ValidateText('" + txtShelf.ClientID + "','Please enter the shelf')" +
                              " && ValidateDate('" + txtDate.ClientID + "','Please enter a valid date')" +
                              " && ValidateNumber0('" + txtPorts.ClientID + "','Please enter a valid number of available ports')" +
                              ";");
 }
Example #20
0
 protected void Page_Load(object sender, EventArgs e)
 {
     Response.Cookies["loginreferrer"].Value   = "/admin/asset/asset_scangun.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");
     }
     oPlatform         = new Platforms(intProfile, dsn);
     oType             = new Types(intProfile, dsn);
     oModel            = new Models(intProfile, dsn);
     oModelsProperties = new ModelsProperties(intProfile, dsn);
 }
        protected void Page_Load(object sender, EventArgs e)
        {
            oModelsProperties = new ModelsProperties(0, dsn);

            if (Request.QueryString["u"] != null && Request.QueryString["u"] == "GET")
            {
                XmlDocument oDoc = new XmlDocument();
                oDoc.Load(Request.InputStream);

                int    intModel         = Int32.Parse(Server.UrlDecode(oDoc.ChildNodes[0].ChildNodes[0].InnerText));
                string strAssetCategory = oModelsProperties.Get(intModel, "asset_category");

                Response.ContentType = "text/xml";
                Response.Write("<values><value>" + strAssetCategory + "</value></values>");
                Response.End();
            }
        }
Example #22
0
 protected void Page_Load(object sender, EventArgs e)
 {
     oModelsProperties = new ModelsProperties(0, dsn);
     if (Request.QueryString["mid"] != null && Request.QueryString["mid"] != "")
     {
         intModel = Int32.Parse(Request.QueryString["mid"]);
         if (intModel > 0)
         {
             lblName.Text = oModelsProperties.Get(intModel, "name");
         }
     }
     if (Request.QueryString["id"] != null && Request.QueryString["id"] != "")
     {
         intID = Int32.Parse(Request.QueryString["id"]);
         if (IsPostBack == false)
         {
             panOne.Visible = true;
             DataSet ds = oModelsProperties.GetThreshold(intID);
             if (ds.Tables[0].Rows.Count > 0)
             {
                 txtFrom.Text       = ds.Tables[0].Rows[0]["qty_from"].ToString();
                 txtTo.Text         = ds.Tables[0].Rows[0]["qty_to"].ToString();
                 txtNumber.Text     = ds.Tables[0].Rows[0]["number_days"].ToString();
                 chkEnabled.Checked = (ds.Tables[0].Rows[0]["enabled"].ToString() == "1");
                 btnSubmit.Text     = "Update";
             }
             else
             {
                 btnSubmit.Text = "Add";
             }
         }
     }
     else if (intModel > 0)
     {
         panAll.Visible     = true;
         rptView.DataSource = oModelsProperties.GetThresholds(intModel, 0);
         rptView.DataBind();
         lblNone.Visible = (rptView.Items.Count == 0);
     }
     btnSubmit.Attributes.Add("onclick", "return ValidateNumber0('" + txtFrom.ClientID + "','Please enter a valid number for the quantity')" +
                              " && ValidateNumber0('" + txtTo.ClientID + "','Please enter a valid number for the quantity')" +
                              " && ValidateNumber0('" + txtNumber.ClientID + "','Please enter a valid number for the number of days')" +
                              ";");
 }
Example #23
0
        protected void Page_Load()
        {
            Int32.TryParse(Request.QueryString["id"], out intAsset);
            if (intAsset > 0)
            {
                int   intModelProperty = 0;
                Asset oAsset           = new Asset(0, dsnAsset, dsn);
                if (Int32.TryParse(oAsset.Get(intAsset, "modelid"), out intModelProperty) == true)
                {
                    ModelsProperties oModelsProperties = new ModelsProperties(0, dsn);
                    if (oModelsProperties.IsDell(intModelProperty) == true)
                    {
                        int intDellConfig = 0;
                        Int32.TryParse(oModelsProperties.Get(intModelProperty, "dellconfigid"), out intDellConfig);
                        Dells   oDell  = new Dells(0, dsn);
                        DataSet dsDell = oDell.Get(intDellConfig);
                        if (dsDell.Tables[0].Rows.Count == 1)
                        {
                            DataRow drDell = dsDell.Tables[0].Rows[0];
                            strUser = drDell["username"].ToString();
                            strPass = drDell["password"].ToString();
                            strILO  = oAsset.GetServerOrBlade(intAsset, "ilo");

                            Functions oFunction = new Functions(0, dsn, intEnvironment);
                            Variables oVariable = new Variables(intEnvironment);

                            if (Request.QueryString["showimage"] != null)
                            {
                                Response.Redirect("/ondemand/ondemand_dell_image.aspx?showimage=https://" + strILO + Request.QueryString["showimage"]);
                            }
                            else if (Request.QueryString["bypass"] != null)
                            {
                                if (strUser == "" || strPass == "")
                                {
                                    strUser = oVariable.ADUser() + "@" + oVariable.FullyQualified();
                                    strPass = oFunction.AddPassword(50);
                                }
                            }
                        }
                    }
                }
            }
        }
Example #24
0
 protected void Page_Load(object sender, EventArgs e)
 {
     Response.Cookies["loginreferrer"].Value   = "/admin/asset/asset_barcodes.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");
     }
     oPlatform         = new Platforms(intProfile, dsn);
     oType             = new Types(intProfile, dsn);
     oModel            = new Models(intProfile, dsn);
     oModelsProperties = new ModelsProperties(intProfile, dsn);
     LoadPlatforms();
     oTreeview.ExpandDepth = 0;
     oTreeview.Attributes.Add("oncontextmenu", "return false;");
 }
Example #25
0
        protected void Page_Load(object sender, EventArgs e)
        {
            intProfile        = Int32.Parse(Request.Cookies["profileid"].Value);
            oPage             = new Pages(intProfile, dsn);
            oPlatform         = new Platforms(intProfile, dsn);
            oType             = new Types(intProfile, dsn);
            oModelsProperties = new ModelsProperties(intProfile, dsn);
            oAsset            = new Asset(intProfile, dsnAsset);
            oServiceRequest   = new ServiceRequests(intProfile, dsn);
            oForecast         = new Forecast(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);
            }
            int intPlatform = 0;

            if (Request.QueryString["id"] != null && Request.QueryString["id"] != "")
            {
                intPlatform = Int32.Parse(Request.QueryString["id"]);
            }
            if (intPlatform > 0)
            {
                if (!IsPostBack)
                {
                    txtMax1.Text = oPlatform.Get(intPlatform, "max_inventory1");
                    txtMax2.Text = oPlatform.Get(intPlatform, "max_inventory2");
                }
            }
            btnMaximum.Attributes.Add("onclick", "return ValidateNumber0('" + txtMax1.ClientID + "','Please enter a valid number') " +
                                      " && ValidateNumber0('" + txtMax2.ClientID + "','Please enter a valid number')" +
                                      ";");
        }
Example #26
0
 protected void Page_Load(object sender, EventArgs e)
 {
     AuthenticateUser();
     intProfile        = Int32.Parse(Request.Cookies["profileid"].Value);
     oForecast         = new Forecast(intProfile, dsn);
     oType             = new Types(intProfile, dsn);
     oModel            = new Models(intProfile, dsn);
     oModelsProperties = new ModelsProperties(intProfile, dsn);
     if (Request.QueryString["id"] != null && Request.QueryString["id"] != "")
     {
         intID      = Int32.Parse(Request.QueryString["id"]);
         intRequest = oForecast.GetRequestID(intID, true);
     }
     if (Request.QueryString["rid"] != null && Request.QueryString["rid"] != "")
     {
         intRequest = Int32.Parse(Request.QueryString["rid"]);
     }
     if (intRequest > 0)
     {
         DataSet ds = oForecast.GetAnswerRequest(intRequest);
         if (ds.Tables[0].Rows.Count > 0)
         {
             int intAnswer = Int32.Parse(ds.Tables[0].Rows[0]["id"].ToString());
             int intModel  = oForecast.GetModelAsset(intAnswer);
             if (intModel == 0)
             {
                 intModel = oForecast.GetModel(intAnswer);
             }
             intModel = Int32.Parse(oModelsProperties.Get(intModel, "modelid"));
             oForecast.UpdateAnswer(intAnswer, intRequest);
             oForecast.DeleteReset(intAnswer);
             int    intType = oModel.GetType(intModel);
             string strPath = oType.Get(intType, "ondemand_execution_path");
             if (strPath != "")
             {
                 PHStep.Controls.Add((Control)LoadControl(strPath));
             }
         }
     }
 }
Example #27
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 + "');");
            }
        }
Example #28
0
 protected void Page_Load(object sender, EventArgs e)
 {
     intProfile        = Int32.Parse(Request.Cookies["profileid"].Value);
     oPlatform         = new Platforms(intProfile, dsn);
     oType             = new Types(intProfile, dsn);
     oModel            = new Models(intProfile, dsn);
     oModelsProperties = new ModelsProperties(intProfile, dsn);
     oForecast         = new Forecast(intProfile, dsn);
     oPage             = new Pages(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);
     }
 }
        protected void btnBack_Click(Object Sender, EventArgs e)
        {
            oForecast.UpdateAnswerExecution(intID, "");
            int intModel = oForecast.GetModel(intID);
            ModelsProperties oModelsProperties = new ModelsProperties(0, dsn);
            int      intType    = oModelsProperties.GetType(intModel);
            Types    oType      = new Types(0, dsn);
            string   strExecute = oType.Get(intType, "forecast_execution_path");
            OnDemand oOnDemand  = new OnDemand(0, dsn);
            int      intCount   = 0;
            DataSet  ds         = oOnDemand.GetWizardStepsDoneBack(intID);

            foreach (DataRow dr in ds.Tables[0].Rows)
            {
                intCount++;
                if (intCount != ds.Tables[0].Rows.Count)
                {
                    oOnDemand.DeleteWizardStepDone(intID, Int32.Parse(dr["step"].ToString()));
                }
            }
            Response.Redirect(strExecute + "?id=" + intID.ToString());
        }
Example #30
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 Racks(intProfile, dsn);
            oAsset            = new Asset(intProfile, dsnAsset);
            oModelsProperties = new ModelsProperties(intProfile, dsn);
            if (!IsPostBack)
            {
                LoadList();
                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();");

                btnLocation.Attributes.Add("onclick", "return OpenWindow('LOCATION_BROWSER','" + hdnLocationId.ClientID + "','&control=" + hdnLocationId.ClientID + "&controltext=" + lblLocation.ClientID + "',false,400,600);");

                btnRoom.Attributes.Add("onclick", "return ValidateHidden0('" + hdnLocationId.ClientID + "','btnLocation','Please select a location')" +
                                       " && OpenWindowBasedOnParentSelection('ROOM_BROWSER','" + hdnRoomId.ClientID + "','" + hdnLocationId.ClientID + "','&control=" + hdnRoomId.ClientID + "&controltext=" + lblRoom.ClientID + "',false,400,600)" +
                                       ";");

                btnAdd.Attributes.Add("onclick", "return 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')" +
                                      " && ValidateHidden0('" + hdnLocationId.ClientID + "','btnLocation','Please select a location')" +
                                      " && ValidateHidden0('" + hdnRoomId.ClientID + "','btnRoom','Please select a room')" +
                                      ";");
            }
        }