protected void Page_Load(object sender, EventArgs e)
 {
     intProfile      = Int32.Parse(Request.Cookies["profileid"].Value);
     oServiceRequest = new ServiceRequests(intProfile, dsn);
     oPage           = new Pages(intProfile, dsn);
     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);
     }
     strRedirect = oPage.GetFullLink(intViewPage);
     if (intPage == intViewPage)
     {
         panHide.Visible = false;
     }
     else
     {
         lblTitle.Text      = "Returned Requests";
         rptView.DataSource = oServiceRequest.GetReturned(intProfile);
         rptView.DataBind();
     }
 }
Exemple #2
0
        private void AddResult(string strError)
        {
            if (strError == "")
            {
                oOnDemand.UpdateStepDoneServer(intServer, intStep, oOnDemand.GetStep(intStep, "done"), 0, false, false);
                oServer.NextStep(intServer);
                intStep++;
            }
            else
            {
                oEventLog.AddEvent(strName, strSerial, strError, LoggingType.Error);
                //Functions oFunction = new Functions(0, dsn, intEnvironment);
                //Variables oVariable = new Variables(intEnvironment);
                oOnDemand.UpdateStepDoneServer(intServer, intStep, strError, 1, false, false);

                // Generic Error Request
                Services        oService                    = new Services(0, dsn);
                ResourceRequest oResourceRequest            = new ResourceRequest(0, dsn);
                ServiceRequests oServiceRequest             = new ServiceRequests(0, dsn);
                int             intProvisioningErrorService = intService;
                int             intProvisioningErrorItem    = oService.GetItemId(intProvisioningErrorService);
                int             intProvisioningErrorNumber  = oResourceRequest.GetNumber(intRequest, intProvisioningErrorItem);
                int             intError                    = oServer.AddError(intRequest, intProvisioningErrorItem, intProvisioningErrorNumber, intServer, intStep, strError);
                int             intProvisioningError        = oResourceRequest.Add(intRequest, intProvisioningErrorItem, intProvisioningErrorService, intProvisioningErrorNumber, "Provisioning Error (" + strName + ")", 1, 0.00, 2, 1, 1, 1);
                if (oServiceRequest.NotifyApproval(intProvisioningError, intResourceRequestApprove, intEnvironment, "", dsnServiceEditor) == false)
                {
                    oServiceRequest.NotifyTeamLead(intProvisioningErrorItem, intProvisioningError, intAssignPage, intViewPage, intEnvironment, "", dsnServiceEditor, dsnAsset, dsnIP, 0);
                }
                if (boolEmailError == true)
                {
                    oFunction.SendEmail("Auto-Provisioning ERROR: " + strName, strTo, strCC, "", "Auto-Provisioning ERROR: " + strName, "<p><b>This message is to inform you that the server " + strName + " has encountered an error and has been stopped!</b><p><p>Serial Number: " + strSerial.ToUpper() + "<br/>Asset Tag: " + strAsset.ToUpper() + "<br/>Model: " + strModel.ToUpper() + "<br/>Step #: " + intStep.ToString() + "<br/>Error: " + strError + "<br/>ILO: <a href=\"https://" + strILO + "\" target=\"_blank\">" + strILO + "</a></p><p>When this issue has been resolved, <a href=\"" + oVariable.URL() + "/admin/errors_server.aspx?id=" + intServer.ToString() + "\" target=\"_blank\">click here</a> to clear this error and continue with the build.</p>", true, false);
                }
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            AuthenticateUser();
            intProfile      = Int32.Parse(Request.Cookies["profileid"].Value);
            oCustomized     = new Customized(intProfile, dsn);
            oPage           = new Pages(intProfile, dsn);
            oServiceRequest = new ServiceRequests(intProfile, dsn);
            oRequest        = new Requests(intProfile, dsn);
            if (Request.QueryString["rid"] != null && Request.QueryString["rid"] != "")
            {
                intRequest = Int32.Parse(Request.QueryString["rid"]);
            }

            ds = oCustomized.GetEnhancement(intRequest);

            if (!IsPostBack)
            {
                drpModules.DataSource     = oPage.Gets(0, 1);
                drpModules.DataTextField  = "title";
                drpModules.DataValueField = "pageid";
                drpModules.DataBind();
                drpModules.SelectedValue = ds.Tables[0].Rows[0]["pageid"].ToString();

                txtTitle.Text       = ds.Tables[0].Rows[0]["title"].ToString();
                txtDescription.Text = ds.Tables[0].Rows[0]["description"].ToString();
                txtNumUsers.Text    = ds.Tables[0].Rows[0]["num_users"].ToString();
                txtURL.Text         = ds.Tables[0].Rows[0]["url"].ToString();
                lblPath.Text        = ds.Tables[0].Rows[0]["path"].ToString();
                txtStartDate.Text   = DateTime.Parse(ds.Tables[0].Rows[0]["startdate"].ToString()).ToShortDateString();
                txtEndDate.Text     = DateTime.Parse(ds.Tables[0].Rows[0]["enddate"].ToString()).ToShortDateString();
            }

            imgStartDate.Attributes.Add("onclick", "return OpenCalendar('" + txtStartDate.ClientID + "');");
            imgEndDate.Attributes.Add("onclick", "return OpenCalendar('" + txtEndDate.ClientID + "');");
        }
Exemple #4
0
        private void GetServiceStops()
        {
            ServiceRequests.FromServicesRequest.OnCompleted = (response) =>
            {
                var fromServices = response.Result;
                Database.TempData.FromServices = fromServices;
                if (ServiceRequests.ToServicesRequest.IsCompleted)
                {
                    btnReserve.IsActivated = true;
                    btnBuy.IsActivated     = true;

                    App.HideProgress();
                    NavigationService.Navigate(new Uri("/Pages/Bus/PassengerListPage.xaml", UriKind.RelativeOrAbsolute));
                }
            };
            ServiceRequests.ToServicesRequest.OnCompleted = (response) =>
            {
                var toServices = response.Result;
                Database.TempData.ToServices = toServices;
                if (ServiceRequests.FromServicesRequest.IsCompleted)
                {
                    btnReserve.IsActivated = true;
                    btnBuy.IsActivated     = true;

                    App.HideProgress();
                    NavigationService.Navigate(new Uri("/Pages/Bus/PassengerListPage.xaml", UriKind.RelativeOrAbsolute));
                }
            };
            ServiceRequests.GetFromServices(Database.TempData.Ticket.Journeys[0].Segments[0]);
            ServiceRequests.GetToServices(Database.TempData.Ticket.Journeys[0].Segments[0]);
        }
Exemple #5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            intProfile        = Int32.Parse(Request.Cookies["profileid"].Value);
            oPlatform         = new Platforms(intProfile, dsn);
            oType             = new Types(intProfile, dsn);
            oModelsProperties = new ModelsProperties(intProfile, dsn);
            oAsset            = new Asset(intProfile, dsnAsset);
            oServiceRequest   = new ServiceRequests(intProfile, dsn);
            oForecast         = new Forecast(intProfile, dsn);
            if (Request.QueryString["applicationid"] != null && Request.QueryString["applicationid"] != "")
            {
                intApplication = Int32.Parse(Request.QueryString["applicationid"]);
            }
            if (Request.QueryString["pageid"] != null && Request.QueryString["pageid"] != "")
            {
                intPage = Int32.Parse(Request.QueryString["pageid"]);
            }
            if (Request.Cookies["application"] != null && Request.Cookies["application"].Value != "")
            {
                intApplication = Int32.Parse(Request.Cookies["application"].Value);
            }
            int intPlatform = 0;

            if (Request.QueryString["id"] != null && Request.QueryString["id"] != "")
            {
                intPlatform = Int32.Parse(Request.QueryString["id"]);
            }
            if (intPlatform > 0)
            {
                if (!IsPostBack)
                {
                }
            }
        }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (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);
         }
         oDataPoint      = new DataPoint(intProfile, dsn);
         oUser           = new Users(intProfile, dsn);
         oServiceRequest = new ServiceRequests(intProfile, dsn);
         oService        = new Services(intProfile, dsn);
         oFunction       = new Functions(intProfile, dsn, intEnvironment);
         oStatusLevel    = new StatusLevels();
         oProject        = new Projects(intProfile, dsn);
         oLog            = new Log(intProfile, dsn);
         int intProjectID = 0;
         if (intProjectId != null)
         {
             Int32.TryParse(intProjectId.ToString(), out intProjectID);
         }
         oLog.AddEvent("PROJECT_SEARCH", "", oProject.Get(intProjectID, "number") + ": ServiceProgression started at " + DateTime.Now.ToString(), LoggingType.Debug);
         LoadServiceProgression();
         oLog.AddEvent("PROJECT_SEARCH", "", oProject.Get(intProjectID, "number") + ": ServiceProgression finished at " + DateTime.Now.ToString(), LoggingType.Debug);
     }
 }
        protected void Page_Load(object sender, EventArgs e)
        {
            intProfile   = Int32.Parse(Request.Cookies["profileid"].Value);
            oPage        = new Pages(intProfile, dsn);
            oUser        = new Users(intProfile, dsn);
            oPlatform    = new Platforms(intProfile, dsn);
            oStatusLevel = new StatusLevels(intProfile, dsn);
            oAssetOrder  = new AssetOrder(intProfile, dsn, dsnAsset, intEnvironment);

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



            oRequest         = new Requests(intProfile, dsn);
            oResourceRequest = new ResourceRequest(intProfile, dsn);
            oService         = new Services(intProfile, dsn);
            oServiceRequest  = new ServiceRequests(intProfile, dsn);

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

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

                    btnApplyFilter.Attributes.Add("onclick", "return ValidateDate('" + txtStartDate.ClientID + "','Please enter start date')" +
                                                  " && ValidateDate('" + txtEndDate.ClientID + "','Please enter end date')" +
                                                  ";");
                }
                else
                {
                    Page.ClientScript.RegisterStartupScript(typeof(Page), "loadCurrentTab", "<script type=\"text/javascript\">window.top.LoadCurrentTab();<" + "/" + "script>");
                }
            }
            else
            {
                pnlDenied.Visible = true;
            }
        }
