protected void Page_Load(object sender, EventArgs e) { intProfile = Int32.Parse(Request.Cookies["profileid"].Value); oPage = new Pages(intProfile, dsn); oRequestItem = new RequestItems(intProfile, dsn); oServiceRequest = new ServiceRequests(intProfile, dsn); oApplication = new Applications(intProfile, dsn); oVariable = new Variables(intEnvironment); oRequestField = new RequestFields(intProfile, dsn); oService = new Services(intProfile, dsn); oUser = new Users(intProfile, dsn); oCustomized = new Customized(intProfile, dsn); oRequest = new Requests(intProfile, dsn); oResourceRequest = new ResourceRequest(intProfile, dsn); oProject = new Projects(intProfile, dsn); oProjectsPending = new ProjectsPending(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); } if (Request.QueryString["rid"] != "" && Request.QueryString["rid"] != null) { LoadValues(); LoadRequest(); imgStart.Attributes.Add("onclick", "return ShowCalendar('" + txtStart.ClientID + "');"); imgEnd.Attributes.Add("onclick", "return ShowCalendar('" + txtEnd.ClientID + "');"); // Custom Loads int intItem = Int32.Parse(lblItem.Text); int intApp = oRequestItem.GetItemApplication(intItem); string strDeliverable = oApplication.Get(intApp, "deliverables_doc"); if (strDeliverable != "") { panDeliverable.Visible = true; btnDeliverable.Attributes.Add("onclick", "return OpenWindow('NEW_WINDOW','" + strDeliverable + "');"); } int intWorkingDays = oApplication.GetLead(intApp, 3); if (intWorkingDays > 0) { oApplication.AssignPriority(intApp, radPriority, lblDeliverable.ClientID, txtEnd.ClientID, hdnEnd.ClientID); lblDeliverable.Text = intWorkingDays.ToString(); txtEnd.Text = DateTime.Today.AddDays(intWorkingDays).ToShortDateString(); hdnEnd.Value = DateTime.Today.AddDays(intWorkingDays).ToShortDateString(); } btnDocuments.Attributes.Add("onclick", "return OpenWindow('DOCUMENTS_SECURE','?rid=" + Request.QueryString["rid"] + "');"); } btnCancel1.Attributes.Add("onclick", "return confirm('Are you sure you want to delete this service request?');"); }
protected void Page_Load(object sender, EventArgs e) { intProfile = Int32.Parse(Request.Cookies["profileid"].Value); oPage = new Pages(intProfile, dsn); oRequestItem = new RequestItems(intProfile, dsn); oApplication = new Applications(intProfile, dsn); oVariable = new Variables(intEnvironment); oRequestField = new RequestFields(intProfile, dsn); oService = new Services(intProfile, dsn); oCustomized = new Customized(intProfile, dsn); oRequest = new Requests(intProfile, dsn); oProject = new Projects(intProfile, dsn); oProjectsPending = new ProjectsPending(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); } if (Request.QueryString["rid"] != "" && Request.QueryString["rid"] != null) { LoadValues(); txtWorking.Attributes.Add("onkeyup", "return AJAXTextBoxGet(this,'300','195','" + divWorking.ClientID + "','" + lstWorking.ClientID + "','" + hdnWorking.ClientID + "','" + oVariable.URL() + "/frame/users.aspx',2);"); lstWorking.Attributes.Add("ondblclick", "AJAXClickRow();"); imgStart.Attributes.Add("onclick", "return ShowCalendar('" + txtStart.ClientID + "');"); imgEnd.Attributes.Add("onclick", "return ShowCalendar('" + txtEnd.ClientID + "');"); // Custom Loads int intItem = Int32.Parse(lblItem.Text); int intApp = oRequestItem.GetItemApplication(intItem); LoadRequest(intApp); string strDeliverable = oApplication.Get(intApp, "deliverables_doc"); if (strDeliverable != "") { panDeliverable.Visible = true; btnDeliverable.Attributes.Add("onclick", "return OpenWindow('NEW_WINDOW','" + strDeliverable + "');"); } oApplication.AssignPriority(intApp, radPriority, lblDeliverable.ClientID, txtEnd.ClientID, hdnEnd.ClientID); int intWorking = oApplication.GetLead(intApp, 3); lblDeliverable.Text = intWorking.ToString(); txtEnd.Text = DateTime.Today.AddDays(intWorking).ToShortDateString(); hdnEnd.Value = DateTime.Today.AddDays(intWorking).ToShortDateString(); btnClose.Attributes.Add("onclick", "return CloseWindow();"); btnBack2.Attributes.Add("onclick", "ShowHideDiv('" + divShow.ClientID + "','inline');ShowHideDiv('" + divHide.ClientID + "','none');return false;"); btnDocuments.Attributes.Add("onclick", "return OpenWindow('DOCUMENTS_SECURE','?rid=" + Request.QueryString["rid"] + "');"); imgDate.Attributes.Add("onclick", "return ShowCalendar('" + txtDate.ClientID + "');"); } btnCancel1.Attributes.Add("onclick", "return confirm('Are you sure you want to delete this service request?');"); }
private void LoadRequest() { int intRequest = Int32.Parse(Request.QueryString["rid"]); int intProject = oRequest.GetProjectNumber(intRequest); int intPriority = 3; int intService = Int32.Parse(lblService.Text); int intItem = oService.GetItemId(intService); string strStatement = ""; string strExpedite = ""; if (oService.Get(intService, "statement") == "1") { panStatement.Visible = true; strStatement += " && ValidateText('" + txtStatement.ClientID + "','Please enter a statement of work')"; } else { panStatement.Visible = false; } panUpload.Visible = (oService.Get(intService, "upload") == "1"); //if (oService.Get(intService, "expedite") == "1") //{ // panExpedite.Visible = true; // strExpedite += " && ValidateRadioButtons('" + radExpediteYes.ClientID + "','" + radExpediteNo.ClientID + "','Please select whether or not you want to expedite this request')"; //} //else panExpedite.Visible = false; if (Request.QueryString["formid"] != null && Request.QueryString["formid"] != "") { panUpdate.Visible = true; btnCancelR.Visible = boolReqReturned; btnCancel.Visible = (boolReqReturned == false); DataSet ds = oServiceEditor.GetRequestData(intRequest, intService, Int32.Parse(lblNumber.Text), 0, dsn); if (ds.Tables[0].Rows.Count > 0) { txtTitle.Text = ds.Tables[0].Rows[0]["title"].ToString(); txtStatement.Text = ds.Tables[0].Rows[0]["statement"].ToString(); intPriority = Int32.Parse(ds.Tables[0].Rows[0]["priority"].ToString()); radExpediteYes.Checked = (ds.Tables[0].Rows[0]["expedite"].ToString() == "1"); radExpediteNo.Checked = (ds.Tables[0].Rows[0]["expedite"].ToString() == "0"); } strForm = oServiceEditor.LoadForm(intService, false, false, "", intEnvironment, ds, dsn); } else { panNavigation.Visible = true; strForm = oServiceEditor.LoadForm(intService, false, false, "", intEnvironment, null, dsn); } // Priority and SLA int intApp = oRequestItem.GetItemApplication(intItem); int intWorkingDays = oApplication.GetLead(intApp, intPriority); if (intWorkingDays > 0) { panDeliverable.Visible = true; //oApplication.AssignPriority(intApp, radPriority, lblDeliverable.ClientID, txtEnd.ClientID, hdnEnd.ClientID); lblDeliverable.Text = intWorkingDays.ToString(); //if (boolFound == false) // txtEnd.Text = DateTime.Today.AddDays(intWorkingDays).ToShortDateString(); hdnEnd.Value = DateTime.Today.AddDays(intWorkingDays).ToShortDateString(); } radPriority.SelectedValue = intPriority.ToString(); string strRequired = oServiceEditor.GetRequired(); // Load Title if no project if (intProject == -1) { panTitle.Visible = true; if (oService.Get(intService, "title_override") == "1") { lblTitleName.Text = oService.Get(intService, "title_name"); } btnNext.Attributes.Add("onclick", "return ValidateText('" + txtTitle.ClientID + "','Please enter a title')" + strStatement + strRequired + strExpedite + " && ProcessButton(this) && LoadWait();"); btnUpdate.Attributes.Add("onclick", "return ValidateText('" + txtTitle.ClientID + "','Please enter a title')" + strStatement + strRequired + strExpedite + " && ProcessButton(this) && LoadWait();"); } else { btnNext.Attributes.Add("onclick", "return true" + strStatement + strRequired + strExpedite + " && ProcessButton(this) && LoadWait();"); btnUpdate.Attributes.Add("onclick", "return true" + strStatement + strRequired + strExpedite + " && ProcessButton(this) && LoadWait();"); } //Check for returned requests if (boolReqReturned == true || boolReqDenied == true) { int intReturned = 0; Int32.TryParse(lblReturned.Text, out intReturned); ResourceRequest oResourceRequest = new ResourceRequest(0, dsn); DataSet dsResource = oResourceRequest.GetAllService(intRequest, intReturned, Int32.Parse(lblNumber.Text)); if (dsResource.Tables[0].Rows.Count > 0) { int intResource = Int32.Parse(dsResource.Tables[0].Rows[0]["rrid"].ToString()); DataSet dsRR = oResourceRequest.Get(intResource); Users oUser = new Users(0, dsn); if (dsRR.Tables[0].Rows.Count > 0) { if (dsRR.Tables[0].Rows[0]["status"].ToString() == "-1") { // Request Denied lblReqDenyCommentValue.Text = dsRR.Tables[0].Rows[0]["reason"].ToString(); if (lblReqDenyCommentValue.Text == "") { int intApproved = 0; // Try getting from service approval. DataSet dsSelected2 = oService.GetSelected(intRequest, intReturned, Int32.Parse(lblNumber.Text)); for (int ii = Int32.Parse(lblNumber.Text); ii > 0 && dsSelected2.Tables[0].Rows.Count == 0; ii--) { dsSelected2 = oService.GetSelected(intRequest, intReturned, ii - 1); } if (dsSelected2.Tables[0].Rows.Count > 0) { intApproved = Int32.Parse(dsSelected2.Tables[0].Rows[0]["approved"].ToString()); } if (intApproved < 0) { lblReqDenyCommentValue.Text = dsSelected2.Tables[0].Rows[0]["reason"].ToString(); } } pnlReqDenied.Visible = true; } else if (dsRR.Tables[0].Rows[0]["status"].ToString() == "7") { DataSet dsRRReturn = oResourceRequest.getResourceRequestReturn(intResource, intReturned, Int32.Parse(lblNumber.Text), 0, 0); if (dsRRReturn.Tables[0].Rows.Count > 0) { lblReqReturnedId.Text = dsRRReturn.Tables[0].Rows[0]["Id"].ToString(); lblReqReturnCommentValue.Text = oFunction.FormatText(dsRRReturn.Tables[0].Rows[0]["Comments"].ToString()); lblReqReturnedByValue.Text = oUser.GetName(Int32.Parse(dsRRReturn.Tables[0].Rows[0]["ReturnedByUser"].ToString())); lblReqReturnedByValue.Text = oUser.GetFullName(Int32.Parse(dsRRReturn.Tables[0].Rows[0]["ReturnedByUser"].ToString())); pnlReqReturn.Visible = true; } DataSet dsRRReturn2 = oResourceRequest.getResourceRequestReturn(intResource, intReturned, Int32.Parse(lblNumber.Text), 1, 0); if (dsRRReturn2.Tables[0].Rows.Count > 0) { lblReqReturnedId2.Text = dsRRReturn2.Tables[0].Rows[0]["Id"].ToString(); lblReqReturnCommentValue2.Text = oFunction.FormatText(dsRRReturn2.Tables[0].Rows[0]["Comments"].ToString()); lblReqReturnedByValue2.Text = oUser.GetName(Int32.Parse(dsRRReturn2.Tables[0].Rows[0]["ReturnedByUser"].ToString())); lblReqReturnedByValue2.Text = oUser.GetFullName(Int32.Parse(dsRRReturn2.Tables[0].Rows[0]["ReturnedByUser"].ToString())); pnlReqReturn2.Visible = true; } } else { pnlReqReturn.Visible = false; pnlReqReturn2.Visible = false; } } } } }