protected void Page_Load(object sender, EventArgs e) { //Initialize Variables intProfile = Int32.Parse(Request.Cookies["profileid"].Value); oUser = new Users(intProfile, dsn); oVariable = new Variables(intEnvironment); oFunction = new Functions(intProfile, dsn, intEnvironment); oUserAt = new Users_At(intProfile, dsn); //Initial Page Load if (!IsPostBack) { LoadList(); hdnUserId.Value = intUserId.ToString(); LoadUserContactDetails(intUserId); } btnSaveContactInfo.Attributes.Add("onclick", "return ProcessButton(this)" + ";"); }
protected void Page_Load(object sender, EventArgs e) { Response.Cookies["loginreferrer"].Value = "/admin/users_ats.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"); } oUserAt = new Users_At(intProfile, dsn); if (!IsPostBack) { LoopRepeater(); btnOrder.Attributes.Add("onclick", "return OpenWindow('SUPPORTORDER','" + hdnId.ClientID + "','" + hdnOrder.ClientID + "&type=AT" + "',false,400,400);"); btnDelete.Attributes.Add("onclick", "return confirm('Are you sure you want to delete this user AT?');"); btnCancel.Attributes.Add("onclick", "return Cancel();"); } }
protected void Page_Load(object sender, EventArgs e) { Page.Title = strTitle; Control oControl = (Control)LoadControl("/controls/sys/sys_rotator_header.ascx"); PH4.Controls.Add(oControl); if (Request.Cookies["profileid"] != null && Request.Cookies["profileid"].Value != "") { intProfile = Int32.Parse(Request.Cookies["profileid"].Value); oUser = new Users(intProfile, dsn); oUserAt = new Users_At(intProfile, dsn); Variables oVariable = new Variables(intEnvironment); txtManager.Attributes.Add("onkeyup", "return AJAXTextBoxGet(this,'300','195','" + divAJAX.ClientID + "','" + lstAJAX.ClientID + "','" + hdnManager.ClientID + "','" + oVariable.URL() + "/frame/users.aspx',2);"); lstAJAX.Attributes.Add("ondblclick", "AJAXClickRow();"); DataSet ds = new DataSet(); ds = oUser.Get(intProfile); LoadList(); if (!IsPostBack) { LoadUserDetails(ds.Tables[0].Rows[0]); } btnCancel.Enabled = false; string strPNC = ""; if (rowPNC.Visible == true) { strPNC = " && ValidateTextWarning('" + txtPNC.ClientID + "','WARNING: You did not enter a PNC ID / P-ID. It is recommended that you click CANCEL and enter your PNC ID.\\n\\nAre you sure you want to continue?\\n')"; } btnUpdate.Attributes.Add("onclick", "return ValidateText('" + txtFirst.ClientID + "','Please enter your first name')" + " && ValidateText('" + txtLast.ClientID + "','Please enter your last name')" + " && ValidateHidden0('" + hdnManager.ClientID + "','" + txtManager.ClientID + "','Please enter the LAN ID or P-ID of your manager and select from the list\\n\\nNOTE: If you do not see your manager in the list, please use the SUPPORT \\nbutton (located in the top right of this page) to submit a new support ticket')" + strPNC + ";"); } else { btnUpdate.Enabled = false; } }
protected void Page_Load(object sender, EventArgs e) { Response.Cookies["loginreferrer"].Value = "/admin/admin_users.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"); } oRole = new NCC.ClearView.Application.Core.Roles(intProfile, dsn); oUser = new Users(intProfile, dsn); oAD = new AD(intProfile, dsn, intEnvironment); oUserAt = new Users_At(intProfile, dsn); lblResult.Text = ""; txtName.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}; "); if (!IsPostBack) { if (Request.QueryString["f"] != null) { divAdd.Style["display"] = "inline"; if (Request.QueryString["f"].Trim() != "") { Find(Request.QueryString["f"]); } else { lblResult.Text = "<img src='/images/error.gif' border='0' align='absmiddle'> Please enter a name"; } } else if (Request.QueryString["id"] != null && Request.QueryString["id"] != "") { divEdit.Style["display"] = "inline"; hdnId.Value = "0"; btnDelete.Visible = false; btnCancel.Visible = false; } else if (Request.QueryString["s"] != null) { divView.Style["display"] = "inline"; if (Request.QueryString["s"].Trim() != "") { LoopRepeater(Request.QueryString["s"]); } else { lblResult.Text = "<img src='/images/error.gif' border='0' align='absmiddle'> Please enter a name"; } LoadList(); } else { divView.Style["display"] = "inline"; } Variables oVariable = new Variables(intEnvironment); txtManager.Attributes.Add("onkeyup", "return AJAXTextBoxGet(this,'300','195','" + divAJAX.ClientID + "','" + lstAJAX.ClientID + "','" + hdnManager.ClientID + "','" + oVariable.URL() + "/frame/users.aspx',2);"); lstAJAX.Attributes.Add("ondblclick", "AJAXClickRow();"); btnDelete.Attributes.Add("onclick", "return confirm('Are you sure you want to delete this user?');"); btnCancel.Attributes.Add("onclick", "return Cancel();"); } btnRoles.Attributes.Add("onclick", "return OpenWindow('USERROLES','" + hdnId.ClientID + "','',false,'500',300);"); btnPages.Attributes.Add("onclick", "return OpenWindow('USERPAGEBROWSER','" + hdnId.ClientID + "','',false,'400',475);"); }
protected void Page_Load(object sender, EventArgs e) { intProfile = Int32.Parse(Request.Cookies["profileid"].Value); oProjectRequest = new ProjectRequest(intProfile, dsn); oResourceRequest = new ResourceRequest(intProfile, dsn); oRequestItem = new RequestItems(intProfile, dsn); oProject = new Projects(intProfile, dsn); oPage = new Pages(intProfile, dsn); oVariable = new Variables(intEnvironment); oApplication = new Applications(intProfile, dsn); oProjectNumber = new ProjectNumber(intProfile, dsn); oRequest = new Requests(intProfile, dsn); oRequestField = new RequestFields(intProfile, dsn); oDocument = new Documents(intProfile, dsn); oUser = new Users(intProfile, dsn); oStatus = new StatusLevels(); oService = new Services(intProfile, dsn); oDelegate = new Delegates(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["pid"] != null && Request.QueryString["pid"] != "") { int intProject = Int32.Parse(Request.QueryString["pid"]); lblProject.Text = intProject.ToString(); ds = oProject.GetCoordinator(intProject, 0); int intCoordinator = 0; int intRequest = 0; int intResource = 0; bool boolCoordinator = false; bool boolTPM = false; foreach (DataRow dr in ds.Tables[0].Rows) { if ((Int32.Parse(dr["userid"].ToString()) == intProfile || oDelegate.Get(Int32.Parse(dr["userid"].ToString()), intProfile) > 0) && (Request.QueryString["search"] == null)) { if (dr["tpm"].ToString() == "1") { boolTPM = true; } else { boolCoordinator = true; } } } if (ds.Tables[0].Rows.Count > 0) { //panProject.Visible = true; intRequest = Int32.Parse(ds.Tables[0].Rows[0]["requestid"].ToString()); intResource = Int32.Parse(ds.Tables[0].Rows[0]["id"].ToString()); intCoordinator = Int32.Parse(ds.Tables[0].Rows[0]["userid"].ToString()); lblCoordinator.Text = oUser.GetFullName(intCoordinator); lblPhone.Text = (oUser.Get(intCoordinator, "phone") == "" ? "N / A" : oUser.Get(intCoordinator, "phone")); string strEmail = oUser.GetEmail(oUser.GetName(intCoordinator), intEnvironment); lblEmail.Text = (strEmail == "" ? "N / A" : "<a href=\"mailto:" + strEmail + "\" target=\"_blank\">" + strEmail + "</a>"); string strPager = oUser.Get(intCoordinator, "pager"); lblMobileDevice.Text = (strPager == "" || strPager == "0" ? "N / A" : strPager); string strAt = oUser.Get(intCoordinator, "atid"); if (strAt != "0" && strAt != "") { Users_At oUserAt = new Users_At(intProfile, dsn); strPager += "@" + oUserAt.GetName(Int32.Parse(strAt)); lblMobileEmail.Text = "<a href=\"mailto:" + strPager + "\" target=\"_blank\">" + strPager + "</a>"; } else { lblMobileEmail.Text = "N / A"; } } lblRequest.Text = intRequest.ToString(); if (Request.QueryString["comm"] != null && Request.QueryString["comm"] != "") { trCommunication.Visible = true; } if (boolTPM == true) { // if (CheckConfigured(intProject, intRequest, intResource) == true) // { panControl.Visible = true; Control oControl = (Control)LoadControl(strTPMWM); phControl.Controls.Add(oControl); LoadProject(intProject); // } // else // panConfigure.Visible = true; } else if (boolCoordinator == true) { panControl.Visible = true; Control oControl = (Control)LoadControl(strPCWM); phControl.Controls.Add(oControl); LoadProject(intProject); } else if (oApplication.GetName(intApplication).Contains("IDC") == true || oApplication.GetName(intApplication).Contains("Integration Engineer") == true) { panControl.Visible = true; Control oControl = (Control)LoadControl("/controls/wm/wm_ie.ascx"); phControl.Controls.Add(oControl); LoadProject(intProject); } else { panWorkload.Visible = true; ds = oResourceRequest.GetWorkflowProjectAll(intProject); if (ds.Tables[0].Rows.Count > 0) { ds = oProjectRequest.GetProject(intProject); if (ds.Tables[0].Rows.Count > 0) { btnViewPR.Text = "View Original Project Request"; btnViewPR.Attributes.Add("onclick", "return OpenWindow('PRINTER_FRIENDLY','?page=" + intViewRequest.ToString() + "&rid=" + intRequest.ToString() + "');"); } else { //if (intResource > 0) //{ // btnViewPR.Text = "View Original Request Details"; // btnViewPR.Attributes.Add("onclick", "return OpenWindow('PRINTER_FRIENDLY','?page=" + intViewResourceRequest.ToString() + "&rrid=" + intResource.ToString() + "');"); //} //else btnViewPR.Visible = false; } // Documents btnDocuments.Attributes.Add("onclick", "return OpenWindow('DOCUMENTS_SECURE','?pid=" + intProject.ToString() + "');"); chkMyDescription.Checked = (Request.QueryString["mydoc"] != null); lblMyDocuments.Text = oDocument.GetDocuments_Mine(intProject, intProfile, oVariable.DocumentsFolder(), -1, (Request.QueryString["mydoc"] != null)); // GetDocuments(string _physical, int _projectid, int _requestid, int _userid, int _security, bool _show_description, bool _mine) //lblMyDocuments.Text = oDocument.GetDocuments(Request.PhysicalApplicationPath, intProject, 0, intProfile, -1, (Request.QueryString["mydoc"] != null), true); chkDescription.Checked = (Request.QueryString["doc"] != null); lblDocuments.Text = oDocument.GetDocuments_Project(intProject, intProfile, oVariable.DocumentsFolder(), 1, (Request.QueryString["doc"] != null)); // GetDocuments(string _physical, int _projectid, int _requestid, int _userid, int _security, bool _show_description, bool _mine) //lblDocuments.Text = oDocument.GetDocuments(Request.PhysicalApplicationPath, intProject, 0, intProfile, 1, (Request.QueryString["doc"] != null), false); /* * ds = oResourceRequest.GetWorkflowProject(intProject); * int intOldUser = 0; * foreach (DataRow dr in ds.Tables[0].Rows) * { * if (intOldUser == Int32.Parse(dr["userid"].ToString())) * dr.Delete(); * else * intOldUser = Int32.Parse(dr["userid"].ToString()); * } * ddlResource.DataValueField = "userid"; * ddlResource.DataTextField = "userid"; * ddlResource.DataSource = ds; * ddlResource.DataBind(); * foreach (ListItem oItem in ddlResource.Items) * oItem.Text = oUser.GetFullName(Int32.Parse(oItem.Value)); * ddlResource.Items.Insert(0, new ListItem("-- SELECT --", "0")); * // Load Involvement * DataSet dsInvolvement = oResourceRequest.GetWorkflowProject(intProject); * int intOldItem = 0; * intOldUser = 0; * foreach (DataRow dr in dsInvolvement.Tables[0].Rows) * { * if (intImplementorDistributed == Int32.Parse(dr["itemid"].ToString())) * dr.Delete(); * else if (intImplementorMidrange == Int32.Parse(dr["itemid"].ToString())) * dr.Delete(); * else if (intOldItem == Int32.Parse(dr["itemid"].ToString()) && intOldUser == Int32.Parse(dr["userid"].ToString())) * dr.Delete(); * else * { * intOldItem = Int32.Parse(dr["itemid"].ToString()); * intOldUser = Int32.Parse(dr["userid"].ToString()); * } * } * rptInvolvement.DataSource = dsInvolvement; * rptInvolvement.DataBind(); * lblNoInvolvement.Visible = (rptInvolvement.Items.Count == 0); * foreach (RepeaterItem ri in rptInvolvement.Items) * { * Label _id = (Label)ri.FindControl("lblId"); * Label _user = (Label)ri.FindControl("lblUser"); * Label _status = (Label)ri.FindControl("lblStatus"); * int intStatus = Int32.Parse(_status.Text); * int intUser = Int32.Parse(_user.Text); * _user.Text = oUser.GetFullName(intUser); * Label _item = (Label)ri.FindControl("lblItem"); * int intItem = Int32.Parse(_item.Text); * Label _allocated = (Label)ri.FindControl("lblAllocated"); * Label _used = (Label)ri.FindControl("lblUsed"); * double dblAllocated = oResourceRequest.GetAllocated(intProject, intUser, intItem); * double dblUsed = oResourceRequest.GetUsed(intProject, intUser, intItem); * Label _percent = (Label)ri.FindControl("lblPercent"); * _allocated.Text = dblAllocated.ToString(); * _used.Text = dblUsed.ToString(); * if (dblAllocated > 0) * { * dblUsed = dblUsed / dblAllocated; * _percent.Text = dblUsed.ToString("P"); * } * else * _percent.Text = dblAllocated.ToString("P"); * if (intItem == 0) * _item.Text = "Project Coordinator"; * else * { * if (intItem == -1) * _item.Text = "Design Implementor"; * else * { * int intApp = oRequestItem.GetItemApplication(intItem); * _item.Text = oApplication.GetName(intApp); * } * } * _status.Text = oStatus.Name(intStatus); * } */ // MY Involvement DataSet dsMine = oResourceRequest.GetWorkflowProject(intProject); //Check if new request DataColumn oColumn; oColumn = new DataColumn(); oColumn.DataType = System.Type.GetType("System.String"); oColumn.ColumnName = "new"; dsMine.Tables[0].Columns.Add(oColumn); foreach (DataRow dr in dsMine.Tables[0].Rows) { if (intImplementorDistributed == Int32.Parse(dr["itemid"].ToString())) { dr.Delete(); } else if (intImplementorMidrange == Int32.Parse(dr["itemid"].ToString())) { dr.Delete(); } else if (DateTime.Parse(dr["created"].ToString()) <= DateTime.Parse(dr["modified"].ToString())) { dr["new"] = "1"; } //else if (intProfile != Int32.Parse(dr["userid"].ToString()) && oDelegate.Get(Int32.Parse(dr["userid"].ToString()), intProfile) <= 0) // dr.Delete(); } Functions oFunction = new Functions(0, dsn, intEnvironment); rptMine.DataSource = dsMine; rptMine.DataBind(); lblNoMine.Visible = (rptMine.Items.Count == 0); foreach (RepeaterItem ri in rptMine.Items) { Label _id = (Label)ri.FindControl("lblId"); Label _user = (Label)ri.FindControl("lblUser"); Label _status = (Label)ri.FindControl("lblStatus"); Label _color = (Label)ri.FindControl("lblColor"); Label _service = (Label)ri.FindControl("lblServiceId"); int _serviceid = Int32.Parse(_service.Text); Label _name = (Label)ri.FindControl("lblName"); Image imgDelegate = (Image)ri.FindControl("imgDelegate"); int intStatus = Int32.Parse(_status.Text); int intUser = Int32.Parse(_user.Text); if ((intStatus < 1 || intStatus > 2) && intStatus != 5) { ri.Visible = false; } else if (intUser != intProfile) { if (oDelegate.Get(intUser, intProfile) <= 0) { ri.Visible = false; } else { imgDelegate.Visible = true; } } if (ri.Visible == true) { string strColor = _color.Text; int intGreen = 0; Int32.TryParse(strColor.Substring(0, strColor.IndexOf("_")), out intGreen); strColor = strColor.Substring(strColor.IndexOf("_") + 1); int intYellow = 0; Int32.TryParse(strColor.Substring(0, strColor.IndexOf("_")), out intYellow); strColor = strColor.Substring(strColor.IndexOf("_") + 1); int intRed = 0; Int32.TryParse(strColor, out intRed); strColor = "<table cellpadding=\"0\" cellspacing=\"2\" border=\"0\">"; if (intRed > 0) { strColor += "<tr><td>" + oFunction.GetBox("FF0000", 15, 8) + "</td>" + (intRed > 1 ? "<td> (" + intRed.ToString() + ")</td>" : "") + "</tr>"; } if (intYellow > 0) { strColor += "<tr><td>" + oFunction.GetBox("FFFF00", 15, 8) + "</td>" + (intYellow > 1 ? "<td> (" + intYellow.ToString() + ")</td>" : "") + "</tr>"; } if (intGreen > 0) { strColor += "<tr><td>" + oFunction.GetBox("00FF00", 15, 8) + "</td>" + (intGreen > 1 ? "<td> (" + intGreen.ToString() + ")</td>" : "") + "</tr>"; } strColor += "</table>"; _color.Text = strColor; if (_name.Text == "") { _name.Text = oService.GetName(_serviceid); } Label _item = (Label)ri.FindControl("lblItem"); Label _allocated = (Label)ri.FindControl("lblAllocated"); double dblAllocated = double.Parse(_allocated.Text); Label _used = (Label)ri.FindControl("lblUsed"); double dblUsed = oResourceRequest.GetWorkflowUsed(Int32.Parse(_id.Text)); Label _percent = (Label)ri.FindControl("lblPercent"); int intItem2 = Int32.Parse(_item.Text); if (intItem2 == 0) { _item.Text = "Project Coordinator"; } else { if (intItem2 == -1) { _item.Text = "Pending Execution"; } else { int intApp = oRequestItem.GetItemApplication(intItem2); _item.Text = oApplication.GetName(intApp); } } _allocated.Text = dblAllocated.ToString(); _used.Text = dblUsed.ToString(); if (dblAllocated > 0) { dblUsed = dblUsed / dblAllocated; _percent.Text = dblUsed.ToString("P"); } else { _percent.Text = dblAllocated.ToString("P"); } _status.Text = oStatus.Name(intStatus); } } } else { panDenied.Visible = true; lblTitle.Text = "Zero Dataset "; } LoadProject(intProject); } } else { panDenied.Visible = true; lblTitle.Text = "Invalid Querystring "; } btnDenied.Attributes.Add("onclick", "return CloseWindow();"); btnConfigure.Attributes.Add("onclick", "return ValidateText('" + txtNumber.ClientID + "','Please enter the project number');"); }
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(); } oPlatform = new Platforms(intProfile, dsn); oOrganization = new Organizations(intProfile, dsn); oRequestItem = new RequestItems(intProfile, dsn); oUserAt = new Users_At(intProfile, dsn); oCost = new Costs(intProfile, dsn); oService = new Services(intProfile, dsn); oRequestField = new RequestFields(intProfile, dsn); oReport = new Reports(intProfile, dsn); oSites = new Sites(intProfile, dsn); oType = new Types(intProfile, dsn); oModel = new Models(intProfile, dsn); oRacks = new Racks(intProfile, dsn); oBanks = new Banks(intProfile, dsn); oDepot = new Depot(intProfile, dsn); oShelf = new Shelf(intProfile, dsn); oClasses = new Classes(intProfile, dsn); oRooms = new Rooms(intProfile, dsn); oFloor = new Floor(intProfile, dsn); oEnvironment = new Environments(intProfile, dsn); oForecast = new Forecast(intProfile, dsn); oSolution = new Solution(intProfile, dsn); oConfidence = new Confidence(intProfile, dsn); oLocation = new Locations(intProfile, dsn); oField = new Field(intProfile, dsn); oServiceDetail = new ServiceDetails(intProfile, dsn); oDomainController = new DomainController(intProfile, dsn); oDomain = new Domains(intProfile, dsn); oServerName = new ServerName(intProfile, dsn); oOperatingSystems = new OperatingSystems(intProfile, dsn); oOnDemand = new OnDemand(intProfile, dsn); oServicePack = new ServicePacks(intProfile, dsn); oServer = new Servers(intProfile, dsn); oHost = new Host(intProfile, dsn); oVirtualHDD = new VirtualHDD(intProfile, dsn); oVirtualRam = new VirtualRam(intProfile, dsn); oRestart = new Restart(intProfile, dsn); oSegment = new Segment(intProfile, dsn); oServiceEditor = new ServiceEditor(intProfile, dsnServiceEditor); oProjectRequest = new ProjectRequest(intProfile, dsn); oVMWare = new VMWare(intProfile, dsn); oWorkstation = new Workstations(intProfile, dsn); //oNew = new New(intProfile, dsn); oWhatsNew = new WhatsNew(intProfile, dsn); oMaintenanceWindow = new MaintenanceWindow(intProfile, dsn); //oRecoveryLocations = new RecoveryLocations(intProfile, dsn); oTSM = new TSM(intProfile, dsn); oDNS = new DNS(intProfile, dsn); oSolaris = new Solaris(intProfile, dsn); oZeus = new Zeus(intProfile, dsn); oError = new Errors(intProfile, dsn); oDesign = new Design(intProfile, dsn); oResiliency = new Resiliency(intProfile, dsn); oEnhancement = new Enhancements(intProfile, dsn); if (Request.QueryString["type"] != null && Request.QueryString["type"] != "") { lblType.Text = Request.QueryString["type"]; } if (Request.QueryString["id"] != null && Request.QueryString["id"] != "") { lblId.Text = Request.QueryString["id"]; } string strControl = ""; if (Request.QueryString["control"] != null) { strControl = Request.QueryString["control"]; } btnSave.Attributes.Add("onclick", "return Update('hdnUpdateOrder','" + strControl + "');"); btnClose.Attributes.Add("onclick", "return HidePanel();"); imgOrderUp.Attributes.Add("onclick", "return MoveOrderUp(" + lstOrder.ClientID + ");"); imgOrderDown.Attributes.Add("onclick", "return MoveOrderDown(" + lstOrder.ClientID + ");"); LoadList(); }