Exemple #8
0
        protected void Page_Load(object sender, EventArgs e)
        {
            AuthenticateUser();
            intProfile      = Int32.Parse(Request.Cookies["profileid"].Value);
            oCustomized     = new Customized(intProfile, dsn);
            oPage           = new Pages(intProfile, dsn);
            oServiceRequest = new ServiceRequests(intProfile, dsn);
            oRequest        = new Requests(intProfile, dsn);
            if (Request.QueryString["rid"] != null && Request.QueryString["rid"] != "")
            {
                intRequest = Int32.Parse(Request.QueryString["rid"]);
            }

            ds = oCustomized.GetIssue(intRequest);

            if (!IsPostBack)
            {
                drpModules.DataSource     = oPage.Gets(0, 1);
                drpModules.DataTextField  = "title";
                drpModules.DataValueField = "pageid";
                drpModules.DataBind();
                drpModules.SelectedValue = ds.Tables[0].Rows[0]["pageid"].ToString();

                txtTitle.Text       = ds.Tables[0].Rows[0]["title"].ToString();
                txtDescription.Text = ds.Tables[0].Rows[0]["description"].ToString();
                txtNumUsers.Text    = ds.Tables[0].Rows[0]["num_users"].ToString();
                txtURL.Text         = ds.Tables[0].Rows[0]["url"].ToString();
                lblPath.Text        = ds.Tables[0].Rows[0]["path"].ToString();
            }
        }
        // GET: ServiceRequests/Create
        public IActionResult Create()
        {
            ViewData["Member"]          = new SelectList(_context.Members, "Id", "MemberEmail");
            ViewData["Priority"]        = new SelectList(_context.Priorities, "Id", "PriorityDescription");
            ViewData["RequestType"]     = new SelectList(_context.RequestTypes, "Id", "RequestTypeDescription");
            ViewData["RequestTypeStep"] = new SelectList(_context.RequestTypeSteps, "Id", "StepDescription");
            ViewData["Status"]          = new SelectList(_context.StatusSets, "Id", "StatusDescription");
            ViewData["Team"]            = new SelectList(_context.Teams, "Id", "TeamDescription");

            string homePhone;
            string givenName;
            string surname;
            string email;

            var model = new ServiceRequests();

            model.RequestorId = User.Identity.Name;

            ViewBag.FileUp = _context.ApplicConfs.Select(s => s.FileSystemUpload).FirstOrDefault();

            Boolean ADconf = _context.ApplicConfs.Select(s => s.Adactive).FirstOrDefault();

            if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows) & (ADconf))
            {
                GetADinfo(out givenName, out surname, out homePhone, out email);

                model.RequestorFirstName = givenName;
                model.RequestorLastName  = surname;
                model.RequestorEmail     = email;
                model.RequestorPhone     = homePhone;
                model.RequestType        = 1;
            }

            return(View(model));
        }
