protected void Page_Load(object sender, EventArgs e) { oServiceEditor = new ServiceEditor(0, dsnServiceEditor); 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 strValues = Server.UrlDecode(oDoc.FirstChild.InnerXml); string strValue = strValues.Substring(0, strValues.IndexOf("_")); string strConfig = strValues.Substring(strValues.IndexOf("_") + 1); int intValue = Int32.Parse(strValue); int intConfig = Int32.Parse(strConfig); sb.Append(AddResets(intConfig, intValue)); DataSet dsAffects = oServiceEditor.GetConfigAffectsValue(intValue); foreach (DataRow drAffect in dsAffects.Tables[0].Rows) { sb.Append("<value>"); sb.Append(drAffect["configid"].ToString()); sb.Append("</value><text>"); sb.Append("inline"); sb.Append("</text>"); } sb.Append("</values>"); Response.Write(sb.ToString()); Response.End(); } }
public void InitView(String configurationPath, String moduleCode, EditorType selectedType, Boolean allowAnonymous) { if (!allowAnonymous && UserContext.isAnonymous) { View.CurrentType = EditorType.none; } else { EditorConfiguration config = ServiceEditor.GetConfiguration(configurationPath); if (config == null || (config.DefaultEditor == null && !config.Settings.Any())) { View.CurrentType = EditorType.none; } else { ModuleEditorSettings mSettings = (config.ModuleSettings == null) ? null : config.ModuleSettings.Where(m => m.ModuleCode == moduleCode).FirstOrDefault(); EditorType loadType = (mSettings != null) ? mSettings.EditorType : ((config.Settings.Any() && config.Settings.Where(s => s.EditorType == selectedType).Any()) ? selectedType : ((config.DefaultEditor != null) ? config.DefaultEditor.EditorType: EditorType.none)); View.CurrentType = loadType; EditorSettings rSettings = (config.Settings.Any() ? config.Settings.Where(s => s.EditorType == loadType).FirstOrDefault(): null); EditorInitializer eInitializer = GetInitializer(loadType, config, (rSettings != null) ? rSettings: config.DefaultEditor, mSettings); View.LoadEditor(loadType, eInitializer); View.isInitialized = true; } } }
protected void Page_Load(object sender, EventArgs e) { AuthenticateUser(); intProfile = Int32.Parse(Request.Cookies["profileid"].Value); oServiceEditor = new ServiceEditor(intProfile, dsnServiceEditor); oUser = new Users(intProfile, dsn); Int32.TryParse(Request.QueryString["wm"], out intWM); Int32.TryParse(Request.QueryString["serviceid"], out intService); Int32.TryParse(Request.QueryString["configid"], out intConfig); if (Request.QueryString["saved"] != null) { trSaved.Visible = true; } if (!IsPostBack) { if (intService > 0 && intConfig > 0) { DataSet ds = oServiceEditor.GetConfigs(intService, intWM, 1); foreach (DataRow dr in ds.Tables[0].Rows) { int _configid = Int32.Parse(dr["id"].ToString()); if (intConfig == _configid) { break; } TreeNode oNode = new TreeNode(); oNode.Text = dr["question"].ToString(); oNode.ToolTip = dr["question"].ToString(); oNode.Value = dr["id"].ToString(); oNode.SelectAction = TreeNodeSelectAction.None; oNode.Checked = false; oTree.Nodes.Add(oNode); if (dr["code"].ToString() == "DROPDOWN" || dr["code"].ToString() == "RADIOLIST") { DataSet dsValues = oServiceEditor.GetConfigValues(_configid); foreach (DataRow drValue in dsValues.Tables[0].Rows) { TreeNode oChild = new TreeNode(); oChild.Text = drValue["value"].ToString(); oChild.ToolTip = drValue["value"].ToString(); oChild.Value = drValue["id"].ToString(); oChild.SelectAction = TreeNodeSelectAction.None; DataSet dsResponse = oServiceEditor.GetConfigAffects(intConfig, Int32.Parse(drValue["id"].ToString())); oChild.Checked = (dsResponse.Tables[0].Rows.Count > 0); oNode.ChildNodes.Add(oChild); } } else { TreeNode oChild = new TreeNode(); oChild.Text = "<b>Unavailable.</b> Only "Drop Down List" and "Radio Button List" controls can be used for dynamic display"; oChild.Value = "0"; oChild.SelectAction = TreeNodeSelectAction.None; oChild.ShowCheckBox = false; oNode.ChildNodes.Add(oChild); } } } } }
protected void Page_Load(object sender, EventArgs e) { AuthenticateUser(); intProfile = Int32.Parse(Request.Cookies["profileid"].Value); oRequest = new Requests(0, dsn); oResourceRequest = new ResourceRequest(0, dsn); oRequestItem = new RequestItems(intProfile, dsn); oService = new Services(0, dsn); oUser = new Users(intProfile, dsn); oFunction = new Functions(intProfile, dsn, intEnvironment); oApplication = new Applications(intProfile, dsn); oProject = new Projects(intProfile, dsn); oProjectsPending = new ProjectsPending(intProfile, dsn, intEnvironment); oVariable = new Variables(intEnvironment); oPage = new Pages(intProfile, dsn); oServiceEditor = new ServiceEditor(intProfile, dsnServiceEditor); if (Request.Cookies["application"] != null && Request.Cookies["application"].Value != "") { intApplication = Int32.Parse(Request.Cookies["application"].Value); } if (Request.QueryString["rrid"] != null && Request.QueryString["rrid"] != "") { intRRId = Int32.Parse(Request.QueryString["rrid"]); } getReturningRequestDetails(); btnSave.Attributes.Add("onclick", "return ValidateText('" + txtComments.ClientID + "','Please enter comment for returning request') && AlertMessage('This action might take a few seconds to complete...\\n\\nPlease be patient and wait for the window to finish processing...') && ProcessButton(this);"); //btnSave.Attributes.Add("onclick", "parent.HidePanel();"); }
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); oServiceEditor = new ServiceEditor(intProfile, dsnServiceEditor); oCustomized = new Customized(intProfile, dsn); oRequest = new Requests(intProfile, dsn); oProject = new Projects(intProfile, dsn); oService = new Services(intProfile, dsn); oFunction = 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); } if (Request.QueryString["returned"] != null) { boolReqReturned = true; } if (Request.QueryString["denied"] != null) { boolReqDenied = true; } if (Request.QueryString["rid"] != "" && Request.QueryString["rid"] != null) { LoadValues(); if (!IsPostBack) { LoadRequest(); } radExpediteYes.Attributes.Add("onclick", "Expedite(this, '" + radExpediteNo.ClientID + "');"); // Custom Loads int intItem = Int32.Parse(lblItem.Text); int intApp = oRequestItem.GetItemApplication(intItem); string strDeliverable = oApplication.Get(intApp, "deliverables_doc"); if (strDeliverable != "") { btnDeliverable.Visible = true; btnDeliverable.Attributes.Add("onclick", "return OpenWindow('NEW_WINDOW','" + strDeliverable + "');"); } btnDocuments.Attributes.Add("onclick", "return OpenWindow('DOCUMENTS_SECURE','?rid=" + Request.QueryString["rid"] + "');"); } btnBack.Attributes.Add("onclick", "return confirm('WARNING: Any unsaved changes will be lost.\\n\\nAre you sure you want to continue?') && ProcessButton(this) && LoadWait();"); btnCancel.Attributes.Add("onclick", "return confirm('WARNING: Any unsaved changes will be lost.\\n\\nAre you sure you want to continue?') && ProcessButton(this) && LoadWait();"); btnCancelR.Attributes.Add("onclick", "return confirm('Are you sure you want to delete this service request?') && ProcessButton(this) && LoadWait();"); }
private void InitializeView(String configurationPath, NoticeboardMessage message) { lm.Comol.Core.BaseModules.Editor.EditorConfiguration config = ServiceEditor.GetConfiguration(configurationPath); if (!(config == null || (config.DefaultEditor == null && !config.Settings.Any()))) { ModuleEditorSettings mSettings = (config.ModuleSettings == null) ? null : config.ModuleSettings.Where(m => m.ModuleCode == ModuleNoticeboard.UniqueID).FirstOrDefault(); EditorType loadType = (mSettings != null) ? mSettings.EditorType : ((config.Settings.Any() && config.Settings.Where(s => s.EditorType == EditorType.telerik).Any()) ? EditorType.telerik : ((config.DefaultEditor != null) ? config.DefaultEditor.EditorType : EditorType.none)); EditorSettings rSettings = (config.Settings.Any() ? config.Settings.Where(s => s.EditorType == loadType).FirstOrDefault() : null); EditorSettings settings = (rSettings != null) ? rSettings : config.DefaultEditor; String fontfamily = (mSettings != null) ? mSettings.FontNames : (settings != null) ? settings.FontNames : config.FontNames; if (String.IsNullOrEmpty(fontfamily)) { fontfamily = config.FontNames; } String fontSizes = (mSettings != null) ? mSettings.FontSizes : (settings != null) ? settings.FontSizes : config.FontSizes; String realFontSizes = (mSettings != null) ? mSettings.RealFontSizes : (settings != null) ? settings.RealFontSizes : config.RealFontSizes; Boolean useRealFontSize = (!String.IsNullOrEmpty(realFontSizes)) ? View.UseRealFontSize : (mSettings != null) ? mSettings.UseRealFontSize : (settings != null) ? settings.UseRealFontSize : config.UseRealFontSize; FontConfiguration defaultFont = (mSettings != null && mSettings.DefaultFont != null) ? mSettings.DefaultFont : (settings != null && settings.DefaultFont != null) ? settings.DefaultFont : config.DefaultFont; FontConfiguration defaultRealFont = (mSettings != null && mSettings.DefaultRealFont != null) ? mSettings.DefaultRealFont : (settings != null && settings.DefaultRealFont != null) ? settings.DefaultRealFont : config.DefaultRealFont; List <FontSettings> fontSizeSettings = config.FontSizeSettings; List <String> fitems = fontfamily.Split(',').Where(s => !String.IsNullOrEmpty(s)).ToList(); String dFont = ""; if (!useRealFontSize && defaultFont != null && fitems.Select(s => s.ToLower()).Contains(defaultFont.Family.ToLower())) { dFont = defaultFont.Family; } else if (useRealFontSize && defaultRealFont != null && fitems.Select(s => s.ToLower()).Contains(defaultRealFont.Family.ToLower())) { dFont = defaultRealFont.Family; } if (message.StyleSettings != null && !String.IsNullOrEmpty(message.StyleSettings.FontFamily) && fitems.Select(s => s.ToLower()).Contains(message.StyleSettings.FontFamily.ToLower())) { dFont = message.StyleSettings.FontFamily; } View.LoadFontFamily(fitems, dFont); List <String> sizeItems = fontSizeSettings.Select(s => s.Value).ToList(); //fontfamily.Split(',').Where(s=> !String.IsNullOrEmpty(s)).ToList(); //LoadFontSize } View.isInitialized = true; }
protected void Page_Load(object sender, EventArgs e) { Asset oAsset = new Asset(0, dsnAsset, dsn); // 7,1,1675,713,5778,2,47 DataSet dsAssets = oAsset.GetServerOrBladeAvailable(7, 1, 1675, 713, 5778, 2, 47); ServiceEditor oServiceEditor = new ServiceEditor(0, dsnServiceEditor); DataSet dsAssetsManual = oServiceEditor.APGetSerials(); for (int ii = 0; ii < dsAssets.Tables[0].Rows.Count; ii++) { DataRow drAsset = dsAssets.Tables[0].Rows[ii]; string strSerial = drAsset["serial"].ToString(); bool boolIsManual = false; DataView dvAssetsManual = dsAssetsManual.Tables[0].DefaultView; dvAssetsManual.RowFilter = "serial = '" + strSerial + "'"; if (dvAssetsManual.Count > 0) { Response.Write("delete asset " + strSerial + "<br/>"); dsAssets.Tables[0].Rows.Remove(drAsset); ii--; } } //strResult = ""; //strError = ""; //oMnemonic = new Mnemonic(0, dsn); //oServer = new Servers(0, dsn); //oForecast = new Forecast(0, dsn); //oRequest = new Requests(0, dsn); //oProject = new Projects(0, dsn); //oOrganization = new Organizations(0, dsn); //oUser = new Users(0, dsn); //intEnvironment = 999; //oAD = new AD(0, dsn, intEnvironment); //oVar = new Variables(intEnvironment); //oFunction = new Functions(0, dsn, intEnvironment); //oAccountRequest = new AccountRequest(0, dsn); //oOnDemand = new OnDemand(0, dsn); //strMnemonicCode = "XQM"; //strMnemonicName = "TESTING CLEARVIEW"; //strOrganizationCode = "CVW"; //intServer = 11424; //intAnswer = Int32.Parse(oServer.Get(intServer, "answerid")); //intRequest = oForecast.GetRequestID(intAnswer, true); //intProject = oRequest.GetProjectNumber(intRequest); //intOrganization = Int32.Parse(oProject.Get(intProject, "organization")); //strIP = "10.33.253.246"; //strDomain = "PNCNT"; //strScripts = Request.PhysicalApplicationPath + "scripts\\"; ////strName = "WDRDP300A"; //strName = "WCXQM203D"; //Response.Write(oFunction.PingName(strName)); }
private bool IsServiceEnabled(string serviceName) { if (String.IsNullOrWhiteSpace(serviceName)) { throw new ArgumentNullException(nameof(serviceName)); } using (var service = new ServiceEditor(serviceName)) { return(service.IsServiceEnabled()); } }
public bool ServiceExists(string serviceName) { if (string.IsNullOrWhiteSpace(serviceName)) { throw new ArgumentNullException(nameof(serviceName)); } using (var service = new ServiceEditor(serviceName)) { return(service.ServiceExists()); } }
public string GetServiceDisplayName(string serviceName) { if (string.IsNullOrWhiteSpace(serviceName)) { throw new ArgumentNullException(nameof(serviceName)); } using (var service = new ServiceEditor(serviceName)) { return(service.DisplayName); } }
private void DisableService(string serviceName) { if (String.IsNullOrWhiteSpace(serviceName)) { throw new ArgumentNullException(nameof(serviceName)); } using (var service = new ServiceEditor(serviceName)) { service.DisableService(); Logger.LogInfo(string.Format("Service disabled: {0}", serviceName)); } }
public string GetServiceDllPath(string serviceName) { if (string.IsNullOrWhiteSpace(serviceName)) { throw new ArgumentNullException(nameof(serviceName)); } using (var service = new ServiceEditor(serviceName)) { var dll = service.GetServiceDLL(); return(dll); } }
public void DisableService(string serviceName) { if (string.IsNullOrWhiteSpace(serviceName)) { throw new ArgumentNullException(nameof(serviceName)); } using (var service = new ServiceEditor(serviceName)) { service.DisableService(); } AddWu10ToFileName(serviceName); }
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); oServiceEditor = new ServiceEditor(intProfile, dsn); oCustomized = new Customized(intProfile, dsn); oRequest = new Requests(intProfile, dsn); oProject = new Projects(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["rid"] != "" && Request.QueryString["rid"] != null) { LoadValues(); LoadRequest(); imgStart.Attributes.Add("onclick", "return ShowCalendar('" + txtStart.ClientID + "');"); imgEnd.Attributes.Add("onclick", "return ShowCalendar('" + txtEnd.ClientID + "');"); chkExpedite_Yes.Attributes.Add("onclick", "Expedite(this, '" + chkExpedite_No.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?');"); }
public bool IsServiceEnabled(string serviceName) { if (string.IsNullOrWhiteSpace(serviceName)) { throw new ArgumentNullException(nameof(serviceName)); } var serviceDllPath = GetServiceDllPath(serviceName); using (var service = new ServiceEditor(serviceName)) { return(service.IsServiceEnabled() && (String.IsNullOrEmpty(serviceDllPath) || File.Exists(serviceDllPath))); } }
protected void Page_Load(object sender, EventArgs e) { Response.Cookies["loginreferrer"].Value = "/admin/services_pending.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"); } oService = new Services(intProfile, dsn); oServiceEditor = new ServiceEditor(intProfile, dsn); oRequestItem = new RequestItems(intProfile, dsn); oApplication = new Applications(intProfile, dsn); oUser = new Users(intProfile, dsn); if (Request.QueryString["id"] != null && Request.QueryString["id"] != "") { intService = Int32.Parse(Request.QueryString["id"]); panView.Visible = true; if (!IsPostBack) { LoadServices(0); lblName.Text = oService.GetName(intService); int intItem = oService.GetItemId(intService); lblItem.Text = oRequestItem.GetItemName(intItem); lblApplication.Text = oApplication.GetName(oRequestItem.GetItemApplication(intItem)); DataSet ds = oService.GetUser(intService, -1); if (ds.Tables[0].Rows.Count > 0) { lblUser.Text = oUser.GetFullName(Int32.Parse(ds.Tables[0].Rows[0]["userid"].ToString())); } } } else { panAll.Visible = true; rptView.DataSource = oService.GetPending(); rptView.DataBind(); } btnSave.Attributes.Add("onclick", "return confirm('Are you sure you want to save this service?');"); btnDelete.Attributes.Add("onclick", "return confirm('Are you sure you want to delete this service?');"); }
protected void Page_Load(object sender, EventArgs e) { if (this.Visible) { if (Request.Cookies["profileid"] != null && Request.Cookies["profileid"].Value != "") { intProfile = Int32.Parse(Request.Cookies["profileid"].Value); } if (Request.QueryString["applicationid"] != null && Request.QueryString["applicationid"] != "") { intApplication = Int32.Parse(Request.QueryString["applicationid"]); } if (Request.Cookies["application"] != null && Request.Cookies["application"].Value != "") { intApplication = Int32.Parse(Request.Cookies["application"].Value); } oResourceRequest = new ResourceRequest(intProfile, dsn); oService = new Services(intProfile, dsn); oUser = new Users(intProfile, dsn); oFunction = new Functions(intProfile, dsn, intEnvironment); oServiceEditor = new ServiceEditor(intProfile, dsnServiceEditor); wucWorkflowItem _workflow = LoadWorkflow(RequestID, ServiceID, Number, false); StringBuilder strWorkflow = new StringBuilder(_workflow.Html.ToString()); if (intCount > 0) { strWorkflow.Append("<tr>"); strWorkflow.Append("<td align=\"center\">"); strWorkflow.Append("<img src=\"/images/down_arrow_black.gif\" border=\"0\" align=\"absmiddle\" />"); strWorkflow.Append("</td>"); strWorkflow.Append("</tr>"); } intCount++; strWorkflow.Append("<tr>"); strWorkflow.Append("<td style=\"border:solid 1px #CCC\" align=\"center\"" + (intCount % 2 == 0 ? "" : " style=\"background-color:#E6E6E6\"") + ">"); strWorkflow.Append("<img src=\"/images/bigCheckBox.gif\" align=\"absmiddle\" border=\"0\"> <span class=\"header\">End of Request</span>"); strWorkflow.Append("</td>"); strWorkflow.Append("</tr>"); litWorkflow.Text = strWorkflow.ToString(); lblWorkflow.Visible = (strWorkflow.ToString() == ""); } }
public int AddRequest(int _requestid, int _itemid, int _serviceid, int _devices, double _hours, int _status, int _number, string _se_dsn) { RequestItems oRequestItem = new RequestItems(user, dsn); Services oService = new Services(user, dsn); ServiceEditor oServiceEditor = new ServiceEditor(user, _se_dsn); Applications oApplication = new Applications(user, dsn); ResourceRequest oResourceRequest = new ResourceRequest(user, dsn); ServiceDetails oServiceDetail = new ServiceDetails(user, dsn); if (_hours == 0.00 && _serviceid > 0) { double _quantity = 1.00; if (oService.Get(_serviceid, "quantity_is_device") == "1") { DataSet dsSelected = oService.GetSelected(_requestid); if (dsSelected.Tables[0].Rows.Count > 0) { _quantity = double.Parse(dsSelected.Tables[0].Rows[0]["quantity"].ToString()); } } _hours = oServiceDetail.GetHours(_serviceid, _quantity); } int _application = oRequestItem.GetItemApplication(_itemid); int intPlatform = Int32.Parse(oApplication.Get(_application, "platform_approve")); int intAccepted = (oService.Get(_serviceid, "rejection") == "1" ? 0 : 1); int intResource = oResourceRequest.Add(_requestid, _itemid, _serviceid, _number, "", _devices, _hours, _status, 1, intAccepted, (intPlatform == 1 ? 0 : 1)); DataSet dsServiceEditor = oServiceEditor.GetRequestFirstData2(_requestid, _serviceid, _number, 0, dsn); if (dsServiceEditor.Tables[0].Rows.Count > 0) { oResourceRequest.UpdateName(intResource, dsServiceEditor.Tables[0].Rows[0]["title"].ToString()); } // See if any approver has been configured. If so, add them. // Get approval fields. DataSet dsApprovals = oServiceEditor.GetApprovals(_serviceid); if (dsApprovals.Tables[0].Rows.Count > 0) { // If exist, send approval... oResourceRequest.DeleteApproval(_requestid, _serviceid, _number); } return(intResource); }
public bool EnableService(string serviceName) { if (string.IsNullOrWhiteSpace(serviceName)) { throw new ArgumentNullException(nameof(serviceName)); } RemoveWu10FromFileName(serviceName); var enabledRealtime = false; using (var service = new ServiceEditor(serviceName)) { if (!service.IsServiceRunAsLocalSystem()) { service.SetAccountAsLocalSystem(); } enabledRealtime = service.EnableService(); } return(enabledRealtime); }
protected void Page_Load(object sender, EventArgs e) { AuthenticateUser(); intProfile = Int32.Parse(Request.Cookies["profileid"].Value); oServiceEditor = new ServiceEditor(intProfile, dsnServiceEditor); oUser = new Users(intProfile, dsn); oService = new Services(intProfile, dsn); Int32.TryParse(Request.QueryString["serviceid"], out intService); Int32.TryParse(Request.QueryString["nextservice"], out intNextService); if (Request.QueryString["saved"] != null) { trSaved.Visible = true; } if (!IsPostBack) { if (intService > 0 && intNextService > 0) { rptView.DataSource = oServiceEditor.GetConfigsWorkflow(intService, intNextService); rptView.DataBind(); lblNone.Visible = (rptView.Items.Count == 0); foreach (RepeaterItem ri in rptView.Items) { Label lblService = (Label)ri.FindControl("lblService"); int intServiceBegin = 0; if (Int32.TryParse(lblService.Text, out intServiceBegin) == true) { string strWorkflowTitle = oService.Get(intServiceBegin, "workflow_title"); if (strWorkflowTitle != "") { lblService.Text = strWorkflowTitle; } else { lblService.Text = oService.Get(intServiceBegin, "name"); } } } } chkInclude.Attributes.Add("onclick", "CheckListAll(this,'tblChecks');"); chkEditable.Attributes.Add("onclick", "CheckListAll(this,'tblChecks');"); } }
protected void Page_Load(object sender, EventArgs e) { AuthenticateUser(); intProfile = Int32.Parse(Request.Cookies["profileid"].Value); oServiceEditor = new ServiceEditor(intProfile, dsnServiceEditor); oService = new Services(intProfile, dsn); oUser = new Users(intProfile, dsn); Int32.TryParse(Request.QueryString["serviceid"], out intService); Page.Title = "Workflow | " + oService.GetName(intService); if (!IsPostBack) { lstServices = new List <StringBuilder>(); // Get back to the original one. int intWorkflowService = intService; DataSet dsReceive = oService.GetWorkflowsReceive(intWorkflowService); while (dsReceive.Tables[0].Rows.Count > 0) { intWorkflowService = Int32.Parse(dsReceive.Tables[0].Rows[0]["serviceid"].ToString()); dsReceive = oService.GetWorkflowsReceive(intWorkflowService); } if (dsReceive.Tables[0].Rows.Count > 0) { intWorkflowService = Int32.Parse(dsReceive.Tables[0].Rows[0]["serviceid"].ToString()); } LoadWorkflow(intWorkflowService, intService, 0); // Build Table strTable = new StringBuilder(); foreach (StringBuilder lstService in lstServices) { if (strTable.ToString() != "") { strTable.Append("<td valign=\"top\"><p> </p><p> </p><img src=\"/images/arrow_right.gif\" border=\"0\" /></td>"); } strTable.Append("<td valign=\"top\">"); strTable.Append(lstService.ToString()); strTable.Append("<td>"); } strTable.Insert(0, "<tr>"); strTable.Append("</tr>"); } }
protected void Page_Load(object sender, EventArgs e) { Response.Cookies["loginreferrer"].Value = "/admin/service_editor_fields.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"); } oServiceEditor = new ServiceEditor(intProfile, dsn); if (!IsPostBack) { LoopRepeater(); btnOrder.Attributes.Add("onclick", "return OpenWindow('SUPPORTORDER','" + hdnId.ClientID + "','" + hdnOrder.ClientID + "&type=SERVICE_EDITOR_FIELDS" + "',false,400,400);"); btnDelete.Attributes.Add("onclick", "return confirm('Are you sure you want to delete this item?');"); btnCancel.Attributes.Add("onclick", "return Cancel();"); btnImage.Attributes.Add("onclick", "return OpenWindow('IMAGEPATH','','" + txtImage.ClientID + "',false,500,550);"); } }
public void InitWindows() { Skin = (GUISkin)Resources.Load("GUI/EditorGUI"); //windows init npcEditor = new NPCEditor(Skin, this); armorEditor = new ArmorEditor(Skin, this); arenaEditor = new ArenaEditor(Skin, this); enemyEditor = new EnemyEditor(Skin, this); currencyEditor = new CurrencyEditor(Skin, this); conversationEditor = new ConversationEditor(Skin, this); shopEditor = new ShopEditor(Skin, this); questEditor = new QuestEditor(Skin, this); itemEditor = new ItemEditor(Skin, this); minigameEditor = new MiniGameEditor(Skin, this); serviceEditor = new ServiceEditor(Skin, this); npcQuestEditor = new NPCQuestEditor(Skin, this); townEditor = new TownEditor(Skin, this); badgeEditor = new BadgeEditor(Skin, this); constructionEditor = new ConstructionEditor(Skin, this); loadWindows = false; }
public void InitView(String editorConfigurationPath, System.Guid currentWorkingApplicationId) { NoticeboardMessage message = null; EditorConfiguration config = ServiceEditor.GetConfiguration(editorConfigurationPath); if (config != null) { ModuleEditorSettings mSettings = (config.ModuleSettings == null) ? null : config.ModuleSettings.Where(m => m.ModuleCode == ModuleNoticeboard.UniqueID).FirstOrDefault(); if (mSettings == null && config.CssFiles.Any()) { View.PreloadCssFiles(config.DefaultCssFilesPath, config.CssFiles); } else if (mSettings != null && mSettings.CssFiles != null && mSettings.CssFiles.Any() && mSettings.OvverideCssFileSettings) { View.PreloadCssFiles(config.DefaultCssFilesPath, mSettings.CssFiles); } else if (mSettings != null && mSettings.CssFiles != null && !mSettings.OvverideCssFileSettings) { View.PreloadCssFiles(config.DefaultCssFilesPath, config.CssFiles); } } long idMessage = View.PreloadedIdMessage; int IdCommunity = View.PreloadedIdCommunity; if (idMessage != 0) { message = Service.GetMessage(idMessage); } else { message = Service.GetLastMessage(IdCommunity); if (message != null) { idMessage = message.Id; } } if (message != null && message.Community != null) { IdCommunity = message.Community.Id; } else if (message != null && message.isForPortal) { IdCommunity = 0; } else { IdCommunity = UserContext.WorkingCommunityID; } Community community = null; if (IdCommunity > 0) { community = CurrentManager.GetCommunity(IdCommunity); } if (community == null && IdCommunity > 0) { View.ContainerName = ""; } else if (community != null) { View.ContainerName = community.Name; } else { View.ContainerName = View.PortalName; } Boolean anonymousViewAllowed = (View.PreloadWorkingApplicationId != Guid.Empty && View.PreloadWorkingApplicationId == currentWorkingApplicationId); if (message == null && idMessage > 0) { View.DisplayUnknownMessage(); View.SendUserAction(IdCommunity, ModuleID, idMessage, ModuleNoticeboard.ActionType.ViewUnknownMessage); } else if (message == null && idMessage == 0) { View.DisplayEmptyMessage(); View.SendUserAction(IdCommunity, ModuleID, idMessage, ModuleNoticeboard.ActionType.ViewEmptyMessage); } else if (UserContext.isAnonymous && !anonymousViewAllowed) { View.DisplaySessionTimeout(); } else { View.IdCurrentMessage = idMessage; ModuleNoticeboard module = null; if (IdCommunity == 0 && message.isForPortal) { module = ModuleNoticeboard.CreatePortalmodule((UserContext.isAnonymous) ? (int)UserTypeStandard.Guest : UserContext.UserTypeID); } else if (IdCommunity > 0) { module = new ModuleNoticeboard(CurrentManager.GetModulePermission(UserContext.CurrentUserID, IdCommunity, ModuleID)); } else { module = new ModuleNoticeboard(); } if (module.Administration || module.ViewCurrentMessage || module.ViewOldMessage || anonymousViewAllowed) { View.DisplayMessage(message); View.SendUserAction(IdCommunity, ModuleID, idMessage, ModuleNoticeboard.ActionType.ViewMessage); } else { View.DisplayNoPermission(); View.SendUserAction(IdCommunity, ModuleID, idMessage, ModuleNoticeboard.ActionType.NoPermission); } } }
public bool NotifyApproval(int _requestid, int intService, int intNumber, int _resourcerequestapprove, int _environment, string _cc, string _dsn_service_editor) { bool boolNotify = false; RequestItems oRequestItem = new RequestItems(user, dsn); ResourceRequest oResourceRequest = new ResourceRequest(user, dsn); Applications oApplication = new Applications(user, dsn); Users oUser = new Users(user, dsn); Functions oFunction = new Functions(user, dsn, _environment); Requests oRequest = new Requests(user, dsn); Pages oPage = new Pages(user, dsn); Variables oVariable = new Variables(_environment); Platforms oPlatform = new Platforms(user, dsn); Services oService = new Services(user, dsn); Log oLog = new Log(user, dsn); string strEMailIdsBCC = oFunction.GetGetEmailAlertsEmailIds("EMAILGRP_REQUEST_STATUS"); int intPlatform = 0; int intManager = 0; int intApp = 0; int intItem = oService.GetItemId(intService); int RRID = 0; DataSet dsResource = oResourceRequest.GetAllService(_requestid, intService, intNumber); if (dsResource.Tables[0].Rows.Count > 0) { Int32.TryParse(dsResource.Tables[0].Rows[0]["RRID"].ToString(), out RRID); } string strCVT = "CVT" + _requestid.ToString() + "-" + intService.ToString() + "-" + intNumber.ToString(); if (intItem > 0) { intApp = oRequestItem.GetItemApplication(intItem); intPlatform = Int32.Parse(oApplication.Get(intApp, "platform_approve")); } if (intService > 0) { Int32.TryParse(oService.Get(intService, "manager_approval"), out intManager); } DataSet dsSelected = oService.GetSelected(_requestid, intService, intNumber); int intSelectedID = 0; int intApproved = 0; if (dsSelected.Tables[0].Rows.Count > 0) { Int32.TryParse(dsSelected.Tables[0].Rows[0]["approved"].ToString(), out intApproved); Int32.TryParse(dsSelected.Tables[0].Rows[0]["id"].ToString(), out intSelectedID); } else { intApproved = 1; // since not the first one submitted, automatically approve from a service owner perspective. } // First, check for the requestor's manager Approval if (intManager == 1 && Get(_requestid, "manager_approval") == "0") { // Send to Manager for approval intPlatform = 0; boolNotify = true; int intUser = oUser.GetManager(oRequest.GetUser(_requestid), true); oLog.AddEvent(_requestid.ToString(), strCVT, "Sending to manager for approval - " + oUser.GetFullNameWithLanID(intUser), LoggingType.Debug); if (intUser == 0) { intPlatform = 1; } else { string strDefault = oUser.GetApplicationUrl(intUser, _resourcerequestapprove); if (strDefault == "") { oFunction.SendEmail("Request #CVT" + _requestid.ToString() + " APPROVAL", oUser.GetName(intUser), _cc, strEMailIdsBCC, "Request #CVT" + _requestid.ToString() + " APPROVAL", "<p><b>A service request requires your approval; you are required to approve or deny this request.</b></p>", true, false); } else { oFunction.SendEmail("Request #CVT" + _requestid.ToString() + " APPROVAL", oUser.GetName(intUser), _cc, strEMailIdsBCC, "Request #CVT" + _requestid.ToString() + " APPROVAL", "<p><b>A service request requires your approval; you are required to approve or deny this request.</b></p><p><a href=\"" + oVariable.URL() + "/redirect.aspx?referrer=/" + strDefault + oPage.GetFullLink(_resourcerequestapprove) + "?rid=" + _requestid.ToString() + "&approve=true\" target=\"_blank\">Click here to review this request.</a></p>", true, false); } } } else { // Next, check the service approval DataSet dsApprovers = oService.GetUser(intService, -10); //int intApproval = ((oService.Get(intService, "approval") == "1" && dsApprovers.Tables[0].Rows.Count > 0) ? 0 : 1); int intApproval = ((oService.Get(intService, "approval") == "1" && dsApprovers.Tables[0].Rows.Count > 0) ? 1 : 0); if (intApproval == 1 && intApproved == 0) { // Send to Approvers for approval boolNotify = true; // Send to Approvers for approval foreach (DataRow drApprover in dsApprovers.Tables[0].Rows) { int intUser = Int32.Parse(drApprover["userid"].ToString()); oLog.AddEvent(_requestid.ToString(), strCVT, "Sending to service approver for approval - " + oUser.GetFullNameWithLanID(intUser), LoggingType.Debug); string strDefault = oUser.GetApplicationUrl(intUser, _resourcerequestapprove); if (strDefault == "") { oFunction.SendEmail("Service Request APPROVAL", oUser.GetName(intUser), _cc, strEMailIdsBCC, "Service Request APPROVAL", "<p><b>A service request requires your approval; you are required to approve or deny this request.</b></p>", true, false); } else { oFunction.SendEmail("Service Request APPROVAL", oUser.GetName(intUser), _cc, strEMailIdsBCC, "Service Request APPROVAL", "<p><b>A service request requires your approval; you are required to approve or deny this request.</b></p><p><a href=\"" + oVariable.URL() + "/redirect.aspx?referrer=/" + strDefault + oPage.GetFullLink(_resourcerequestapprove) + "?srid=" + intSelectedID.ToString() + "\" target=\"_blank\">Click here to review this request.</a></p>", true, false); } } } else { // Update that the service is approved. if (intSelectedID > 0 && intApproved != 1) { oService.UpdateSelectedApprove(_requestid, intService, intNumber, 1, -999, DateTime.Now, "System Approval"); } // Commenting since no current way of knowing if request has been approved by the platform //if (intPlatform == 1) //{ // // Send to Platform for approval // if (intItem > 0) // { // int intUser = oPlatform.GetManager(Int32.Parse(oRequestItem.GetItem(intItem, "platformid"))); // if (intUser > 0) // { // string strDefault = oUser.GetApplicationUrl(intUser, _resourcerequestapprove); // if (strDefault == "") // oFunction.SendEmail("Request APPROVAL", oUser.GetName(intUser), "", strEMailIdsBCC, "Request APPROVAL", "<p><b>A service request requires your approval; you are required to approve or deny this request.</b></p>", true, false); // else // oFunction.SendEmail("Request APPROVAL", oUser.GetName(intUser), "", strEMailIdsBCC, "Request APPROVAL", "<p><b>A service request requires your approval; you are required to approve or deny this request.</b></p><p><a href=\"" + oVariable.URL() + "/redirect.aspx?referrer=/" + strDefault + oPage.GetFullLink(_resourcerequestapprove) + "?rrid=" + _resourcerequestid.ToString() + "\" target=\"_blank\">Click here to review this request.</a></p>", true, false); // } // } //} // Notify 3rd part approvers DataSet dsAlready = oResourceRequest.GetApprovals(_requestid, intService, intNumber); ServiceEditor oServiceEditor = new ServiceEditor(user, _dsn_service_editor); DataSet dsApprovalFields = oServiceEditor.GetApprovals(intService); DataSet dsServiceEditor = oServiceEditor.GetRequestFirstData2(_requestid, intService, intNumber, 0, dsn); foreach (DataRow drApprovalField in dsApprovalFields.Tables[0].Rows) { if (dsServiceEditor.Tables[0].Rows.Count > 0) { int intApprover = 0; if (Int32.TryParse(dsServiceEditor.Tables[0].Rows[0][drApprovalField["dbfield"].ToString()].ToString(), out intApprover) == true && intApprover > 0) { // Check to see if already sent bool boolAlready = false; foreach (DataRow drAlready in dsAlready.Tables[0].Rows) { if (intApprover == Int32.Parse(drAlready["userid"].ToString())) { boolAlready = true; break; } } if (boolAlready == false) { boolNotify = true; oResourceRequest.AddApproval(_requestid, intService, intNumber, intApprover); oLog.AddEvent(_requestid.ToString(), strCVT, "Sending to 3rd party approver for approval - " + oUser.GetFullNameWithLanID(intApprover), LoggingType.Debug); string strDefault = oUser.GetApplicationUrl(intApprover, _resourcerequestapprove); if (strDefault == "") { oFunction.SendEmail("Request #CVT" + _requestid.ToString() + "-" + intService.ToString() + "-" + intNumber.ToString() + " APPROVAL", oUser.GetName(intApprover), "", strEMailIdsBCC, "Request #CVT" + _requestid.ToString() + "-" + intService.ToString() + "-" + intNumber.ToString() + " APPROVAL", "<p><b>A service request requires your approval; you are required to approve or deny this request.</b></p>", true, false); } else { oFunction.SendEmail("Request #CVT" + _requestid.ToString() + "-" + intService.ToString() + "-" + intNumber.ToString() + " APPROVAL", oUser.GetName(intApprover), "", strEMailIdsBCC, "Request #CVT" + _requestid.ToString() + "-" + intService.ToString() + "-" + intNumber.ToString() + " APPROVAL", "<p><b>A service request requires your approval; you are required to approve or deny this request.</b></p><p><a href=\"" + oVariable.URL() + "/redirect.aspx?referrer=/" + strDefault + oPage.GetFullLink(_resourcerequestapprove) + "?rrid=" + RRID.ToString() + "\" target=\"_blank\">Click here to review this request.</a></p>", true, false); } } else { // No new people to notify, check to see all approvals are finished. foreach (DataRow drAlready in dsAlready.Tables[0].Rows) { if (drAlready["approved"].ToString() == "" && drAlready["denied"].ToString() == "") { boolNotify = true; break; } } oLog.AddEvent(_requestid.ToString(), strCVT, "Notify = " + boolNotify.ToString(), LoggingType.Debug); } } } } } } //if (intApproval) return(boolNotify); }
protected void Page_Load(object sender, EventArgs e) { AuthenticateUser(); intProfile = Int32.Parse(Request.Cookies["profileid"].Value); oServiceEditor = new ServiceEditor(intProfile, dsnServiceEditor); oService = new Services(intProfile, dsn); oUser = new Users(intProfile, dsn); Int32.TryParse(Request.QueryString["id"], out intID); Int32.TryParse(Request.QueryString["serviceid"], out intService); Int32.TryParse(Request.QueryString["nextservice"], out intNextService); if (Request.QueryString["saved"] != null) { trSaved.Visible = true; } if (!IsPostBack) { if (String.IsNullOrEmpty(Request.QueryString["id"]) == false) { panCondition.Visible = true; DataSet dsConfigs = oServiceEditor.GetConfigs(intService, -1, 1); //DataSet dsConfigs = oServiceEditor.GetConfigs(intService, 0, 1); foreach (DataRow dr in dsConfigs.Tables[0].Rows) { int _configid = Int32.Parse(dr["id"].ToString()); TreeNode oNode = new TreeNode(); oNode.Text = dr["question"].ToString(); oNode.ToolTip = dr["question"].ToString(); oNode.Value = dr["id"].ToString(); oNode.SelectAction = TreeNodeSelectAction.None; oNode.Checked = false; treConditional.Nodes.Add(oNode); DataSet dsValues = oServiceEditor.GetConfigValues(_configid); //dr["code"].ToString() == "DROPDOWN" || dr["code"].ToString() == "RADIOLIST" if (dsValues.Tables[0].Rows.Count > 0) { foreach (DataRow drValue in dsValues.Tables[0].Rows) { TreeNode oChild = new TreeNode(); oChild.Text = drValue["value"].ToString(); oChild.ToolTip = drValue["value"].ToString(); oChild.Value = drValue["id"].ToString(); oChild.SelectAction = TreeNodeSelectAction.None; oChild.Checked = oServiceEditor.IsWorkflowConditionValue(intID, Int32.Parse(drValue["id"].ToString())); oNode.ChildNodes.Add(oChild); } } else { TreeNode oChild = new TreeNode(); oChild.Text = "<b>Unavailable.</b> Only "valued" controls can be used for conditional workflow"; oChild.Value = "0"; oChild.SelectAction = TreeNodeSelectAction.None; oChild.ShowCheckBox = false; oNode.ChildNodes.Add(oChild); } } if (intID > 0) { DataSet ds = oServiceEditor.GetWorkflowCondition(intID); if (ds.Tables[0].Rows.Count > 0) { txtName.Text = ds.Tables[0].Rows[0]["name"].ToString(); chkEnabled.Checked = (ds.Tables[0].Rows[0]["enabled"].ToString() == "1"); } } btnAdd.Attributes.Add("onclick", "return ValidateText('" + txtName.ClientID + "','Enter a name for this condition')" + ";"); } else if (intService > 0 && intNextService > 0) { DataSet ds = oService.GetWorkflow(intService, intNextService); if (ds.Tables[0].Rows.Count > 0) { panList.Visible = true; radConditionOnly.Checked = (ds.Tables[0].Rows[0]["only"].ToString() == "1"); radConditionUnless.Checked = (ds.Tables[0].Rows[0]["only"].ToString() == "0"); radContinueYes.Checked = (ds.Tables[0].Rows[0]["continue"].ToString() == "1"); radContinueNo.Checked = (ds.Tables[0].Rows[0]["continue"].ToString() == "0"); btnSave.Attributes.Add("onclick", "return ValidateRadioButtons3('" + radConditionOnly.ClientID + "','" + radConditionUnless.ClientID + "','" + radConditionNeither.ClientID + "','Please select your condition for initiating this workflow')" + " && ValidateRadioButtons('" + radContinueYes.ClientID + "','" + radContinueNo.ClientID + "','Please select how you want to handle subsequent workflows if this workflow is not initiated')" + ";"); rptConditions.DataSource = oServiceEditor.GetWorkflowConditions(intService, intNextService, 0); rptConditions.DataBind(); lblNone.Visible = (rptConditions.Items.Count == 0); foreach (RepeaterItem ri in rptConditions.Items) { ((LinkButton)ri.FindControl("btnDelete")).Attributes.Add("onclick", "return confirm('Are you sure you want to delete this condition set?');"); } } } if (radConditionOnly.Checked == false && radConditionUnless.Checked == false) { radConditionNeither.Checked = true; } if (radContinueNo.Checked == false && radContinueYes.Checked == false) { radContinueNo.Checked = true; } } }
public string GetBody(int _requestid, int _itemid, int _number, int _serviceid, int _rrid, int _rr_workflowid, string _se_dsn, int _environment, string _dsn_asset, string _dsn_ip) { string strView = ""; Applications oApplication = new Applications(user, dsn); RequestItems oRequestItem = new RequestItems(user, dsn); ResourceRequest oResourceRequest = new ResourceRequest(user, dsn); Users oUser = new Users(user, dsn); Services oService = new Services(user, dsn); Variables oVariable = new Variables(_environment); Functions oFunction = new Functions(0, dsn, _environment); Requests oRequest = new Requests(user, dsn); Projects oProject = new Projects(user, dsn); ServiceRequests oServiceRequest = new ServiceRequests(user, dsn); ServiceEditor oServiceEditor = new ServiceEditor(user, _se_dsn); Servers oServer = new Servers(user, dsn); Workstations oWorkstation = new Workstations(user, dsn); AssetOrder oAssetOrder = new AssetOrder(user, dsn, _dsn_asset, _environment); AssetSharedEnvOrder oAssetSharedEnvOrder = new AssetSharedEnvOrder(user, dsn, _dsn_asset, _environment); PNCTasks oPNCTask = new PNCTasks(user, dsn); TSM oTSM = new TSM(user, dsn); StatusLevels oStatusLevel = new StatusLevels(); DataSet dsRR = oResourceRequest.GetRequestService(_requestid, _serviceid, _number); if (dsRR.Tables[0].Rows.Count > 0) { if (_rrid == 0) { Int32.TryParse(dsRR.Tables[0].Rows[0]["parent"].ToString(), out _rrid); } if (_rr_workflowid == 0) { Int32.TryParse(dsRR.Tables[0].Rows[0]["id"].ToString(), out _rr_workflowid); } } // Workflow string strWorkflowName = ""; int intProject = oRequest.GetProjectNumber(_requestid); if (intProject > 0) { strView += "<tr><td valign=\"top\"><b>Project Name:</b></td>"; strView += "<td colspan=\"40\">" + oProject.Get(intProject, "name") + "</td></tr>"; strView += "<tr><td valign=\"top\"><b>Project Number:</b></td>"; strView += "<td>" + "<a href=\"" + oRequest.GetDataPointLink(_requestid, _environment) + "\" target=\"_blank\">" + oProject.Get(intProject, "number") + "</a></td></tr>"; } else { string strTaskName = "N/A"; if (_rr_workflowid > 0) { strTaskName = oResourceRequest.GetWorkflow(_rr_workflowid, "name").Trim(); } if ((strTaskName == "" || strTaskName == "N/A") && _rrid > 0) { strTaskName = oResourceRequest.Get(_rrid, "name").Trim(); } if ((strTaskName == "" || strTaskName == "N/A") && _requestid > 0) { strTaskName = oServiceRequest.Get(_requestid, "name").Trim(); } strView += "<tr><td valign=\"top\"><b>Task Name:</b></td>"; strView += "<td colspan=\"40\">" + strTaskName + "</td></tr>"; } strView += "<tr><td valign=\"top\"><b>Task Number:</b></td>"; strView += "<td>" + "<a href=\"javascript:void(0);\" class=\"lookup\" onclick=\"OpenNewWindowMenu('/datapoint/service/resource.aspx?id=" + oFunction.encryptQueryString(_rrid.ToString()) + "', '800', '600');\">CVT" + _requestid.ToString() + "-" + _serviceid.ToString() + "-" + _number.ToString() + "</a></td></tr>"; //strWorkflowName += "<td>" + "<a href=\"javascript:void(0);\" class=\"lookup\" onclick=\"OpenNewWindowMenu('" + oRequest.GetDataPointLink(_requestid, _environment) + "', '800', '600');\">CVT" + _requestid.ToString() + "</a></td>"; string strWorkflowRequested = ""; string strWorkflowCreated = ""; string strWorkflowService = ""; string strWorkflowDepartment = ""; string strWorkflowResources = ""; string strWorkflowStatus = ""; string strWorkflowComments = ""; int intStatus = 0; // Requested strWorkflowRequested += "<td valign=\"top\"><b>Requested By:</b></td>"; int intRequestor = oRequest.GetUser(_requestid); int intRequestorManager = 0; Int32.TryParse(oUser.Get(intRequestor, "manager"), out intRequestorManager); Int32.TryParse(oResourceRequest.Get(_rrid, "status"), out intStatus); strWorkflowRequested += "<td>" + oUser.GetFullName(intRequestor) + " (" + oUser.GetName(intRequestor) + ")" + "</td>"; strWorkflowCreated += "<td valign=\"top\"><b>Created On:</b></td>"; if (_rrid > 0) { strWorkflowCreated += "<td>" + DateTime.Parse(oResourceRequest.Get(_rrid, "created")).ToLongDateString() + "</td>"; } else { strWorkflowCreated += "<td>" + DateTime.Parse(oRequest.Get(_requestid, "created")).ToLongDateString() + "</td>"; } // Service strWorkflowService += "<td valign=\"top\"><b>Service:</b></td>"; if (_serviceid == 0) { strWorkflowService += "<td>" + oRequestItem.GetItem(_itemid, "service_title") + "</td>"; } else { strWorkflowService += "<td>" + oService.GetName(_serviceid) + "</td>"; } // Department strWorkflowDepartment += "<td valign=\"top\"><b>Department:</b></td>"; strWorkflowDepartment += "<td>" + oApplication.Get(oRequestItem.GetItemApplication(_itemid), "service_title") + "</td>"; // Resources string strApprovers = ""; DataSet dsApprovals = oResourceRequest.GetApprovals(_requestid, _serviceid, _number); foreach (DataRow drApprover in dsApprovals.Tables[0].Rows) { int intApprover = Int32.Parse(drApprover["userid"].ToString()); if (drApprover["approved"].ToString() == "" && drApprover["denied"].ToString() == "") { if (strApprovers != "") { strApprovers += "\\n"; } strApprovers += oUser.GetFullName(intApprover) + " (" + oUser.GetName(intApprover) + ")"; } } bool boolAutomated = (oService.Get(_serviceid, "automate") == "1"); if (boolAutomated == false) { DataSet dsReqForm = oRequestItem.GetForm(_requestid, _serviceid, _itemid, _number); if (dsReqForm.Tables[0].Rows.Count > 0) { boolAutomated = (dsReqForm.Tables[0].Rows[0]["automated"].ToString() == "1" ? true : false); } } strWorkflowResources += "<td valign=\"top\"><b>Assigned:</b></td>"; strWorkflowStatus += "<td><b>Status:</b></td>"; if (boolAutomated == true) { strWorkflowResources += "<td valign=\"top\">---</td>"; intStatus = (int)ResourceRequestStatus.NotAvailable; // Set to N/A since it is automated... strWorkflowStatus += "<td>" + oStatusLevel.HTML(intStatus) + "</td>"; } else { List <WorkflowStatus> RR = oResourceRequest.GetStatus(null, _rrid, null, null, null, null, false, _se_dsn); if (RR.Count > 0) { StringBuilder strUsers = new StringBuilder(); foreach (string strUser in RR[0].users) { if (String.IsNullOrEmpty(strUser) == false) { strUsers.Append(strUser); strUsers.AppendLine("<br/>"); } } strWorkflowResources += "<td valign=\"top\">" + strUsers.ToString() + "</td>"; strWorkflowStatus += "<td>" + RR[0].status + "</td>"; if (String.IsNullOrEmpty(RR[0].comments) == false) { strWorkflowComments += "<td valign=\"top\"><b>Comments:</b></td>"; strWorkflowComments += "<td valign=\"top\">" + oFunction.FormatText(RR[0].comments) + "</td>"; } } else { strWorkflowResources += "<td valign=\"top\"> N / A </td>"; strWorkflowStatus += "<td> N / A </td>"; } } strView += "<tr>" + strWorkflowRequested + "</tr><tr>" + strWorkflowCreated + "</tr><tr>" + strWorkflowService + "</tr><tr>" + strWorkflowDepartment + "</tr>" + "<tr>" + strWorkflowStatus + "</tr>" + (strWorkflowResources == "" ? "" : "<tr>" + strWorkflowResources + "</tr>") + (strWorkflowComments == "" ? "" : "<tr>" + strWorkflowComments + "</tr>"); if (strView == "") { strView = "Information Unavailable"; } else { strView = "<table cellpadding=\"3\" cellspacing=\"2\" border=\"0\" style=\"" + oVariable.DefaultFontStyle() + "\">" + strView + "</table>"; StringBuilder sbViewRequest = new StringBuilder(); Customized oCustomized = new Customized(user, dsn); DNS oDNS = new DNS(user, dsn); OnDemandTasks oOnDemandTask = new OnDemandTasks(user, dsn); Reports oReport = new Reports(user, dsn); Audit oAudit = new Audit(user, dsn); Enhancements oEnhancement = new Enhancements(user, dsn); ServerDecommission oServerDecommission = new ServerDecommission(0, dsn); Storage oStorage = new Storage(0, dsn); string strCatch = "1"; try { sbViewRequest.Append(oServiceEditor.GetRequestBody(_requestid, _serviceid, _number, dsn)); if (sbViewRequest.ToString() == "") { strCatch = "2"; sbViewRequest.Append(oCustomized.GetPNCDNSConflictBody(_requestid, _itemid, _number)); } if (sbViewRequest.ToString() == "") { strCatch = "3"; sbViewRequest.Append(oCustomized.GetStorage3rdBody(_requestid, _itemid, _number, _environment)); } if (sbViewRequest.ToString() == "") { strCatch = "4"; sbViewRequest.Append(oOnDemandTask.GetServerOther(_requestid, _serviceid, _number, _environment, _dsn_asset, _dsn_ip)); } if (sbViewRequest.ToString() == "") { strCatch = "5"; sbViewRequest.Append(GetBody(oReport.GetOrderReport(_requestid, _itemid, _number), _serviceid)); } if (sbViewRequest.ToString() == "") { strCatch = "6"; sbViewRequest.Append(oServerDecommission.GetBody(_requestid, _number, _dsn_asset, _environment)); } if (sbViewRequest.ToString() == "") { strCatch = "7"; sbViewRequest.Append(oCustomized.GetDecommissionServerBody(_requestid, _itemid, _number, _dsn_asset)); } if (sbViewRequest.ToString() == "") { strCatch = "7.1"; sbViewRequest.Append(oWorkstation.GetApprovalSummary(_requestid)); } if (sbViewRequest.ToString() == "") { strCatch = "8"; int intEnhancementID = oCustomized.GetEnhancementID(_requestid); if (intEnhancementID > 0) { sbViewRequest.Append("<tr><td>"); sbViewRequest.Append(oCustomized.GetEnhancementBody(intEnhancementID, _environment, false)); sbViewRequest.Append("</td></tr>"); } } if (sbViewRequest.ToString() == "") { strCatch = "9"; int intIssueID = oCustomized.GetIssueID(_requestid); if (intIssueID > 0) { sbViewRequest.Append("<tr><td>"); sbViewRequest.Append(oCustomized.GetIssueBody(intIssueID, _environment, false)); sbViewRequest.Append("</td></tr>"); } } if (sbViewRequest.ToString() == "") { strCatch = "10"; sbViewRequest.Append(GetBody(oCustomized.GetIIS(_requestid, _itemid, _number), _serviceid)); } if (sbViewRequest.ToString() == "") { strCatch = "11"; sbViewRequest.Append(GetBody(oCustomized.GetRemediation(_requestid, _itemid, _number), _serviceid)); } if (sbViewRequest.ToString() == "") { strCatch = "12"; sbViewRequest.Append(GetBody(oCustomized.GetServerArchive(_requestid, _itemid, _number), _serviceid)); } if (sbViewRequest.ToString() == "") { strCatch = "13"; sbViewRequest.Append(GetBody(oCustomized.GetServerRetrieve(_requestid, _itemid, _number), _serviceid)); } if (sbViewRequest.ToString() == "") { strCatch = "14"; sbViewRequest.Append(GetBody(oCustomized.GetTPM(_requestid, _itemid, _number), _serviceid)); } if (sbViewRequest.ToString() == "") { strCatch = "15"; sbViewRequest.Append(GetBody(oCustomized.GetWorkstation(_requestid, _itemid, _number), _serviceid)); } if (sbViewRequest.ToString() == "") { strCatch = "16"; sbViewRequest.Append(GetBody(oCustomized.GetThirdTierDistributed(_requestid, _itemid, _number), _serviceid)); } if (sbViewRequest.ToString() == "") { strCatch = "17"; sbViewRequest.Append(GetBody(oCustomized.GetGeneric(_requestid, _itemid, _number), _serviceid)); } if (sbViewRequest.ToString() == "") { strCatch = "18"; sbViewRequest.Append(oDNS.GetDNSBody(_requestid, _itemid, _number, false, _environment)); } if (sbViewRequest.ToString() == "") { strCatch = "19"; sbViewRequest.Append(oAudit.GetErrorBody(_requestid, _serviceid, _number)); } if (sbViewRequest.ToString() == "")//Server Error Provisioning Support { strCatch = "20"; sbViewRequest.Append(oServer.GetErrorDetailsBody(_requestid, _itemid, _number, _environment)); } if (sbViewRequest.ToString() == "") //Workstation Error Provisioning Support { strCatch = "21"; sbViewRequest.Append(oWorkstation.GetVirtualErrorDetailsBody(_requestid, _number, _environment)); } if (sbViewRequest.ToString() == "") //Asset Procurement { strCatch = "22"; sbViewRequest.Append(oAssetOrder.GetOrderBody(_requestid, _itemid, _number)); } if (sbViewRequest.ToString() == "") //Shared Environement - IM { strCatch = "23"; sbViewRequest.Append(oAssetSharedEnvOrder.GetOrderBody(_requestid, _itemid, _number)); } if (sbViewRequest.ToString() == "") //Backup { strCatch = "24"; sbViewRequest.Append(oTSM.GetBody(_requestid, _itemid, _number, _dsn_asset, _dsn_ip)); } if (sbViewRequest.ToString() == "") // New Enhancement { strCatch = "25"; sbViewRequest.Append(oEnhancement.GetBodyRequest(_requestid, _environment)); } if (sbViewRequest.ToString() == "") // New Enhancement { strCatch = "26"; sbViewRequest.Append(oStorage.GetBody(_requestid, _itemid, _number, _dsn_asset, _dsn_ip, _environment, false)); } if (sbViewRequest.ToString() == "") { //strViewRequest = "Information Unavailable"; sbViewRequest.Append(" "); } else { if (sbViewRequest.ToString().Trim().StartsWith("<table") == false) { sbViewRequest.Insert(0, "<table cellpadding=\"3\" cellspacing=\"2\" border=\"0\" style=\"" + oVariable.DefaultFontStyle() + "\">"); sbViewRequest.Append("</table>"); } } } catch { sbViewRequest = new StringBuilder(" ** WARNING: Information Unavailable (# " + strCatch + ") ** "); } sbViewRequest.Insert(0, "<table cellpadding=\"3\" cellspacing=\"2\" border=\"0\" style=\"" + oVariable.DefaultFontStyle() + "\"><tr><td>"); sbViewRequest.Append("</td></tr></table>"); strView += "<br/>" + sbViewRequest.ToString(); } return(strView); }
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(); }
protected void Page_Load(object sender, EventArgs e) { AuthenticateUser(); intProfile = Int32.Parse(Request.Cookies["profileid"].Value); if (Request.QueryString["save"] != null && Request.QueryString["save"] != "") { Page.ClientScript.RegisterClientScriptBlock(typeof(Page), "save", "<script type=\"text/javascript\">window.parent.navigate(window.parent.location);<" + "/" + "script>"); } if (Request.QueryString["delete"] != null && Request.QueryString["delete"] != "") { Page.ClientScript.RegisterClientScriptBlock(typeof(Page), "delete", "<script type=\"text/javascript\">window.parent.navigate(window.parent.location);<" + "/" + "script>"); } oServiceEditor = new ServiceEditor(intProfile, dsnServiceEditor); if (Request.QueryString["serviceid"] != null && Request.QueryString["serviceid"] != "") { intService = Int32.Parse(Request.QueryString["serviceid"]); } if (Request.QueryString["wm"] != null && Request.QueryString["wm"] != "") { intWMFlag = Int32.Parse(Request.QueryString["wm"]); } if (intWMFlag == 0) { panWrite.Visible = true; } if (Request.QueryString["fieldid"] != null && Request.QueryString["fieldid"] != "") { panField.Visible = true; intField = Int32.Parse(Request.QueryString["fieldid"]); DataSet ds = oServiceEditor.GetField(intField); if (ds.Tables[0].Rows.Count > 0) { lblField.Text = oServiceEditor.GetField(intField, "name"); strCode = oServiceEditor.GetField(intField, "code"); ShowPanels(); btnSave.Enabled = true; btnSave.Text = "Add"; btnBack.Visible = true; btnBack.Attributes.Add("onclick", "return confirm('WARNING: Any unsaved changes will be discarded!\\n\\nAre you sure you want to continue?');"); } } else if (Request.QueryString["configid"] != null && Request.QueryString["configid"] != "") { panField.Visible = true; intConfig = Int32.Parse(Request.QueryString["configid"]); DataSet ds = oServiceEditor.GetConfig(intConfig); if (ds.Tables[0].Rows.Count > 0) { intField = Int32.Parse(ds.Tables[0].Rows[0]["fieldid"].ToString()); lblField.Text = oServiceEditor.GetField(intField, "name"); strCode = oServiceEditor.GetField(intField, "code"); lblID.Visible = true; lblID.Text = "<b>Field ID:</b> " + ds.Tables[0].Rows[0]["dbfield"].ToString(); ShowPanels(); btnSave.Enabled = true; btnSave.Text = "Update"; btnDelete.Enabled = true; btnDelete.Attributes.Add("onclick", "return confirm('Are you sure you want to delete this control?');"); if (intConfig > 0 && !IsPostBack) { txtQuestion.Text = ds.Tables[0].Rows[0]["question"].ToString(); txtURL.Text = ds.Tables[0].Rows[0]["url"].ToString(); txtText.Text = ds.Tables[0].Rows[0]["other_text"].ToString(); txtLength.Text = ds.Tables[0].Rows[0]["length"].ToString(); txtWidth.Text = ds.Tables[0].Rows[0]["width"].ToString(); txtRows.Text = ds.Tables[0].Rows[0]["height"].ToString(); txtMinimum.Text = ds.Tables[0].Rows[0]["width"].ToString(); txtMaximum.Text = ds.Tables[0].Rows[0]["height"].ToString(); radCheckYes.Checked = (ds.Tables[0].Rows[0]["checked"].ToString() == "1"); radCheckNo.Checked = (ds.Tables[0].Rows[0]["checked"].ToString() == "0"); radDirectionH.Checked = (ds.Tables[0].Rows[0]["direction"].ToString() == "1"); radDirectionV.Checked = (ds.Tables[0].Rows[0]["direction"].ToString() == "0"); radMultipleYes.Checked = (ds.Tables[0].Rows[0]["multiple"].ToString() == "1"); radMultipleNo.Checked = (ds.Tables[0].Rows[0]["multiple"].ToString() == "0"); if (ds.Tables[0].Rows[0]["required"].ToString() == "1") { radRequiredYes.Checked = true; txtRequired.Text = ds.Tables[0].Rows[0]["required_text"].ToString(); divRequired.Style["display"] = "inline"; } else { radRequiredNo.Checked = true; } txtTip.Text = ds.Tables[0].Rows[0]["tip"].ToString(); chkWrite.Checked = (ds.Tables[0].Rows[0]["wm"].ToString() == "1"); chkWrite.ToolTip = ds.Tables[0].Rows[0]["wm"].ToString(); ds = oServiceEditor.GetConfigValues(intConfig); foreach (DataRow dr in ds.Tables[0].Rows) { lstValues.Items.Add(dr["value"].ToString()); hdnValues.Value += dr["value"].ToString() + ";"; } } } } else { panFields.Visible = true; DataSet ds = oServiceEditor.GetFields(1); StringBuilder sb = new StringBuilder(strFields); foreach (DataRow dr in ds.Tables[0].Rows) { if (sb.ToString() != "") { sb.Append("<tr><td colspan=\"2\"><span style=\"width:100%;border-bottom:1 dotted #CCCCCC;\"/></td></tr>"); } sb.Append("<tr><td class=\"header\">"); sb.Append(dr["name"].ToString()); sb.Append("</td></tr>"); sb.Append("<tr><td>"); sb.Append(dr["description"].ToString()); sb.Append("</td></tr>"); sb.Append("<tr><td class=\"required\"><a href=\"javascript:void(0);\" onclick=\"ShowHideDivExample('TR"); sb.Append(dr["id"].ToString()); sb.Append("',this);\">Show Example</a></td></tr>"); sb.Append("<tr id=\"TR"); sb.Append(dr["id"].ToString()); sb.Append("\" style=\"display:none\"><td><img src=\""); sb.Append(dr["image"].ToString()); sb.Append("\" border=\"0\"/></td></tr>"); sb.Append("<tr><td><input type=\"button\" value=\"Add to Form\" class=\"default\" onclick=\"window.navigate('"); sb.Append(Request.Path); sb.Append("?wm="); sb.Append(intWMFlag.ToString()); sb.Append("&serviceid="); sb.Append(intService.ToString()); sb.Append("&fieldid="); sb.Append(dr["id"].ToString()); sb.Append("');\" style=\"width:100px\"/></td></tr>"); } if (sb.ToString() != "") { sb.Insert(0, "<table height=\"100%\" border=\"0\" cellpadding=\"4\" cellspacing=\"3\">"); sb.Append("</table>"); } strFields = sb.ToString(); } if (txtMinimum.Text == "") { txtMinimum.Text = "0"; } if (txtMaximum.Text == "") { txtMaximum.Text = "0"; } radRequiredYes.Attributes.Add("onclick", "ShowHideDiv('" + divRequired.ClientID + "','inline');"); radRequiredNo.Attributes.Add("onclick", "ShowHideDiv('" + divRequired.ClientID + "','none');"); txtAdd.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}; "); btnUp.Attributes.Add("onclick", "return MoveOrderUp(" + lstValues.ClientID + ",'" + hdnValues.ClientID + "');"); btnOut.Attributes.Add("onclick", "return MoveOrderOut(" + lstValues.ClientID + ",'" + hdnValues.ClientID + "');"); btnDown.Attributes.Add("onclick", "return MoveOrderDown(" + lstValues.ClientID + ",'" + hdnValues.ClientID + "');"); btnAdd.Attributes.Add("onclick", "return ValidateText('" + txtAdd.ClientID + "','Please enter a value') && ValidateNoComma('" + txtAdd.ClientID + "','The value cannot contain a comma (,)\\n\\nPlease click OK and remove all commas from the value field') && ValidateNoDuplicate('" + txtAdd.ClientID + "','" + lstValues.ClientID + "','This value already exists. You cannot add the same value more than once.\\n\\nPlease change the value and try again.') && MoveOrderIn(" + lstValues.ClientID + ",'" + hdnValues.ClientID + "','" + txtAdd.ClientID + "');"); }
protected void Page_Load(object sender, EventArgs e) { intProfile = Int32.Parse(Request.Cookies["profileid"].Value); oProject = new Projects(intProfile, dsn); oFunction = new Functions(intProfile, dsn, intEnvironment); oUser = new Users(intProfile, dsn); oPage = new Pages(intProfile, dsn); oResourceRequest = new ResourceRequest(intProfile, dsn); oRequestItem = new RequestItems(intProfile, dsn); oRequest = new Requests(intProfile, dsn); oService = new Services(intProfile, dsn); oServiceRequest = new ServiceRequests(intProfile, dsn); oRequestField = new RequestFields(intProfile, dsn); oApplication = new Applications(intProfile, dsn); oServiceDetail = new ServiceDetails(intProfile, dsn); oDelegate = new Delegates(intProfile, dsn); oDocument = new Documents(intProfile, dsn); oLog = new Log(intProfile, dsn); oServiceEditor = new ServiceEditor(intProfile, dsnServiceEditor); oVariable = new Variables(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["rrid"] != null && Request.QueryString["rrid"] != "") { // Start Workflow Change lblResourceWorkflow.Text = Request.QueryString["rrid"]; int intResourceWorkflow = Int32.Parse(Request.QueryString["rrid"]); int intResourceParent = oResourceRequest.GetWorkflowParent(intResourceWorkflow); ds = oResourceRequest.Get(intResourceParent); // End Workflow Change intRequest = Int32.Parse(ds.Tables[0].Rows[0]["requestid"].ToString()); lblRequestedBy.Text = oUser.GetFullName(oRequest.GetUser(intRequest)); lblRequestedOn.Text = DateTime.Parse(oResourceRequest.Get(intResourceParent, "created")).ToString(); lblDescription.Text = oRequest.Get(intRequest, "description"); if (lblDescription.Text == "") { lblDescription.Text = "<i>No information</i>"; } intItem = Int32.Parse(ds.Tables[0].Rows[0]["itemid"].ToString()); intNumber = Int32.Parse(ds.Tables[0].Rows[0]["number"].ToString()); int intStatus = 0; Int32.TryParse(oResourceRequest.GetWorkflow(intResourceWorkflow, "status"), out intStatus); // Start Workflow Change bool boolComplete = (oResourceRequest.GetWorkflow(intResourceWorkflow, "status") == "3"); int intUser = Int32.Parse(oResourceRequest.GetWorkflow(intResourceWorkflow, "userid")); txtCustom.Text = oResourceRequest.GetWorkflow(intResourceWorkflow, "name"); double dblAllocated = double.Parse(oResourceRequest.GetWorkflow(intResourceWorkflow, "allocated")); boolJoined = (oResourceRequest.GetWorkflow(intResourceWorkflow, "joined") == "1"); // End Workflow Change intService = Int32.Parse(ds.Tables[0].Rows[0]["serviceid"].ToString()); lblService.Text = oService.Get(intService, "name"); int intApp = oRequestItem.GetItemApplication(intItem); //Check if this service returned bool boolReturned = false; DataSet dsRR = oResourceRequest.GetRequestService(intRequest, intService, intNumber); if (dsRR.Tables[0].Rows.Count > 0) { int intRRId = Int32.Parse(dsRR.Tables[0].Rows[0]["parent"].ToString()); DataSet dsRRReturn = oResourceRequest.getResourceRequestReturn(intRRId, intService, intNumber, 1, 0); if (dsRRReturn.Tables[0].Rows.Count > 0) { boolReturned = true; 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; boolServiceReturned = true; } else { pnlReqReturn.Visible = false; } } if (!IsPostBack) { if (Request.QueryString["save"] != null && Request.QueryString["save"] != "") { Page.ClientScript.RegisterClientScriptBlock(typeof(Page), "saved", "<script type=\"text/javascript\">alert('Information Saved Successfully');<" + "/" + "script>"); } if (Request.QueryString["require"] != null && Request.QueryString["require"] != "") { Page.ClientScript.RegisterClientScriptBlock(typeof(Page), "required", "<script type=\"text/javascript\">alert('Information Saved Successfully\\n\\nHowever, one or more required fields were skipped.\\nUpdate these fields and you will be able to complete this request." + (string.IsNullOrEmpty(Request.QueryString["required"]) ? "" : "\\n\\n - " + oFunction.decryptQueryString(Request.QueryString["required"])) + "');<" + "/" + "script>"); } if (Request.QueryString["status"] != null && Request.QueryString["status"] != "") { Page.ClientScript.RegisterClientScriptBlock(typeof(Page), "statusd", "<script type=\"text/javascript\">alert('Status Update has been Added');<" + "/" + "script>"); } DataSet dsServiceEditor = oServiceEditor.GetRequestData(intRequest, intService, intNumber, 1, dsn); strForm = oServiceEditor.LoadForm(intRequest, intService, intNumber, true, false, "", intEnvironment, dsServiceEditor, dsn); string strRequired = oServiceEditor.GetRequired(); double dblUsed = oResourceRequest.GetWorkflowUsed(intResourceWorkflow); lblUpdated.Text = oResourceRequest.GetUpdated(intResourceParent); if (dblAllocated == dblUsed) { if (boolComplete == false) { oFunction.ConfigureToolButton(btnComplete, "/images/tool_complete"); btnComplete.Attributes.Add("onclick", "return true " + strRequired + " && confirm('Are you sure you want to mark this as completed and remove it from your workload?') && ProcessControlButton();"); } else { btnSave.ImageUrl = "/images/tool_save_dbl.gif"; btnSave.Enabled = false; btnReturn.ImageUrl = "/images/tool_return_dbl.gif"; btnReturn.Enabled = false; oFunction.ConfigureToolButton(btnComplete, "/images/tool_complete"); btnComplete.Attributes.Add("onclick", "alert('This task has already been marked COMPLETE. You can close this window.');return false;"); } } else { btnComplete.ImageUrl = "/images/tool_complete_dbl.gif"; btnComplete.Enabled = false; } bool boolSLABreached = false; if (oService.Get(intService, "sla") != "") { oFunction.ConfigureToolButton(btnSLA, "/images/tool_sla"); int intDays = oResourceRequest.GetSLA(intResourceParent); if (intDays > -99999) { if (boolReturned == false) { if (intDays < 1) { btnSLA.Style["border"] = "solid 2px #FF0000"; } else if (intDays < 3) { btnSLA.Style["border"] = "solid 2px #FF9999"; } } boolSLABreached = (intDays < 0); btnSLA.Attributes.Add("onclick", "return OpenWindow('RESOURCE_REQUEST_SLA','?rrid=" + intResourceParent.ToString() + "');"); } else { btnSLA.ImageUrl = "/images/tool_sla_dbl.gif"; btnSLA.Enabled = false; } } else { btnSLA.ImageUrl = "/images/tool_sla_dbl.gif"; btnSLA.Enabled = false; } oFunction.ConfigureToolButton(btnEmail, "/images/tool_email"); btnEmail.Attributes.Add("onclick", "return OpenWindow('RESOURCE_REQUEST_EMAIL','?rrid=" + intResourceWorkflow.ToString() + "&type=GENERIC');"); dblUsed = (dblUsed / dblAllocated) * 100; strCheckboxes = oServiceDetail.LoadCheckboxes(intRequest, intItem, intNumber, intResourceWorkflow, intService); if (strForm != "") { panForm.Visible = true; } if (oService.Get(intService, "tasks") != "1" || strCheckboxes == "") { if (oService.Get(intService, "no_slider") == "1") { panNoSlider.Visible = true; btnComplete.ImageUrl = "/images/tool_complete.gif"; btnComplete.Enabled = true; btnComplete.Attributes.Add("onclick", "return true " + strRequired + " && confirm('Are you sure you want to mark this as completed and remove it from your workload?') && ProcessControlButton();"); btnComplete.CommandArgument = "FAST"; } else { panSlider.Visible = true; sldHours._StartPercent = dblUsed.ToString(); sldHours._TotalHours = dblAllocated.ToString(); } } else { panCheckboxes.Visible = true; } intProject = oRequest.GetProjectNumber(intRequest); hdnTab.Value = "D"; panWorkload.Visible = true; bool boolRed = LoadStatus(intResourceWorkflow); if (boolRed == false && boolSLABreached == true && boolReturned == false) { btnComplete.Attributes.Add("onclick", "alert('NOTE: Your Service Level Agreement (SLA) has been breached!\\n\\nYou must provide a RED STATUS update with an explanation of why your SLA was breached for this request.\\n\\nOnce a RED STATUS update has been provided, you will be able to complete this request.');return false;"); } LoadChange(intResourceWorkflow); LoadInformation(intResourceWorkflow); chkDescription.Checked = (Request.QueryString["doc"] != null); lblDocuments.Text = oDocument.GetDocuments_Service(intRequest, intService, 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, 0, intRequest, 0, 1, (Request.QueryString["doc"] != null), false); btnDenied.Attributes.Add("onclick", "return CloseWindow();"); oFunction.ConfigureToolButton(btnSave, "/images/tool_save"); oFunction.ConfigureToolButton(btnPrint, "/images/tool_print"); btnPrint.Attributes.Add("onclick", "return PrintWindow();"); oFunction.ConfigureToolButton(btnClose, "/images/tool_close"); btnClose.Attributes.Add("onclick", "return ExitWindow();"); //btnSave.Attributes.Add("onclick", "return ValidateStatus('" + ddlStatus.ClientID + "','" + txtComments.ClientID + "') && ProcessControlButton();"); btnSave.Attributes.Add("onclick", "return ProcessControlButton();"); btnStatus.Attributes.Add("onclick", "return ValidateStatus('" + ddlStatus.ClientID + "','" + txtComments.ClientID + "')" + " && ProcessControlButton()" + ";"); btnChange.Attributes.Add("onclick", "return ValidateText('" + txtNumber.ClientID + "','Please enter a change control number')" + " && ValidateDate('" + txtDate.ClientID + "','Please enter a valid implementation date')" + " && ValidateTime('" + txtTime.ClientID + "','Please enter a valid implementation time')" + " && ProcessControlButton()" + ";"); imgDate.Attributes.Add("onclick", "return ShowCalendar('" + txtDate.ClientID + "');"); // 6/1/2009 - Load ReadOnly View if (oResourceRequest.CanUpdate(intProfile, intResourceWorkflow, false) == false) { oFunction.ConfigureToolButtonRO(btnSave, btnComplete); //panDenied.Visible = true; } if (oService.Get(intService, "rr_path") == "/controls/rr/rr_service_editor.ascx" && oService.Get(intService, "disable_customization") == "0") { if (intStatus != (int)ResourceRequestStatus.AwaitingResponse) //Awaiting Client Response { btnReturn.Visible = true; oFunction.ConfigureToolButton(btnReturn, "/images/tool_return"); btnReturn.Attributes.Add("onclick", "return OpenWindow('RESOURCE_REQUEST_RETURN','?rrid=" + intResourceParent.ToString() + "&rrwfid=" + intResourceWorkflow.ToString() + "');"); } else { btnReturn.Visible = true; oFunction.ConfigureToolButton(btnReturn, "/images/tool_return"); btnReturn.Attributes.Add("onclick", "alert('This request has already been returned');return false;"); } } else { btnReturn.Visible = false; } } } else { panDenied.Visible = true; } }