Exemple #10
0
        public OrderResponse OrderLimit(string paramOrd, string publicKey, string secretKey)
        {
            string correctParam = paramOrd.Replace("_", "");

            var    privateApi = new SecretKeyRequiredRequester();
            string response   = string.Empty;

            Regex  my_reg     = new Regex(@"\D");
            string serverTime = string.Empty;

            try
            {
                serverTime = my_reg.Replace(ServiceRequests.ServerTime(), "");
            }
            catch (Exception ex)
            {
                // TODO: loging
            }

            string url_order     = "https://api.binance.com/api/v3/order?" + correctParam + "&type=LIMIT&recvWindow=5000&timeInForce=GTC&timestamp=" + serverTime;
            string api_parametrs = correctParam + "&type=LIMIT&recvWindow=5000&timeInForce=GTC&timestamp=" + serverTime;

            try
            {
                response = privateApi.GetWebRequest(url_order, api_parametrs, publicKey, secretKey, "POST");
            }
            catch (Exception ex)
            {
                // TODO: ВЫВЕСТИ НА МОРДУ
            }

            return(JConverter.JsonConver <OrderResponse>(response));
        }
Exemple #11
0
        public void AD_Mismatched_Accounts()
        {
            Requests        oRequest        = new Requests(0, dsn);
            Projects        oProject        = new Projects(0, dsn);
            ServiceRequests oServiceRequest = new ServiceRequests(0, dsn);
            int             intRequest      = 28815;

            if (oServiceRequest.Get(intRequest).Tables[0].Rows.Count == 0)
            {
                oServiceRequest.Add(intRequest, 1, 1);
            }
            double dblHours = 0.00;

            if (intEnvironment == 4)
            {
                dblHours += CompareDomainAccounts(2, 4, "X", 0, intRequest);
                dblHours += CompareDomainAccounts(3, 4, "X", 0, intRequest);
            }
            else
            {
                dblHours += CompareDomainAccounts(2, 3, "T", 0, intRequest);
            }
            double dblTime    = 5.00 / 60.00;
            double dblDevices = dblHours / dblTime;

            dblDevices = Math.Round(dblDevices);
            int intDevices  = Int32.Parse(dblDevices.ToString());
            int intResource = oServiceRequest.AddRequest(intRequest, intRemediationItem, 0, intDevices, dblHours, 2, 1, dsnServiceEditor);

            oServiceRequest.NotifyTeamLead(intRemediationItem, intResource, intAssignPage, intViewPage, intEnvironment, "", dsnServiceEditor, dsnAsset, dsnIP, 0);
        }
Exemple #12
0
        public void Execute(IJobExecutionContext context)
        {
            ServiceRequests requestsManager = new ServiceRequests();
            //get all the unreplaied requests and has new state
            List <RequestProvider> requests = requestsManager.GetAvalibaleRequests();

            //check if there is new requests
            if (requests.Any())
            {
                //update those requests state to expired if it has expired time
                foreach (RequestProvider request in requests.Where(request => request.ExpiryTime <= DateTime.Now))
                {
                    requestsManager.UpdateProviderRequest(request.RequestId, request.ProviderId, (int)RequestStutus.Expired,
                                                          "", request.Price ?? 0, 0);
                }

                /*  foreach (RequestProvider request in requests)
                 * {
                 *    if (request.ExpiryTime <= Servston.Utilities.GetCurrentClientDateTime())
                 *    {
                 *        requestsManager.UpdateProviderRequest(request.RequestId, request.ProviderId, (int)RequestStutus.Expired, "", request.Price ?? 0, 0);
                 *    }
                 * }*/
            }
        }
        public string ServiceUrlFill(ServiceHeaders s, ServiceRequests r)
        {
            string val = s.ServiceUrl;

            switch ((ServiceUrlFiller)s.ParamsType)
            {
            default:
                val += ServiceUrlFill(s.ServiceParams.Trim(), r.MSISDN.Trim(), s.ProductCode.Trim());
                break;

            case ServiceUrlFiller.standard:
                val += ServiceUrlFill(s.ServiceParams.Trim(), r.MSISDN.Trim(), s.ProductCode.Trim(), r.TransactionId.ToString().Replace("-", "").Trim(), s.Description.Trim());
                break;

            case ServiceUrlFiller.multiplex:
                val += ServiceUrlFill(s.ServiceParams, r.MSISDN.Trim(), s.ProductCode.Trim(), r.TransactionId.ToString().Replace("-", "").Trim(), DateTime.Now, s.TimeFormat);
                break;

            case ServiceUrlFiller.nil:
                val += ServiceUrlFill(s.ServiceParams);
                break;

            case ServiceUrlFiller.lone:
                val += ServiceUrlFill(s.ServiceParams, s.ProductCode);
                break;
            }
            new Thread(() =>
            {
                LocalLogger.LogFileWrite(val);
            }).Start();

            return(val);
        }
Exemple #14
0
        protected void Page_Load(object sender, EventArgs e)
        {
            intProfile        = Int32.Parse(Request.Cookies["profileid"].Value);
            oPlatform         = new Platforms(intProfile, dsn);
            oType             = new Types(intProfile, dsn);
            oModelsProperties = new ModelsProperties(intProfile, dsn);
            oServiceRequest   = new ServiceRequests(intProfile, dsn);
            oForecast         = new Forecast(intProfile, dsn);
            oPage             = new Pages(intProfile, dsn);
            oIM       = new InventoryManager(intProfile, dsn);
            oLocation = new Locations(intProfile, dsn);

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

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

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

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

                btnProjects.Attributes.Add("onclick", "return MakeWider(this, '" + lstProjects.ClientID + "');");
                btnProjectsClear.Attributes.Add("onclick", "return ClearList('" + lstProjects.ClientID + "');");
                btnClasses.Attributes.Add("onclick", "return MakeWider(this, '" + lstClasses.ClientID + "');");
                btnClassesClear.Attributes.Add("onclick", "return ClearList('" + lstClasses.ClientID + "');");
                btnConfidences.Attributes.Add("onclick", "return MakeWider(this, '" + lstConfidences.ClientID + "');");
                btnConfidencesClear.Attributes.Add("onclick", "return ClearList('" + lstConfidences.ClientID + "');");
                btnEnvironments.Attributes.Add("onclick", "return MakeWider(this, '" + lstEnvironments.ClientID + "');");
                btnEnvironmentsClear.Attributes.Add("onclick", "return ClearList('" + lstEnvironments.ClientID + "');");
                btnLocations.Attributes.Add("onclick", "return MakeWider(this, '" + lstLocations.ClientID + "');");
                btnLocationsClear.Attributes.Add("onclick", "return ClearList('" + lstLocations.ClientID + "');");
                lstClasses.Attributes.Add("onchange", "PopulateEnvironmentsList('" + lstClasses.ClientID + "','" + lstEnvironments.ClientID + "',0);");
                lstEnvironments.Attributes.Add("onchange", "UpdateListHidden('" + lstEnvironments.ClientID + "','" + hdnEnvironment.ClientID + "');");
                imgStart.Attributes.Add("onclick", "return ShowCalendar('" + txtStart.ClientID + "');");
                imgEnd.Attributes.Add("onclick", "return ShowCalendar('" + txtEnd.ClientID + "');");
            }
        }
Exemple #15
0
        public ActionResult DeleteConfirmed(int id)
        {
            ServiceRequests serviceRequests = db.ServiceRequests.Find(id);

            db.ServiceRequests.Remove(serviceRequests);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Exemple #16
0
        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();");
        }
 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);
     oServiceRequest  = new ServiceRequests(intProfile, dsn);
     if (Request.QueryString["applicationid"] != null && Request.QueryString["applicationid"] != "")
     {
         intApplication = Int32.Parse(Request.QueryString["applicationid"]);
     }
     if (Request.QueryString["pageid"] != null && Request.QueryString["pageid"] != "")
     {
         intPage = Int32.Parse(Request.QueryString["pageid"]);
     }
     if (Request.Cookies["application"] != null && Request.Cookies["application"].Value != "")
     {
         intApplication = Int32.Parse(Request.Cookies["application"].Value);
     }
     if (Request.QueryString["rid"] != "" && Request.QueryString["rid"] != null)
     {
         LoadValues();
         // 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 + "');");
         }
     }
     ddlCluster.Attributes.Add("onchange", "ResetDiv(null);SwapDivDDL(this,null,'" + divClusterYesGroup.ClientID + "','" + divClusterNo.ClientID + "',null);");
     ddlClusterYesSQLGroup.Attributes.Add("onchange", "SwapDivDDL(this,'" + divClusterYesGroupNew.ClientID + "',null,'" + divClusterYesGroupExisting.ClientID + "',null);");
     btnCancel1.Attributes.Add("onclick", "return confirm('Are you sure you want to delete this service request?');");
     btnNext.Attributes.Add("onclick", "return ValidateText('" + txtServerName.ClientID + "','Please enter the server name')" +
                            " && ValidateDropDown('" + ddlOS.ClientID + "','Please select the operating system')" +
                            " && ValidateDropDown('" + ddlMaintenance.ClientID + "','Please select the maintenance window')" +
                            " && ValidateDropDown('" + ddlCurrent.ClientID + "','Please select if the server currently has SAN')" +
                            " && ValidateDropDown('" + ddlType.ClientID + "','Please select the server type')" +
                            " && ValidateDropDown('" + ddlDR.ClientID + "','Please select the DR options')" +
                            " && ValidateDropDown('" + ddlPerformance.ClientID + "','Please select the performance type')" +
                            " && ValidateDropDown('" + ddlChange.ClientID + "','Please select if you have scheduled a change')" +
                            " && ValidateDropDown('" + ddlCluster.ClientID + "','Please select if the server is part of a cluster')" +
                            " && EnsureStorage3rd('" + ddlCluster.ClientID + "','" + ddlClusterYesSQLGroup.ClientID + "','" + txtClusterYesGroupExisting.ClientID + "','" + ddlClusterYesGroupExisting.ClientID + "','" + txtClusterYesGroupExistingFileSystem.ClientID + "','" + chkClusterYesGroupNewNetwork.ClientID + "','" + txtClusterYesGroupNewNetwork.ClientID + "','" + chkClusterYesGroupNewIP.ClientID + "','" + txtClusterYesGroupNewIP.ClientID + "','" + ddlClusterNo.ClientID + "','" + txtClusterNo.ClientID + "')" +
                            " && ValidateNumber0('" + txtAdditional.ClientID + "','Please enter the amount of ADDITIONAL storage to be added')" +
                            " && ValidateText('" + txtDescription.ClientID + "','Please enter a description of the work to be performed')" +
                            ";");
     imgDate.Attributes.Add("onclick", "return ShowCalendar('" + txtDate.ClientID + "');");
 }
Exemple #18
0
 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();
         btnNext.Attributes.Add("onclick", "return ValidateHidden('" + hdnExecutive.ClientID + "','" + txtExecutive.ClientID + "','Please enter the LAN ID of your executive sponsor')" +
                                " && ValidateHidden('" + hdnWorking.ClientID + "','" + txtWorking.ClientID + "','Please enter the LAN ID of your working sponsor')" +
                                " && ValidateText('" + txtStatement.ClientID + "','Please enter a statement of work')" +
                                " && ValidateDate('" + txtStart.ClientID + "','Please enter a valid estimated start date')" +
                                " && ValidateDate('" + txtEnd.ClientID + "','Please enter a valid estimated end date')" +
                                " && ValidateDates('" + txtStart.ClientID + "','" + txtEnd.ClientID + "','The estimated start date must occur before the estimated end date')" +
                                ";");
         txtExecutive.Attributes.Add("onkeyup", "return AJAXTextBoxGet(this,'300','195','" + divExecutive.ClientID + "','" + lstExecutive.ClientID + "','" + hdnExecutive.ClientID + "','" + oVariable.URL() + "/frame/users.aspx',2);");
         lstExecutive.Attributes.Add("ondblclick", "AJAXClickRow();");
         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);
         string strDeliverable = oApplication.Get(intApp, "deliverables_doc");
         if (strDeliverable != "")
         {
             panDeliverable.Visible = true;
             btnDeliverable.Attributes.Add("onclick", "return OpenWindow('NEW_WINDOW','" + strDeliverable + "');");
         }
     }
     btnCancel1.Attributes.Add("onclick", "return confirm('Are you sure you want to cancel this service request?');");
 }
Exemple #19
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Services oService = new Services(intProfile, dsn);
            Requests oRequest = new Requests(intProfile, dsn);

            if (Int32.TryParse(Request.Cookies["profileid"].Value, out intProfile) == true)
            {
                int intService = 0;
                if (Int32.TryParse(Request.Cookies["sid"].Value, out intService) == true)
                {
                    int intProject = 0;
                    Int32.TryParse(Request.Cookies["pid"].Value, out intProject);

                    int intRequest = 0;
                    Int32.TryParse(Request.Cookies["rid"].Value, out intRequest);

                    int intNewRequest = 0;
                    if (intRequest == 0)
                    {
                        if (oService.Get(intService, "project") == "1" && intProject == 0)
                        {
                            Response.Write("Service " + oService.GetName(intService).ToUpper() + " requires a project. Please specify a projectid (pid=) or a requestid (rid=)");
                        }
                        else
                        {
                            intNewRequest = oRequest.Add((intProject == 0 ? -1 : intProject), intProfile);
                        }
                    }
                    else
                    {
                        DataSet dsR = oRequest.Get(intRequest);
                        if (dsR.Tables[0].Rows.Count > 0)
                        {
                            intProject    = Int32.Parse(dsR.Tables[0].Rows[0]["projectid"].ToString());
                            intNewRequest = oRequest.Add(intProject, intProfile);
                        }
                    }

                    if (intNewRequest > 0)
                    {
                        string          strQ            = Request.QueryString["q"];
                        ServiceRequests oServiceRequest = new ServiceRequests(intProfile, dsn);
                        RequestItems    oRequestItem    = new RequestItems(intProfile, dsn);
                        Pages           oPage           = new Pages(intProfile, dsn);
                        oServiceRequest.Add(intNewRequest, 1, 0);
                        oService.AddSelected(intNewRequest, intService, 1);
                        int intItem = oService.GetItemId(intService);
                        oRequestItem.AddForm(intNewRequest, intItem, intService, 1);
                        Response.Redirect(oPage.GetFullLink(intResourceRequest) + "?rid=" + intNewRequest.ToString() + "&q=" + strQ);
                    }
                }
            }
            else
            {
                Response.Redirect("/redirect.aspx?referrer=" + Request.Url.PathAndQuery);
            }
        }
Exemple #20
0
 public ActionResult Edit([Bind(Include = "Id,Name,Location,TypeOfService,Details,Urgency,DateSubmitted,ContractorUsed,FollowUpNeeded,Completed,DateCompleted")] ServiceRequests serviceRequests)
 {
     if (ModelState.IsValid)
     {
         db.Entry(serviceRequests).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(serviceRequests));
 }
Exemple #21
0
 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?');");
 }
Exemple #22
0
        protected void Page_Load(object sender, EventArgs e)
        {
            intProfile        = Int32.Parse(Request.Cookies["profileid"].Value);
            oPlatform         = new Platforms(intProfile, dsn);
            oType             = new Types(intProfile, dsn);
            oModelsProperties = new ModelsProperties(intProfile, dsn);
            oServiceRequest   = new ServiceRequests(intProfile, dsn);
            oForecast         = new Forecast(intProfile, dsn);
            oPage             = new Pages(intProfile, dsn);
            oClass            = new Classes(intProfile, dsn);
            oAsset            = new Asset(intProfile, dsnAsset);
            if (Request.QueryString["applicationid"] != null && Request.QueryString["applicationid"] != "")
            {
                intApplication = Int32.Parse(Request.QueryString["applicationid"]);
            }
            if (Request.QueryString["pageid"] != null && Request.QueryString["pageid"] != "")
            {
                intPage = Int32.Parse(Request.QueryString["pageid"]);
            }
            if (Request.Cookies["application"] != null && Request.Cookies["application"].Value != "")
            {
                intApplication = Int32.Parse(Request.Cookies["application"].Value);
            }
            int intPlatform = 0;

            if (Request.QueryString["id"] != null && Request.QueryString["id"] != "")
            {
                intPlatform = Int32.Parse(Request.QueryString["id"]);
            }
            if (intPlatform > 0)
            {
                intMax = Int32.Parse(oPlatform.Get(intPlatform, "max_inventory1"));
                if (!IsPostBack)
                {
                    LoadLists();
                    LoadFilters();
                    LoadGroups(intPlatform);
                }
                btnProjects.Attributes.Add("onclick", "return MakeWider(this, '" + lstProjects.ClientID + "');");
                btnProjectsClear.Attributes.Add("onclick", "return ClearList('" + lstProjects.ClientID + "');");
                btnClasses.Attributes.Add("onclick", "return MakeWider(this, '" + lstClasses.ClientID + "');");
                btnClassesClear.Attributes.Add("onclick", "return ClearList('" + lstClasses.ClientID + "');");
                btnConfidences.Attributes.Add("onclick", "return MakeWider(this, '" + lstConfidences.ClientID + "');");
                btnConfidencesClear.Attributes.Add("onclick", "return ClearList('" + lstConfidences.ClientID + "');");
                btnEnvironments.Attributes.Add("onclick", "return MakeWider(this, '" + lstEnvironments.ClientID + "');");
                btnEnvironmentsClear.Attributes.Add("onclick", "return ClearList('" + lstEnvironments.ClientID + "');");
                btnLocations.Attributes.Add("onclick", "return MakeWider(this, '" + lstLocations.ClientID + "');");
                btnLocationsClear.Attributes.Add("onclick", "return ClearList('" + lstLocations.ClientID + "');");
                lstClasses.Attributes.Add("onchange", "PopulateEnvironmentsList('" + lstClasses.ClientID + "','" + lstEnvironments.ClientID + "',0);");
                lstEnvironments.Attributes.Add("onchange", "UpdateListHidden('" + lstEnvironments.ClientID + "','" + hdnEnvironment.ClientID + "');");
                imgStart.Attributes.Add("onclick", "return ShowCalendar('" + txtStart.ClientID + "');");
                imgEnd.Attributes.Add("onclick", "return ShowCalendar('" + txtEnd.ClientID + "');");
            }
        }
Exemple #23
0
        public async Task <IActionResult> PostAsync([FromBody] ServiceRequests serviceRequest)
        {
            var result = await _homeService.SaveAsync(serviceRequest);

            if (!result.Success)
            {
                return(BadRequest(result.Message));
            }

            return(Ok(result.ServiceRequests));
        }
        public ServiceRequests DeleteServiceRequest(int requestId)
        {
            ServiceRequests dbentry = context.ServiceRequests.Find(requestId);

            if (dbentry != null)
            {
                context.ServiceRequests.Remove(dbentry);
                context.SaveChanges();
            }
            return(dbentry);
        }
Exemple #25
0
        private void AddResult(string strResult, string strError, int intAuditIDError)
        {
            if (strError == "")
            {
                if (boolMIS == false)
                {
                    //oServer.NextStep(intServer);
                    //oOnDemand.UpdateStepDoneServer(intServer, intStep, strResult, 0, false, false);

                    // Update to prevent it being kicked off again
                    oServer.UpdateStep(intServer, intStep + 1);
                    // Set the done status
                    oOnDemand.UpdateStepDoneServer(intServer, intStep, strResult, 0, false, false);
                    // Go back to current step
                    oServer.UpdateStep(intServer, intStep);
                    // Push through to next step
                    oServer.NextStep(intServer);
                    intStep++;
                }
                else
                {
                    oServer.UpdateMISAudits(intServer, DateTime.Now.ToString());
                }
            }
            else
            {
                oLog.AddEvent(strName, strSerial, strError, LoggingType.Error);
                if (boolMIS == false)
                {
                    oOnDemand.UpdateStepDoneServer(intServer, intStep, strError, 1, false, false);
                }
                else
                {
                    oServer.UpdateMISAudits(intServer, DateTime.Now.ToString());
                }

                // Generic Error Request
                Services        oService                   = new Services(0, dsn);
                ResourceRequest oResourceRequest           = new ResourceRequest(0, dsn);
                ServiceRequests oServiceRequest            = new ServiceRequests(0, dsn);
                int             intServerAuditErrorService = intService;
                int             intServerAuditErrorItem    = oService.GetItemId(intServerAuditErrorService);
                int             intServerAuditErrorNumber  = oResourceRequest.GetNumber(intRequest, intServerAuditErrorItem);
                oAudit.AddError(intRequest, intServerAuditErrorService, intServerAuditErrorNumber, intAuditIDError, intStep, boolMIS);
                int intError            = oServer.AddError(intRequest, intServerAuditErrorItem, intServerAuditErrorNumber, intServer, intStep, strError);
                int intServerAuditError = oResourceRequest.Add(intRequest, intServerAuditErrorItem, intServerAuditErrorService, intServerAuditErrorNumber, "Server Audit Exception (" + strName + ")", 1, 0.00, 2, 1, 1, 1);
                if (oServiceRequest.NotifyApproval(intServerAuditError, intResourceRequestApprove, intEnvironment, "", dsnServiceEditor) == false)
                {
                    oServiceRequest.NotifyTeamLead(intServerAuditErrorItem, intServerAuditError, intAssignPage, intViewPage, intEnvironment, "", dsnServiceEditor, dsnAsset, dsnIP, 0);
                }
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            AuthenticateUser();

            oUser           = new Users(intProfile, dsn);
            oWMServiceTasks = new WMServiceTasks(intProfile, dsn);
            oRequest        = new Requests(intProfile, dsn);
            oService        = new Services(intProfile, dsn);
            oServiceRequest = new ServiceRequests(intProfile, dsn);
            oServiceDetail  = new ServiceDetails(intProfile, dsn);
            oFunction       = new Functions(intProfile, dsn, intEnvironment);
            oDataPoint      = new DataPoint(intProfile, dsn);

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

            if (
                (Request.QueryString["requestid"] != null && Request.QueryString["requestid"] != "") &&
                (Request.QueryString["serviceid"] != null && Request.QueryString["serviceid"] != "") &&
                (Request.QueryString["itemid"] != null && Request.QueryString["itemid"] != "") &&
                (Request.QueryString["number"] != null && Request.QueryString["number"] != "") &&
                (Request.QueryString["assetid"] != null && Request.QueryString["assetid"] != ""))
            {
                hdnRequestId.Value = oFunction.decryptQueryString(Request.QueryString["requestid"]);
                hdnServiceId.Value = oFunction.decryptQueryString(Request.QueryString["serviceid"]);
                hdnItemId.Value    = oFunction.decryptQueryString(Request.QueryString["itemid"]);
                hdnNumber.Value    = oFunction.decryptQueryString(Request.QueryString["number"]);
                hdnAssetId.Value   = oFunction.decryptQueryString(Request.QueryString["assetid"]);

                if (!IsPostBack)
                {
                    LoadWMServiceTasks();
                }
                btnSave.Attributes.Add("onclick", "return ProcessControlButton();");
                btnSaveAndClose.Attributes.Add("onclick", "return ProcessControlButton();");
            }
            else
            {
                pnlAllow.Visible  = false;
                pnlDenied.Visible = true;
            }
        }
Exemple #27
0
 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();
         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 + "');");
         }
         btnDocuments.Attributes.Add("onclick", "return OpenWindow('DOCUMENTS_SECURE','?rid=" + Request.QueryString["rid"] + "');");
         btnNext.Attributes.Add("onclick", "return ValidateText('" + txtTitle.ClientID + "','Please enter a title')" +
                                " && ValidateText('" + txtStatement.ClientID + "','Please enter a statement of work')" +
                                " && ValidateDate('" + txtStart.ClientID + "','Please enter a valid estimated start date')" +
                                " && ValidateDate('" + txtEnd.ClientID + "','Please enter a valid estimated end date')" +
                                " && ValidateDates('" + txtStart.ClientID + "','" + txtEnd.ClientID + "','The estimated start date must occur before the estimated end date')" +
                                ";");
     }
     btnCancel1.Attributes.Add("onclick", "return confirm('Are you sure you want to delete this service request?');");
 }
Exemple #28
0
        //public List<Trade> RequestedTrades(string publicKey, string secretKey, TradeConfiguration configuration)
        //{
        //    var trades = TradesRequest(publicKey, secretKey, $"{configuration.MainCoin}{configuration.AltCoin}");
        //    if (trades != null)
        //    {
        //        foreach (var trade in trades)
        //        {
        //            tradeRepository.Create(new DataBaseWork.Models.Trade()
        //            {
        //                FK_PublicKey = publicKey,
        //                Symbol = trade.symbol,
        //                TradeID = trade.id,
        //                OrderID = trade.orderId,
        //                OrderListID = trade.orderListId,
        //                Price = trade.price,
        //                Qty = trade.qty,
        //                QuoteQty = trade.quoteQty,
        //                Commission = trade.commission,
        //                CommissionAsset = trade.commissionAsset,
        //                Time = trade.time,
        //                IsBuyer = trade.isBuyer,
        //                IsMaker = trade.isMaker,
        //                IsBestMatch = trade.isBestMatch
        //            });
        //        }
        //    }
        //    return trades;
        //}

        private List <Trade> TradesRequest(string key, string secret, string pair, long fromId)
        {
            logService.Write("***********TradesRequest START***********", true);
            logService.Write($"\tTradesRequest Public key: {key}");
            logService.Write($"\tTradesRequest pair: {pair}");
            List <Trade> result     = null;
            var          privateApi = new SecretKeyRequiredRequester();
            var          my_reg     = new Regex(@"\D");
            var          serverTime = "";
            var          response   = "";

            try
            {
                serverTime = my_reg.Replace(ServiceRequests.ServerTime(), "");
                logService.Write($"\tTradesRequest get serverTime successful: {serverTime}");
            }
            catch (Exception ex)
            {
                logService.Write($"\tAccount get serverTime error: Exception: {ex.Message} Innerexception: {ex.InnerException?.Message}");
            }
            try
            {
                var request = CreatRequest(pair, serverTime, out string requestParams, fromId);
                response = privateApi.GetWebRequest(request, requestParams, key, secret, "GET");
                logService.Write($"\tTradesRequest {Resources.DOMAIN_V3}myTrades... successful: response = {response}");
            }
            catch (Exception ex)
            {
                logService.Write($"\tTradesRequest {Resources.DOMAIN_V3}myTrades... error: Exception: {ex.Message} Innerexception: {ex.InnerException?.Message}");
            }

            try
            {
                result = JConverter.JsonConver <List <Trade> >(response);
                logService.Write($"\tTradesRequest JConverter successful.");
            }
            catch (Exception ex)
            {
                logService.Write($"\tTradesRequest JConverter error: Exception: {ex.Message} Innerexception: {ex.InnerException?.Message}");
            }

            if (result != null)
            {
                var tradeForRemove = result.FirstOrDefault(x => x.id == fromId);
                if (tradeForRemove != null)
                {
                    result.Remove(tradeForRemove);
                }
            }
            logService.Write("***********TradesRequest END***********", true);
            return(result);
        }
        public async Task <SaveServiceRequestsResponse> SaveAsync(ServiceRequests serviceRequests)
        {
            try
            {
                await _homeServiceRepository.AddAsync(serviceRequests);

                return(new SaveServiceRequestsResponse(serviceRequests));
            }
            catch (Exception ex)
            {
                return(new SaveServiceRequestsResponse($"An error occured whil saving service request: {ex.Message}"));
            }
        }
        public bool CloseProviderRequest(int id)
        {
            try
            {
                ServiceRequests _serviceRequests = new ServiceRequests();
                _serviceRequests.CloseProviderRequest(id);
                //// send notification to the first provider

                //var request = _serviceRequests.GetRequest(id);
                //var client = _serviceRequests.GetRequest(id).Client;
                //Dictionary<string, string> keysValues = new Dictionary<string, string>
                //{
                //    {"name", client.FullName},
                //    {"no", id.ToString()},
                //    {"duration", request.CurrentDuration.ToString()},
                //    {"ServiceName", request.Service.LocalizedServices.First(l => l.LanguageId == 3073).Title}
                //};

                //string replyToAddress = WebConfigurationManager.AppSettings["ContactUsEmail"];
                //string adminEmail = WebConfigurationManager.AppSettings["AdminEmail"];
                //string siteMasterEmail = WebConfigurationManager.AppSettings["SiteMasterEmail"];
                //try
                //{
                //    //Servston.MailManager.SendMail("client/request-finished.html", keysValues,
                //    //    "تم الاستجابة على طلبكم ببوابة خدماتكم",
                //    //   UserManger.GetEmail(client.UserId.Value), adminEmail, replyToAddress, new List<string>() { siteMasterEmail });
                //    if (!string.IsNullOrEmpty(request.Client.MobielNumber) &&
                //        request.Client.MobielNumber.Length > 10)
                //    {
                //        string sms =
                //            string.Format(
                //                "عميلنا العزيز نفيدكم انه تم الإنتهاء من تنفيذ طلبكم رقم {0} شكرا لكم لإستخدامكم خدمات كوم.",
                //                request.Service.LocalizedServices.First(l => l.LanguageId == 3073).Title);

                //        Servston.SMS smsManager = new Servston.SMS();
                //       // smsManager.Send(request.Client.MobielNumber, sms);
                //    }

                //}
                //catch (Exception ex)
                //{
                //}

                return(true);
            }
            catch (Exception ex)
            {
                // todo:log the exception
                return(false);
            }
        }