예제 #1
0
 public void OnOutgoingCall(object sender, Requests.Request request)
 {
     if (request.GetType() == typeof(Requests.OutgoingRequest) && this.State == PortState.connected)
     {
         this.State = PortState.calling;
     }
 }
 /// <summary>
 /// event handlers
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="request"></param>
 public void OnOutgoingRequest(object sender, Requests.Request request)
 {
     if (request.GetType() == typeof(Requests.OutgoingCallRequest))
     {
         RegisterOutgoingRequest(request as Requests.OutgoingCallRequest);
     }
 }
예제 #3
0
        public static new ResponseBase BuildFrom(Requests.RequestBase request, params object[] obj)
        {
            Authentication auth = new Authentication();
            if (obj.Length == 3)
            {
                if (obj[0].GetType() != typeof(bool))
                    throw new ArgumentException("Argument obj[0] must be of type bool.");
                if (obj[1].GetType() != typeof(Guid))
                    throw new ArgumentException("Argument obj[1] must be of type Guid.");
                if (obj[2].GetType() != typeof(DateTime))
                    throw new ArgumentException("Argument obj[2] must be of type DateTime.");

                auth.Success = (bool)obj[0];
                auth.AuthToken = (Guid)obj[1];
                auth.Expiry = (DateTime)obj[2];
            }
            else if (obj.Length == 1)
            {
                if (obj[0].GetType() != typeof(bool))
                    throw new ArgumentException("Argument obj[0] must be of type bool.");

                auth.Success = (bool)obj[0];
            }
            else
                throw new ArgumentException("Argument obj is expected to have either 1 or 3 elements.");

            return auth;
        }
예제 #4
0
        public virtual ActionResult Delete(Requests.Users.Delete request)
        {
            var logger = ObjectFactory.GetInstance<Logger>();
            logger.Info("[Controllers].[UsersController].[Delete] invoked.");

            var validator = new Validators.Users.Delete(request);
            logger.Trace("[Controllers].[UsersController].[Delete] [validator].[IsValid] = '{0}'.", validator.IsValid);

            Responses.Response response;
            if (!validator.IsValid)
            {
                logger.Debug("[Controllers].[UsersController].[Delete] mapping [validator] to [response].");
                response = Mapper.Map<Validators.IValidator, Responses.Validation>(validator);
                logger.Info("[Controllers].[UsersController].[Delete] returned validation errors.");
            }
            else
            {
                var user = new User { Id = validator.Result.Id };
                logger.Debug("[Controllers].[UsersController].[Delete] deleting [user].");
                using (var connection = ObjectFactory.GetInstance<DatabaseConnections>().SmsToMail)
                {
                    connection.Delete(user);
                }

                response = new Responses.Users.Delete();
                logger.Info("[Controllers].[UsersController].[Delete] successfully deleted user.");
                logger.Info("[Controllers].[UsersController].[Delete] [user].[Id] == '{0}'.", user.Id);
            }

            logger.Trace("[Controllers].[UsersController].[Delete] finished work.");
            return Json(response);
        }
예제 #5
0
 public void OnOutgoingCall(object sender, Requests.Request request)
 {
     if (request.GetType() == typeof(Requests.OutgoingCallRequest) && this.State==PortState.Free )
     {
         this.State = PortState.Busy;
     }
 }
예제 #6
0
 public Responses.PmsSummary.GetPmsSummaryResponse GetPmsSummary(Requests.PmsSummary.GetPmsSummaryRequest request)
 {
     var pmsSummaries = new List<PmsSummary>();
     var yearNow = DateTime.Now.Year;
     pmsSummaries = DataContext.PmsSummaries.Where(x => x.Title == yearNow.ToString()).ToList();
     var response = new GetPmsSummaryResponse();
     response.PmsSummaries = pmsSummaries.MapTo<GetPmsSummaryResponse.PmsSummary>();
     return response;
 }
예제 #7
0
 public BaseResponse BatchUpdateFilePrivilege(Requests.FileManagerRolePrivilege.BatchUpdateFilePrivilegeRequest request)
 {
     var response = new BaseResponse();
     try
     {
         int addCounter = 0;
         int updatedCounter = 0;
         foreach (var item in request.BatchUpdateFilePrivilege)
         {
             if (item.ProcessBlueprint_Id > 0 && item.RoleGroup_Id > 0)
             {
                 var toUpdate = DataContext.FileManagerRolePrivileges.Find(item.ProcessBlueprint_Id, item.RoleGroup_Id);
                 if (toUpdate != null)
                 {
                     // put update code here
                     toUpdate.AllowBrowse = item.AllowBrowse;
                     toUpdate.AllowCopy = item.AllowCopy;
                     toUpdate.AllowCreate = item.AllowCreate;
                     toUpdate.AllowDelete = item.AllowDelete;
                     toUpdate.AllowDownload = item.AllowDownload;
                     toUpdate.AllowMove = item.AllowMove;
                     toUpdate.AllowRename = item.AllowRename;
                     toUpdate.AllowUpload = item.AllowUpload;
                     DataContext.Entry(toUpdate).State = EntityState.Modified;
                     updatedCounter++;
                 }
                 else
                 {
                     //put insert code here
                     var privilege = item.MapTo<FileManagerRolePrivilege>();
                     DataContext.FileManagerRolePrivileges.Add(privilege);
                     addCounter++;
                 }
             }
         }
         DataContext.SaveChanges();
         response.IsSuccess = true;
         response.Message = string.Format("{0} data has been added, {1} data has been updated", addCounter.ToString()
            , updatedCounter.ToString());
     }
     catch (InvalidOperationException inval)
     {
         response.Message = inval.Message;
     }
     catch (ArgumentNullException arg)
     {
         response.Message = arg.Message;
     }
     return response;
 }
        public ActionResult Index(FormCollection form)
        {
            using (var db = new MyDataContainer())
            {
                var obj = new Requests
                {
                    Date = DateTime.Now.Date,
                    RequestBody = form["RequestArea"],
                    Room = Convert.ToInt32(Session["Room"])
                };
                db.Requests.Add(obj);
                db.SaveChanges();
            }

            return RedirectToAction("MakeRequest");
        }
예제 #9
0
        public virtual ActionResult Create(Requests.Users.Create request)
        {
            var logger = ObjectFactory.GetInstance<Logger>();
            logger.Info("[Controllers].[UsersController].[Create] invoked.");

            var validator = new Validators.Users.Create(request);
            logger.Trace("[Controllers].[UsersController].[Create] [validator].[IsValid] = '{0}'.", validator.IsValid);

            Responses.Response response;
            if (!validator.IsValid)
            {
                logger.Debug("[Controllers].[UsersController].[Create] mapping [validator] to [response].");
                response = Mapper.Map<Validators.IValidator, Responses.Validation>(validator);
                logger.Info("[Controllers].[UsersController].[Create] returned validation errors.");
            }
            else
            {
                var session = ObjectFactory.GetInstance<SmsToMail.Session.UserSession>();

                logger.Debug("[Controllers].[UsersController].[Create] mapping [validator] to [user].");
                var user = Mapper.Map<DTO.Users.Create, Entities.User>(validator.Result);
                user.TenantId = session.Account.TenantId;

                int id;
                logger.Debug("[Controllers].[UsersController].[Create] inserting [user].");
                using (var connection = ObjectFactory.GetInstance<DatabaseConnections>().SmsToMail)
                {
                    id = connection.Insert(user);
                }

                response = new Responses.Users.Create { Id = id.ToDefaultString() };
                logger.Info("[Controllers].[UsersController].[Create] successfully created user.");
                logger.Info("[Controllers].[UsersController].[Create] [id] == '{0}'.", id);
            }

            logger.Trace("[Controllers].[UsersController].[Create] finished work.");
            return Json(response);
        }
예제 #10
0
        public void StartMainProcess()
        {
            IdleProcessor.Paused = true;
            DataAccess.CheckAndCopyDatabaseFile();
            _scanAndUploadThread = new Thread((ThreadStart) delegate
            {
                try
                {
                    LoadDb().Wait();

                    while (InstallingEdge)
                    {
                        ThreadHelper.SafeSleep(200);
                    }

                    if (Aborting)
                    {
                        SetStatusMessage("Idle", "Idle");
                        return;
                    }

                    FileScanner.Process();
                    while (!ConnectedToYTMusic)
                    {
                        if (Aborting)
                        {
                            SetStatusMessage("Idle", "Idle");
                            return;
                        }

                        ThreadHelper.SafeSleep(1000);
                    }

                    while (!NetworkHelper.InternetConnectionIsUp())
                    {
                        SetStatusMessage("No internet connection", "No internet connection");
                        ThreadHelper.SafeSleep(5000);
                    }

                    while (!Requests.IsAuthenticated(Settings.AuthenticationCookie))
                    {
                        try
                        {
                            SetConnectedToYouTubeMusic(false);
                            ThreadHelper.SafeSleep(1000);
                            Settings = SettingsRepo.Load().Result;
                        }
                        catch { }
                    }

                    SetConnectedToYouTubeMusic(true);
                    SetStatusMessage("Uploading", "Uploading");
                    RepopulateAmountLables();
                    FileUploader.Process().Wait();
                    SetStatusMessage("Idle", "Idle");
                    SetUploadingMessage("Idle", "Idle", null, true);
                    RepopulateAmountLables(true);
                }
                catch (Exception e)
                {
                    string _ = e.Message;
#if DEBUG
                    Console.Out.WriteLine("Main Process Thread Error: " + e.Message);
#endif
                }

                IdleProcessor.Paused = false;
            })
            {
                IsBackground = true
            };
            _scanAndUploadThread.Start();
        }
예제 #11
0
파일: RecordLog.cs 프로젝트: zedr0n/ZES
 /// <inheritdoc />
 public void Sort()
 {
     Requests.Sort((a, b) => a.Timestamp > b.Timestamp ? 1 : -1);
 }
예제 #12
0
        /// <summary>
        /// Gets the last request in the list of requests
        /// </summary>
        /// <returns>The last request, null if there were no requests</returns>
        private BatchRequest GetLastRequest()
        {
            var last = Requests.LastOrDefault();

            return(last.Value ?? null);
        }
예제 #13
0
 protected virtual void OnIncomingRequest(object sender, Requests.IncomingCallRequest request)
 {
     if (IncomingRequest != null)
     {
         IncomingRequest(sender, request);
     }
     ServerIncomingRequest = request;
 }
 void handleError(string error, Requests pathID)
 {
     Debug.Log("Error  : " + error + " En request "+ pathID.ToString());
     if(delegates[(int)pathID] != null)
         delegates[(int)pathID](pathID, error, null);
 }
        public List<RPRequest> GetAllRequests(DateRange dateRange)
        {
            List<RPRequest> output = new List<RPRequest>();

            using (Requests rqs = new Requests(os))
            {
                try
                {

                    foreach (Request req in rqs.AllActive)
                    {
                        //if (req is OneTimeRequest) continue;
                        //if (req is ManualRequest) continue;
                        //if (req.Complete) continue;  // no longer active
                        if (req.Recordings == null) continue;
                        if (!req.IsLatestVersion) continue;

                        //if (!((req.StartTime > dateRange.StartTime) && (req.StartTime < dateRange.StopTime))) continue;

                        RPRequest newRequest = Conversion.RPRequestFromRequest(req);
                        output.Add(newRequest);
                    }

                    return output;
                }
                catch (Exception ex)
                {
                    DebugNormal("Couldn't get recordings: " + ex.Message);
                    return output;
                }
            }
            /*
            try
            {
                RequestedPrograms rqPrograms = sch.RequestedPrograms;
                if (rqPrograms == null) return output;

                HashSet<Request> uniqueRequests = new HashSet<Request>();
                StoredObjectsEnumerator<RequestedProgram> enmRqProg = (StoredObjectsEnumerator<RequestedProgram>)rqPrograms.GetStoredObjectsEnumerator();
                while (enmRqProg.MoveNext())
                {
                    RequestedProgram rqProg = enmRqProg.Current;

                    if (!rqProg.IsActive) continue;  // Don't proceed for old (deleted) shows

                    Request rq = rqProg.Request;
                    // Don't include old (deleted) requests

                    uniqueRequests.Add(rq);  // only adds if unique
                }

                // Go through reqests and convert each one
                foreach (Request r in uniqueRequests)
                {
                    RPRequest newRequest = Conversion.RPRequestFromRequest(r);
                    output.Add(newRequest);
                }

                return output;
            }
            catch (Exception ex)
            {
                DebugNormal("Couldn't get recordings: " + ex.Message);
                return output;
            }
            */
        }
예제 #16
0
        protected void RegisterOutgoingRequest(Requests.OutgoingCallRequest request)
        {
            if ((request.Source!=default(PhoneNumber) && request.Target!=default(PhoneNumber))&&
                (GetCallInfo(request.Source) == null && GetConnectionInfo(request.Source) == null))
            {
                var callInfo = new CallInfo()
                {
                    Source = request.Source,
                    Target = request.Target,
                    Started = DateTime.Now
                };

                ITerminal targetTerminal = GetTerminalByPhoneNumber(request.Target);
                IPort targetPort = GetPortByPhoneNumber(request.Target);

                if (targetPort.State == PortState.Free)
                {
                    _connectionCollection.Add(callInfo);
                    targetPort.State = PortState.Busy;
                    targetTerminal.IncomingRequestFrom(request.Source);
                }
                else
                {
                    OnCallInfoPrepared(this, callInfo);
                }
            }
        }
예제 #17
0
 public static new ResponseBase BuildFrom(Requests.RequestBase request)
 {
     Responses.Pong pong = new Responses.Pong();
     return pong;
 }
        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);

            // For server Workstation Errors
            oServer      = new Servers(intProfile, dsn);
            oWorkstation = new Workstations(intProfile, dsn);
            oZeus        = new Zeus(intProfile, dsnZeus);
            oAsset       = new Asset(0, dsnAsset);
            oOnDemand    = new OnDemand(intProfile, dsn);
            oError       = new Errors(intProfile, dsn);
            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());
                // 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);

                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["status"] != null && Request.QueryString["status"] != "")
                {
                    Page.ClientScript.RegisterClientScriptBlock(typeof(Page), "statusd", "<script type=\"text/javascript\">alert('Status Updates has been Added');<" + "/" + "script>");
                }
                if (!IsPostBack)
                {
                    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 confirm('Are you sure you want to mark this as completed and remove it from your workload?');");
                        }
                        else
                        {
                            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 (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;

                    intProject          = oRequest.GetProjectNumber(intRequest);
                    hdnTab.Value        = "D";
                    panWorkload.Visible = true;
                    bool boolRed = LoadStatus(intResourceWorkflow);
                    if (boolRed == false && boolSLABreached == true)
                    {
                        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;");
                    }

                    LoadLists();
                    LoadInformation(intResourceWorkflow);
                    chkDescription.Checked = (Request.QueryString["doc"] != null);

                    //Change Control and Documents
                    LoadChange(intResourceWorkflow);
                    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 + "');");
                    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')" +
                                             ";");
                    imgDate.Attributes.Add("onclick", "return ShowCalendar('" + txtDate.ClientID + "');");
                    // 6/1/2009 - Load ReadOnly View
                    if ((oResourceRequest.CanUpdate(intProfile, intResourceWorkflow, false) == false) || boolComplete == true)
                    {
                        oFunction.ConfigureToolButtonRO(btnSave, btnComplete);
                        pnlSolutions.Visible   = false;
                        btnNoSolution.Enabled  = false;
                        btnNewSolution.Enabled = false;
                    }


                    btnReturn.Visible   = false;
                    btnComplete.Visible = false;
                }
            }
            else
            {
                panDenied.Visible = true;
            }
            txtIncidentUser.Attributes.Add("onkeyup", "return AJAXTextBoxGet(this,'300','195','" + divIncidentUser.ClientID + "','" + lstIncidentUser.ClientID + "','" + hdnIncidentUser.ClientID + "','" + oVariable.URL() + "/frame/users.aspx',2);");
            lstIncidentUser.Attributes.Add("ondblclick", "AJAXClickRow();");
        }
예제 #19
0
        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);
            oRequestField    = new RequestFields(intProfile, dsn);
            oApplication     = new Applications(intProfile, dsn);
            oDocument        = new Documents(intProfile, dsn);
            oDelegate        = new Delegates(intProfile, dsn);
            oVariables       = 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());
                // Start Workflow Change
                bool   boolComplete = (oResourceRequest.GetWorkflow(intResourceWorkflow, "status") == "3");
                int    intUser      = Int32.Parse(oResourceRequest.GetWorkflow(intResourceWorkflow, "userid"));
                double dblAllocated = double.Parse(oResourceRequest.GetWorkflow(intResourceWorkflow, "allocated"));
                // End Workflow Change
                int intService = Int32.Parse(ds.Tables[0].Rows[0]["serviceid"].ToString());
                int intApp     = oRequestItem.GetItemApplication(intItem);

                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["status"] != null && Request.QueryString["status"] != "")
                {
                    Page.ClientScript.RegisterClientScriptBlock(typeof(Page), "statusd", "<script type=\"text/javascript\">alert('Status Updates has been Added');<" + "/" + "script>");
                }
                double dblUsed = oResourceRequest.GetWorkflowUsed(intResourceWorkflow);
                lblUpdated.Text = oResourceRequest.GetUpdated(intResourceWorkflow);
                if (dblAllocated == dblUsed)
                {
                    if (boolComplete == false)
                    {
                        oFunction.ConfigureToolButton(btnComplete, "/images/tool_complete");
                        btnComplete.Attributes.Add("onclick", "return confirm('Are you sure you want to mark this as completed and remove it from your workload?');");
                    }
                    else
                    {
                        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;
                }
                if (oService.Get(intService, "sla") != "")
                {
                    oFunction.ConfigureToolButton(btnSLA, "/images/tool_sla");
                    int intDays = oResourceRequest.GetSLA(intResourceParent);
                    if (intDays < 1)
                    {
                        btnSLA.Style["border"] = "solid 2px #FF0000";
                    }
                    else if (intDays < 3)
                    {
                        btnSLA.Style["border"] = "solid 2px #FF9999";
                    }
                    btnSLA.Attributes.Add("onclick", "return OpenWindow('RESOURCE_REQUEST_SLA','?rrid=" + intResourceParent.ToString() + "');");
                }
                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=TASK');");
                dblUsed = (dblUsed / dblAllocated) * 100;
                sldHours._StartPercent = dblUsed.ToString();
                sldHours._TotalHours   = dblAllocated.ToString();
                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["status"] != null && Request.QueryString["status"] != "")
                {
                    Page.ClientScript.RegisterClientScriptBlock(typeof(Page), "statusd", "<script type=\"text/javascript\">alert('Status Updates has been Added');<" + "/" + "script>");
                }
                intProject = oRequest.GetProjectNumber(intRequest);
                if (intProject == 0)
                {
                    // Documents
                    btnDocuments.Attributes.Add("onclick", "return OpenWindow('DOCUMENTS_SECURE','?rid=" + intRequest.ToString() + "');");
                    chkMyDescription.Checked = (Request.QueryString["mydoc"] != null);
                    if (intProject > 0)
                    {
                        lblMyDocuments.Text = oDocument.GetDocuments_Mine(intProject, intProfile, oVariables.DocumentsFolder(), -1, (Request.QueryString["mydoc"] != null));
                    }
                    else
                    {
                        lblMyDocuments.Text = oDocument.GetDocuments_Request(intRequest, intProfile, oVariables.DocumentsFolder(), -1, (Request.QueryString["mydoc"] != null));
                    }
                    // GetDocuments(string _physical, int _projectid, int _requestid, int _userid, int _security, bool _show_description, bool _mine)
                    //lblMyDocuments.Text = oDocument.GetDocuments(Request.PhysicalApplicationPath, intProject, intRequest, intProfile, -1, (Request.QueryString["mydoc"] != null), true);
                    panWorkload.Visible = true;
                    LoadStatus(intResourceWorkflow);
                    LoadChange(intResourceWorkflow);
                    LoadInformation(intResourceWorkflow);

                    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 + "');");
                    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')" +
                                             ";");
                    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;
                    }
                }
                else
                {
                    panDenied.Visible = true;
                }
            }
            else
            {
                panDenied.Visible = true;
            }
        }
 public IResponse <ExchangeOperationResult> PostManualCashIn(ManualCashInRequestModel cashIn)
 {
     return(Requests.For(serviseUrl).Post("/ExchangeOperations/ManualCashIn")
            .AddJsonBody(cashIn).Build().Execute <ExchangeOperationResult>());
 }
예제 #21
0
파일: PWP.aspx.cs 프로젝트: kavallo/E-Menu
    public void AddRequestList_ToBasket(List<Requests> reqList, string fbCode)
    {
        eMenuTools tools = new eMenuTools();
        Order order = mSession.Basket.FirstOrDefault(i => i.fbCode == fbCode);
        var fb = dc.Tblfoodbeverages.First(i => i.Foodbeveragecode == fbCode);

        //If item includes 'Request' and request didn't choose for order
        if (reqList.Count == 0
            && (dc.Tblfoodbeveragerequestrules.Where(z => z.Foodbeveragecode == fbCode).Count() == 0
            || dc.Tblfoodbeveragerequestrules.Where(z => z.Foodbeveragecode == fbCode && z.Foodbeveragerequestrulescondition == "At Least").Count() > 0))
        {

            Requests requests = new Requests();
            requests.ID = order.Requests.Count > 0 ? order.Requests.Max(z => z.ID) + 1 : 0;

            RequestUnit newR = new RequestUnit();
            newR.fbCode = order.fbCode;
            newR.RCode = -1;
            newR.RDescription = "Normal ";
            newR.Price = 0;
            requests.RequestUnits.Add(newR);

            var q = order.Requests.FirstOrDefault(i => i == requests);

            if (q == null)
            {
                order.Requests.Add(requests);

            }
            else
            {
                order.Requests.FirstOrDefault(i => i == requests).Quantity++;

            }
        }
        if (reqList.Count > 0)
        {

            foreach (var request in reqList)
            {
                var q = order.Requests.FirstOrDefault(i => i == request);

                if (q == null)
                {
                    order.Requests.Add(request);
                }
                else
                {
                    order.Requests.FirstOrDefault(i => i == request).Quantity++;
                }

            }
        }

        //if (mSession.Basket.FirstOrDefault(i => i.fbCode == fbCode) != null)
        //{
        //    mSession.Basket.Add(order);
        //}
        //else
        //{
        mSession.Basket.Remove(mSession.Basket.First(i => i.fbCode == fbCode));
        mSession.Basket.Add(order);
        //}
    }
 public AuthorizationResult authorize( Requests.ResourceRequest resourceRequest)
 {
     return new AuthorizationResult();
 }
예제 #23
0
        private void LoopRepeater(string _sort, int _start)
        {
            DataSet ds        = oForecast.GetsInactive();
            double  dblCount1 = 0;

            DataColumn dc1 = new DataColumn("implementation", System.Type.GetType("System.DateTime"));

            ds.Tables[0].Columns.Add(dc1);
            DataColumn dc2 = new DataColumn("quantity", System.Type.GetType("System.Int32"));

            ds.Tables[0].Columns.Add(dc2);
            DataColumn dc3 = new DataColumn("amp", System.Type.GetType("System.Double"));

            ds.Tables[0].Columns.Add(dc3);
            foreach (DataRow dr in ds.Tables[0].Rows)
            {
                int      intForecast = Int32.Parse(dr["id"].ToString());
                DataSet  dsAnswers   = oForecast.GetAnswers(intForecast);
                DateTime _date       = DateTime.MaxValue;
                foreach (DataRow drAnswer in dsAnswers.Tables[0].Rows)
                {
                    //bool boolOverride = (dr["override"].ToString() == "1");
                    if (drAnswer["implementation"].ToString() != "")
                    {
                        DateTime _commitment = DateTime.Parse(drAnswer["implementation"].ToString());
                        if (_commitment < _date)
                        {
                            _date = _commitment;
                        }
                    }
                    double dblQuantity = double.Parse(drAnswer["quantity"].ToString()) + double.Parse(drAnswer["recovery_number"].ToString());
                    dblCount1 += dblQuantity;
                }
                //dblCount2 += dblCount1;
                dr["implementation"] = _date.ToShortDateString();
                dr["quantity"]       = dblCount1.ToString();
                dblCount1            = 0.00;
            }



            if (_start > ds.Tables[0].Rows.Count)
            {
                _start = 0;
            }
            intRecordStart = _start + 1;
            DataView dv = ds.Tables[0].DefaultView;

            if (Request.QueryString["sort"] != null)
            {
                dv.Sort = Request.QueryString["sort"];
            }
            dv.RowFilter = LoadFilter();
            LoadLists(dv);
            int intCount = _start + intRecords;

            if (dv.Count < intCount)
            {
                intCount = dv.Count;
            }
            int ii = 0;

            lblRecords.Text = "Models " + intRecordStart.ToString() + " - " + intCount.ToString() + " of " + dv.Count.ToString();
            for (ii = 0; ii < _start && ii < intCount; ii++)
            {
                dv[0].Delete();
            }
            int intTotalCount = (dv.Count - intRecords);

            for (ii = 0; ii < intTotalCount; ii++)
            {
                dv[intRecords].Delete();
            }
            rptView.DataSource = dv;
            rptView.DataBind();
            Projects        oProject        = new Projects(intProfile, dsn);
            Requests        oRequest        = new Requests(intProfile, dsn);
            ProjectsPending oProjectPending = new ProjectsPending(intProfile, dsn, intEnvironment);
            Users           oUser           = new Users(intProfile, dsn);
            StatusLevels    oStatusLevel    = new StatusLevels();

            //foreach (RepeaterItem ri in rptView.Items)
            //{
            //    Label lblProject = (Label)ri.FindControl("lblProject");
            //    int intProject = Int32.Parse(lblProject.Text);
            //    Label lblRequest = (Label)ri.FindControl("lblRequest");
            //    int intRequest = Int32.Parse(lblRequest.Text);
            //    if (intProject > 0)
            //    {
            //        ds = oForecast.GetProject(intProject);
            //    }
            //    else
            //    {
            //        ds = oForecast.GetRequest(intRequest);
            //    }
            //    double dblAmp = 0.00;
            //    if (ds.Tables[0].Rows.Count > 0)
            //    {
            //        Label lblCount = (Label)ri.FindControl("lblCount");
            //        Label lblDate = (Label)ri.FindControl("lblDate");
            //        int intForecast = Int32.Parse(ds.Tables[0].Rows[0]["id"].ToString());
            //        Platforms oPlatform = new Platforms(intProfile, dsn);
            //        ModelsProperties oModelsProperties = new ModelsProperties(intProfile, dsn);
            //        ds = oForecast.GetAnswers(intForecast);
            //        DateTime _date = DateTime.MaxValue;
            //        foreach (DataRow dr in ds.Tables[0].Rows)
            //        {
            //            //bool boolOverride = (dr["override"].ToString() == "1");
            //            if (dr["implementation"].ToString() != "")
            //            {
            //                DateTime _commitment = DateTime.Parse(dr["implementation"].ToString());
            //                if (_commitment < _date)
            //                    _date = _commitment;
            //            }
            //        //    // Get AMP
            //        //    int intModel = 0;
            //        //    int intServerModel = oForecast.GetModel(Int32.Parse(dr["id"].ToString()));
            //        //    if (intServerModel == 0)
            //        //    {
            //        //        // Get the model selected in the equipment dropdown (if not server)
            //        //        intModel = Int32.Parse(dr["modelid"].ToString());
            //        //        if (boolOverride == true && intModel > 0)
            //        //        {
            //        //            intServerModel = intModel;
            //        //            intModel = Int32.Parse(oModelsProperties.Get(intModel, "modelid"));
            //        //        }
            //        //    }
            //        //    if (intServerModel > 0)
            //        //        dblAmp += (double.Parse(oModelsProperties.Get(intServerModel, "amp")) * dblQuantity);
            //        //    else if (intModel > 0)
            //        //    {
            //        //        if (oModelsProperties.Get(intModel).Tables[0].Rows.Count > 0)
            //        //        {
            //        //            double dblAmpTemp = (double.Parse(oModelsProperties.Get(intModel, "amp")) * dblQuantity);
            //        //            dblAmp += dblAmpTemp;
            //        //        }
            //        //    }
            //        //    else
            //        //    {
            //        //        DataSet dsVendor = oForecast.GetAnswer(Int32.Parse(dr["id"].ToString()));
            //        //        if (dsVendor.Tables[0].Rows.Count > 0 && dsVendor.Tables[0].Rows[0]["modelname"].ToString() != "")
            //        //            dblAmp += (double.Parse(dsVendor.Tables[0].Rows[0]["amp"].ToString()) * dblQuantity);
            //        //    }
            //        }
            //        lblDate.Text = (_date == DateTime.MaxValue ? "---" : _date.ToShortDateString());
            //        lblCount.Text = dblCount2.ToString();
            //    }
            //    Label lblAmp = (Label)ri.FindControl("lblAmp");
            //    lblAmp.Text = dblAmp.ToString("F");
            //}
            lblNone.Visible = (rptView.Items.Count == 0);
            _start++;
        }
예제 #24
0
        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);
            oStatusLevel     = new StatusLevels(intProfile, dsn);

            oAsset               = new Asset(0, dsnAsset, dsn);
            oAssetOrder          = new AssetOrder(intProfile, dsn, dsnAsset, intEnvironment);
            oAssetSharedEnvOrder = new AssetSharedEnvOrder(intProfile, dsn, dsnAsset, intEnvironment);
            oWMServiceTasks      = new WMServiceTasks(intProfile, dsn);


            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"] != "")
            {
                //Load Attributes
                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["status"] != null && Request.QueryString["status"] != "")
                    {
                        Page.ClientScript.RegisterClientScriptBlock(typeof(Page), "statusd", "<script type=\"text/javascript\">alert('Status Updates Added Successfully');<" + "/" + "script>");
                    }



                    oFunction.ConfigureToolButton(btnEmail, "/images/tool_email");
                    oFunction.ConfigureToolButton(btnPrint, "/images/tool_print");
                    oFunction.ConfigureToolButton(btnClose, "/images/tool_close");
                    oFunction.ConfigureToolButton(btnSave, "/images/tool_save");
                    oFunction.ConfigureToolButton(btnComplete, "/images/tool_complete");
                    oFunction.ConfigureToolButton(btnSLA, "/images/tool_sla");

                    btnDenied.Attributes.Add("onclick", "return CloseWindow();");
                    btnPrint.Attributes.Add("onclick", "return PrintWindow();");
                    btnClose.Attributes.Add("onclick", "return ExitWindow();");


                    //btnSave.Attributes.Add("onclick", "return ValidateStatus('" + ddlStatus.ClientID + "','" + txtComments.ClientID + "')" +
                    //   ";");
                    btnAddDataStoreSelection.Attributes.Add("onclick", "return ValidateText('" + txtDataStoreName.ClientID + "','Please enter datastore')" +
                                                            ";");
                    btnStatus.Attributes.Add("onclick", "return ValidateStatus('" + ddlStatus.ClientID + "','" + txtComments.ClientID + "')" +
                                             ";");

                    imgDate.Attributes.Add("onclick", "return ShowCalendar('" + txtDate.ClientID + "');");
                }

                LoadRequest();
            }
            else
            {
                panDenied.Visible = true;
            }
        }
예제 #25
0
파일: Form1.cs 프로젝트: itamarom/DDBot
 private byte[] GetValue(Requests command, int resultLength)
 {
     SendCommand(command, 0);
     return(ReadData(resultLength));
 }
예제 #26
0
        public bool TryGetFeeSubtractionRequest(out DestinationRequest request)
        {
            request = Requests.SingleOrDefault(x => x.Amount.SubtractFee);

            return(request != null);
        }
예제 #27
0
 public static ResponseBase BuildFrom(Requests.RequestBase request)
 {
     throw new NotImplementedException();
 }
예제 #28
0
        public bool TryGetCustomRequest(out DestinationRequest request)
        {
            request = Requests.SingleOrDefault(x => x.Amount.Type == MoneyRequestType.Change || x.Amount.Type == MoneyRequestType.AllRemaining);

            return(request != null);
        }
예제 #29
0
 public BaseResponse InsertOwnerPrivilege(Requests.FileManagerRolePrivilege.FilePrivilegeRequest request)
 {
     BaseResponse response = new BaseResponse();
     try
     {
         var privilege = request.MapTo<FileManagerRolePrivilege>();
         DataContext.FileManagerRolePrivileges.Add(privilege);
         DataContext.SaveChanges();
         response.IsSuccess = true;
     }
     catch (InvalidOperationException inval)
     {
         response.Message = inval.Message;
     }
     catch (ArgumentNullException arg)
     {
         response.Message = arg.Message;
     }
     return response;
 }
예제 #30
0
        public bool EditRequest(int id, Requests request)
        {
            bool check = _requestrepository.EditRequest(id, request);

            return(check);
        }
    IEnumerator invokeEnderMetrics(Requests pathID , Dictionary<string,string> _options)
    {
        string _parameters = getParamsString(_options);

        WWWForm form = new WWWForm();
        form.AddField("format", format);
        form.AddField("params", _parameters);

        Debug.Log("parameters: " + _parameters);

        string _urlRequest = url+paths[(int)pathID];
        //Debug.Log("url Request " + _urlRequest);
        WWW w = new WWW(_urlRequest, form);
        yield return w;

        if (!string.IsNullOrEmpty(w.error)) {
            print(w.error);

            handleError(w.error, pathID);
        }
        else {
            print("Finished: "+ w.text);

            IDictionary response = (IDictionary) Json.Deserialize(w.text);

            handlerResponse(response, pathID);
        }
    }
예제 #32
0
        protected void databind()
        {
            //开始计时
            DateTime StartTime = DateTime.Now;

            //绑定意向程度
            ddlScrap.DataSource = new T_Scrap().GetList(new E_Scrap()
            {
                PersonalID = PersonalID
            });
            ddlScrap.DataTextField  = "ScrapName";
            ddlScrap.DataValueField = "ScrapID";
            ddlScrap.DataBind();
            ddlScrap.Items.Insert(0, new ListItem("", "-1"));
            ddlScrap.SelectedValue = Requests.GetQueryInt("scrapid", -1).ToString();
            //获取名录属性信息
            E_Property dataProperty = new T_Property().Get(new E_Property()
            {
                PersonalID = PersonalID
            });

            TradeFlag  = Convert.ToBoolean((int)dataProperty.TradeFlag);
            AreaFlag   = Convert.ToBoolean((int)dataProperty.AreaFlag);
            SourceFlag = Convert.ToBoolean((int)dataProperty.SourceFlag);

            E_ClientInfo data = new E_ClientInfo();

            data.PersonalID = PersonalID;
            //--设置名录属性查询属性
            data.Property          = dataProperty;
            data.TradeID           = Requests.GetQueryInt("tradeid", -1);
            data.AreaID            = Requests.GetQueryInt("areaid", -1);
            data.SourceID          = Requests.GetQueryInt("sourceid", -1);
            Property1.PropertyData = dataProperty;
            Property1.AreaID       = data.AreaID;
            Property1.SourceID     = data.SourceID;
            Property1.TradeID      = data.TradeID;

            //读取url参数
            data.ClientName = Requests.GetQueryString("name");
            txtName.Text    = data.ClientName;

            string start = Requests.GetQueryString("startdate");
            string end   = Requests.GetQueryString("enddate");

            txtStartDate.Value = start;
            txtEndDate.Value   = end;
            //初始Pgae类
            data.Page = new MLMGC.DataEntity.E_Page();
            if (start != "")
            {
                data.Page.StartDate = Convert.ToDateTime(start);
            }
            if (end != "")
            {
                data.Page.EndDate = Convert.ToDateTime(end);
            }

            //data.StartDate = start == "" ? null : Convert.ToDateTime(start);
            //data.EndDate = end == "" ? null : Convert.ToDateTime(end);

            data.Status  = EnumClientStatus.报废客户;
            data.ScrapID = int.Parse(ddlScrap.SelectedValue.ToString());

            //分页参数
            data.Page.PageSize  = pageSize;
            data.Page.PageIndex = pageIndex;

            rpList.DataSource = new T_ClientInfo().ScrapSelect(data);
            rpList.DataBind();

            //设置分页样式
            pageList1.PageSize              = pageSize;
            pageList1.CurrentPageIndex      = pageIndex;
            pageList1.RecordCount           = data.Page.TotalCount;
            pageList1.CustomInfoHTML        = string.Format("共有记录 <span class='red_font'>{0}</span> 条", pageList1.RecordCount);
            pageList1.TextAfterPageIndexBox = "&nbsp;页/" + pageList1.PageCount + "&nbsp;";

            //停止计时
            DateTime EndTime = DateTime.Now;
            TimeSpan ts      = EndTime - StartTime;

            lblExecTime.Text = ts.TotalSeconds.ToString();
        }
			protected override IRequest DoRequest(string method, string url, Requests.RequestOptions options)
			{

				string full_url = _requests.ApiServer + "/SensorCloud/devices/" + _requests.DeviceId + url;
				options.AddParam("auth_token", _requests.AuthToken);
				var request = base.DoRequest(method, full_url, options);
				
				//if we get an authentication error, reatuheticate, update the authToken and try to make the request again
				if(request.ResponseCode == System.Net.HttpStatusCode.Forbidden)
				{
					_requests.Authenticate();

					full_url = _requests.ApiServer + "/SensorCloud/devices/" + _requests.DeviceId + url;
					options.AddParam("auth_token", _requests.AuthToken);
					request = base.DoRequest(method, full_url, options);
				}

				return request;
			}
예제 #34
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            int idAddRequest = 0;

            // добавить запрос (табл requests)

            if (cb1.IsChecked == true || cb2.IsChecked == true || cb3.IsChecked == true || cb4.IsChecked == true)
            {
                using (db = new Program_V1Context())
                {
                    Requests newRequest = new Requests()
                    {
                        SroreАppointment = 1,
                        StoreSource      = null,
                        Date             = DateTime.Today.ToString("dd.MM.yyyy")
                    };

                    db.Requests.Add(newRequest);
                    db.SaveChanges();

                    idAddRequest = newRequest.IdRequest;
                }


                //добавление 1 товара (если выбран)
                if (cb1.IsChecked == true)
                {
                    if ((tb1.Text != "") && (int.Parse(tb1.Text) != 0))
                    {
                        using (db = new Program_V1Context())
                        {
                            RequestsProducts newReqProduct1 = new RequestsProducts()
                            {
                                IdRequest = idAddRequest,
                                IdProduct = 1,
                                Quantity  = int.Parse(tb1.Text)
                            };
                            db.RequestsProducts.Add(newReqProduct1);
                            db.SaveChanges();
                            MessageBox.Show($"Добавлено {tb1.Text} антигрипина");
                        };
                    }
                    else
                    {
                        MessageBox.Show("Первое поле не введено или равно 0");
                    }
                }

                //добавление 2 товара (если выбран)
                if (cb2.IsChecked == true)
                {
                    if ((tb2.Text != "") && (int.Parse(tb2.Text) != 0))
                    {
                        using (db = new Program_V1Context())
                        {
                            RequestsProducts newReqProduct2 = new RequestsProducts()
                            {
                                IdRequest = idAddRequest,
                                IdProduct = 2,
                                Quantity  = int.Parse(tb2.Text)
                            };
                            db.RequestsProducts.Add(newReqProduct2);
                            db.SaveChanges();
                            MessageBox.Show($"Добавлено {tb2.Text} парацетамола");
                        };
                    }
                    else
                    {
                        MessageBox.Show("Второе поле не введено или равно 0");
                    }
                }

                //добавление 3 товара (если выбран)
                if (cb3.IsChecked == true)
                {
                    if ((tb3.Text != "") && (int.Parse(tb3.Text) != 0))
                    {
                        using (db = new Program_V1Context())
                        {
                            RequestsProducts newReqProduct3 = new RequestsProducts()
                            {
                                IdRequest = idAddRequest,
                                IdProduct = 3,
                                Quantity  = int.Parse(tb3.Text)
                            };
                            db.RequestsProducts.Add(newReqProduct3);
                            db.SaveChanges();
                            MessageBox.Show($"Добавлено {tb3.Text} валерьянки");
                        };
                    }
                    else
                    {
                        MessageBox.Show("Третье поле не введено или равно 0");
                    }
                }

                //добавление 4 товара (если выбран)
                if (cb4.IsChecked == true)
                {
                    if ((tb4.Text != "") && (int.Parse(tb4.Text) != 0))
                    {
                        using (db = new Program_V1Context())
                        {
                            RequestsProducts newReqProduct4 = new RequestsProducts()
                            {
                                IdRequest = idAddRequest,
                                IdProduct = 4,
                                Quantity  = int.Parse(tb4.Text)
                            };
                            db.RequestsProducts.Add(newReqProduct4);
                            db.SaveChanges();
                            MessageBox.Show($"Добавлено {tb4.Text} наркотиков");
                        };
                    }
                    else
                    {
                        MessageBox.Show("Четверное поле не введено или равно 0");
                    }
                }
                this.Close();
            }
            else
            {
                MessageBox.Show("Ничего не выбрано");
            }
        }
예제 #35
0
        public void Generate()
        {
            Admins.ToList();
            Cards.ToList();
            Payments.ToList();
            Requests.ToList();
            Users.ToList();
            AdminEntity admin = new AdminEntity();

            admin.Name     = "admin";
            admin.Password = "******";
            Admins.Add(admin);
            this.SaveChanges();
            admin          = new AdminEntity();
            admin.Name     = "admin1";
            admin.Password = "******";
            Admins.Add(admin);
            this.SaveChanges();

            CardEntity card;

            for (int i = 0; i < 500; i++)
            {
                card = new CardEntity();
                for (int j = 0; j < 16; j++)
                {
                    card.Number += rand.Next(0, 9).ToString();
                }
                bool flag = false;
                if (Cards.SingleOrDefault(c => c.Number == card.Number) != null)
                {
                    flag = true;
                }
                while (flag)
                {
                    card.Number = "";
                    for (int j = 0; j < 16; j++)
                    {
                        card.Number += rand.Next(0, 9).ToString();
                    }
                    if (Cards.SingleOrDefault(c => c.Number == card.Number) == null)
                    {
                        flag = false;
                    }
                }
                flag = false;
                card.NumberAccount = "BY";
                for (int j = 0; j < 26; j++)
                {
                    card.NumberAccount += rand.Next(0, 9).ToString();
                }
                if (Cards.SingleOrDefault(c => c.NumberAccount == card.NumberAccount) != null)
                {
                    flag = true;
                }
                while (flag)
                {
                    card.NumberAccount = "BY";
                    for (int j = 0; j < 26; j++)
                    {
                        card.NumberAccount += rand.Next(0, 9).ToString();
                    }
                    if (Cards.SingleOrDefault(c => c.NumberAccount == card.NumberAccount) != null)
                    {
                        flag = false;
                    }
                }
                card.IsBlocked = false;
                card.IsActive  = true;
                card.Balance   = Convert.ToDecimal(rand.Next(1000));
                card.CVV       = rand.Next(1000);
                card.Validity  = new DateTime(2022, 8, 1);
                Cards.Add(card);
                this.SaveChanges();
            }

            UserEntity user;

            for (int i = 0; i < 10; i++)
            {
                user          = new UserEntity();
                user.Name     = "user" + i.ToString();
                user.Password = user.Name;
                Users.Add(user);
                this.SaveChanges();
            }
        }
예제 #36
0
 protected void Page_Load(object sender, EventArgs e)
 {
     intProfile = Int32.Parse(Request.Cookies["profileid"].Value);
     oForecast  = new Forecast(intProfile, dsn);
     oPage      = new Pages(intProfile, dsn);
     if (Request.QueryString["pageid"] != null && Request.QueryString["pageid"] != "")
     {
         intPage = Int32.Parse(Request.QueryString["pageid"]);
     }
     if (Request.QueryString["action"] != null && Request.QueryString["action"] != "")
     {
         panFinish.Visible = true;
     }
     else
     {
         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["id"] != null && Request.QueryString["id"] != "")
         {
             intAnswer = Int32.Parse(Request.QueryString["id"]);
         }
         if (!IsPostBack)
         {
             if (intAnswer > 0)
             {
                 DataSet ds = oForecast.GetAnswer(intAnswer);
                 if (ds.Tables[0].Rows.Count > 0)
                 {
                     Projects         oProject          = new Projects(intProfile, dsn);
                     Requests         oRequest          = new Requests(intProfile, dsn);
                     Organizations    oOrganization     = new Organizations(intProfile, dsn);
                     Segment          oSegment          = new Segment(intProfile, dsn);
                     Platforms        oPlatform         = new Platforms(intProfile, dsn);
                     ModelsProperties oModelsProperties = new ModelsProperties(intProfile, dsn);
                     Confidence       oConfidence       = new Confidence(intProfile, dsn);
                     Classes          oClass            = new Classes(intProfile, dsn);
                     Environments     oEnvironment      = new Environments(intProfile, dsn);
                     Locations        oLocation         = new Locations(intProfile, dsn);
                     Users            oUser             = new Users(intProfile, dsn);
                     lblID.Text = intAnswer.ToString();
                     int intForecast = Int32.Parse(ds.Tables[0].Rows[0]["forecastid"].ToString());
                     int intRequest  = Int32.Parse(oForecast.Get(intForecast, "requestid"));
                     int intProject  = oRequest.GetProjectNumber(intRequest);
                     lblName.Text       = oProject.Get(intProject, "name");
                     lblNumber.Text     = oProject.Get(intProject, "number");
                     lblPortfolio.Text  = oOrganization.GetName(Int32.Parse(oProject.Get(intProject, "organization")));
                     lblSegment.Text    = oSegment.GetName(Int32.Parse(oProject.Get(intProject, "segmentid")));
                     lblPlatform.Text   = oPlatform.GetName(Int32.Parse(ds.Tables[0].Rows[0]["platformid"].ToString()));
                     lblNickname.Text   = ds.Tables[0].Rows[0]["name"].ToString();
                     lblModel.Text      = oModelsProperties.Get(Int32.Parse(ds.Tables[0].Rows[0]["modelid"].ToString()), "name");
                     lblCommitment.Text = DateTime.Parse(ds.Tables[0].Rows[0]["implementation"].ToString()).ToLongDateString();
                     lblQuantity.Text   = ds.Tables[0].Rows[0]["quantity"].ToString();
                     lblConfidence.Text = oConfidence.Get(Int32.Parse(ds.Tables[0].Rows[0]["confidenceid"].ToString()), "name");
                     int intClass = Int32.Parse(ds.Tables[0].Rows[0]["classid"].ToString());
                     lblClass.Text = oClass.Get(intClass, "name");
                     if (oClass.IsProd(intClass))
                     {
                         panTest.Visible = true;
                         lblTest.Text    = (ds.Tables[0].Rows[0]["test"].ToString() == "1" ? "Yes" : "No");
                     }
                     lblEnvironment.Text = oEnvironment.Get(Int32.Parse(ds.Tables[0].Rows[0]["environmentid"].ToString()), "name");
                     lblLocation.Text    = oLocation.GetFull(Int32.Parse(ds.Tables[0].Rows[0]["addressid"].ToString()));
                     lblIP.Text          = ds.Tables[0].Rows[0]["workstation"].ToString();
                     lblDesignedBy.Text  = oUser.GetFullName(Int32.Parse(ds.Tables[0].Rows[0]["userid"].ToString()));
                     lblDesignedOn.Text  = DateTime.Parse(ds.Tables[0].Rows[0]["created"].ToString()).ToString();
                     lblUpdated.Text     = DateTime.Parse(ds.Tables[0].Rows[0]["modified"].ToString()).ToString();
                     panShow.Visible     = true;
                     btnApprove.Enabled  = true;
                     btnDeny.Enabled     = true;
                 }
             }
         }
     }
     btnApprove.Attributes.Add("onclick", "return confirm('Are you sure you want to APPROVE this request?');");
     btnDeny.Attributes.Add("onclick", "return ValidateText('" + txtComments.ClientID + "','Please enter a reason for the rejection of this request') && confirm('Are you sure you want to DENY this request?');");
 }
예제 #37
0
파일: RecordLog.cs 프로젝트: zedr0n/ZES
 /// <summary>
 /// Add the mutation to scenario
 /// </summary>
 /// <param name="mutation">Mutation to add</param>
 /// <param name="timestamp">Mutation time</param>
 public void AddMutation(string mutation, Time timestamp)
 {
     Requests.Add(new Mutation(mutation, timestamp));
 }
예제 #38
0
        protected void Page_Load(object sender, EventArgs e)
        {
            StringBuilder sb = new StringBuilder(strFavorites);

            intProfile      = Int32.Parse(Request.Cookies["profileid"].Value);
            oPage           = new Pages(intProfile, dsn);
            oService        = new Services(intProfile, dsn);
            oServiceRequest = new ServiceRequests(intProfile, dsn);
            oRequest        = new Requests(intProfile, dsn);
            oUser           = new Users(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);
            }
            lblTitle.Text = "My Favorite Services";
            bool    boolFavorite = false;
            DataSet dsFavorite   = oService.GetFavorites(intProfile);

            foreach (DataRow drFavorite in dsFavorite.Tables[0].Rows)
            {
                int intService = Int32.Parse(drFavorite["serviceid"].ToString());
                sb.Append("<tr style=\"background-color:");
                sb.Append(boolFavorite ? "#F6F6F6" : "#FFFFFF");
                sb.Append("\" id=\"trDept");
                sb.Append(drFavorite["serviceid"].ToString());
                sb.Append("\">");
                boolFavorite = !boolFavorite;
                if (oServiceRequest.GetTasks(intProfile, intService).Tables[0].Rows.Count == 0 || boolWM == false)
                {
                    sb.Append("<td nowrap><input type=\"checkbox\" onclick=\"HighlightCheckRow(this, 'trDept");
                    sb.Append(intService.ToString());
                    sb.Append("','");
                    sb.Append(intService.ToString());
                    sb.Append("','");
                    sb.Append(hdnService.ClientID);
                    sb.Append("',true);\"/></td>");
                    sb.Append("<td nowrap width=\"20%\"><a href=\"javascript:void(0);\" onclick=\"OpenWindow('SERVICES_DETAIL','?sid=");
                    sb.Append(intService.ToString());
                    sb.Append("');\">");
                    sb.Append(drFavorite["name"].ToString());
                    sb.Append("</a></td>");
                }
                else
                {
                    sb.Append("<td nowrap><input type=\"checkbox\" onclick=\"HighlightCheckRow(this, 'trDept");
                    sb.Append(intService.ToString());
                    sb.Append("','");
                    sb.Append(intService.ToString());
                    sb.Append("','");
                    sb.Append(hdnService.ClientID);
                    sb.Append("',false);\"/></td>");
                    sb.Append("<td nowrap width=\"20%\" class=\"default\"><a href=\"javascript:void(0);\" onclick=\"OpenWindow('SERVICES_DETAIL','?sid=");
                    sb.Append(intService.ToString());
                    sb.Append("');\">");
                    sb.Append(drFavorite["name"].ToString());
                    sb.Append("</a></td>");
                }

                sb.Append("<td width=\"60%\">");
                sb.Append(drFavorite["description"].ToString());
                sb.Append("</td>");
                int     intItem    = oService.GetItemId(intService);
                string  strItem    = "";
                DataSet dsManagers = oService.GetUser(intService, -1);
                foreach (DataRow drManager in dsManagers.Tables[0].Rows)
                {
                    if (strItem != "")
                    {
                        strItem += "<br/>";
                    }
                    strItem += "<a href=\"javascript:void(0);\" onclick=\"OpenWindow('PROFILE','?userid=" + drManager["userid"].ToString() + "');\"><img src=\"/images/user.gif\" border=\"0\" align=\"absmiddle\"/> " + oUser.GetFullName(Int32.Parse(drManager["userid"].ToString())) + "</a>";
                }
                if (strItem == "")
                {
                    // Check the people that get assigned
                    dsManagers = oService.GetUser(intService, 0);
                    foreach (DataRow drManager in dsManagers.Tables[0].Rows)
                    {
                        if (strItem != "")
                        {
                            strItem += ", ";
                        }
                        strItem += "<a href=\"javascript:void(0);\" onclick=\"OpenWindow('PROFILE','?userid=" + drManager["userid"].ToString() + "');\">" + oUser.GetFullName(Int32.Parse(drManager["userid"].ToString())) + "</a>";
                    }
                }
                sb.Append("<td width=\"20%\" nowrap>");
                sb.Append(strItem);
                sb.Append("</td>");
                sb.Append("</tr>");
            }
            if (sb.ToString() == "")
            {
                sb.Append("<tr><td colspan=\"4\"> You have not selected any favorites</td></tr>");
                btnFavorite.Enabled = false;
            }

            sb.Insert(0, "<tr bgcolor=\"#EEEEEE\"><td></td><td width=\"20%\"><b><u>Service:</u></b></td><td width=\"60%\"><b><u>Description:</u></b></td><td width=\"20%\" nowrap><b><u>Service Owner:</u></b></td></tr>");
            sb.Insert(0, "<table width=\"100%\" border=\"0\" cellpadding=\"4\" cellspacing=\"0\" style=\"border:solid 1px #CCCCCC\">");
            sb.Append("</table>");

            strFavorites = sb.ToString();
            btnFavorite.Attributes.Add("onclick", "return ValidateStringItems('" + hdnService.ClientID + "','Please select at least one service') && ProcessButton(this);");
        }
예제 #39
0
 public async static Task <List <Models.API.ThirdParty.UsernameChange.UsernameChangeListing> > GetUsernameChangesAsync(string username)
 {
     return(await Requests.GetGenericAsync <List <Models.API.ThirdParty.UsernameChange.UsernameChangeListing> >($"https://twitch-tools.rootonline.de/username_changelogs_search.php?q={username}&format=json", null, Requests.API.Void));
 }
예제 #40
0
 public List <Request> Read_AllRequests()
 {
     return(Requests.Where(r => r.ToUserID == GlobalInfo.CurrentUser.ID).OrderBy(r => r.TransferDateTime).ToList());
 }
예제 #41
0
파일: Form1.cs 프로젝트: itamarom/DDBot
 private void SendCommand(Requests command, byte value)
 {
     WriteData(new byte[] { (byte)command, value });
 }
예제 #42
0
        public bool Run()
        {
            Console.Title = Config.Filename;

            if (!Directory.Exists(Constants.OUTPUT_FOLDER))
            {
                Directory.CreateDirectory(Constants.OUTPUT_FOLDER);
            }

            if (!Directory.Exists(Constants.TEMP_FOLDER))
            {
                Directory.CreateDirectory(Constants.TEMP_FOLDER);
            }

            if (!Client.Login())
            {
                return(false);
            }

            Logger.Verbose("Getting playlist data");
            Playlist playlist = Client.GetPlaylist(Config.VideoIds, Config.AudioIds);

            if (playlist == null)
            {
                Logger.Error("Getting playlist failed");
                return(false);
            }

            if (Config.PrintInfo)
            {
                Logger.Info("Info mode complete");
                return(true);
            }

            EditFilename(playlist.SelectedVideoTracks, playlist.SelectedAudioTracks);

            Console.Title = Config.Filename;

            string oldTitle = Console.Title;

            if (!Config.License)
            {
                Logger.Debug("Download URLs:");
                foreach (ITrack track in new ITrack[] { }.Concat(playlist.SelectedVideoTracks).Concat(playlist.SelectedAudioTracks))
                {
                    if (track.Segments == 1)
                    {
                        foreach (var url in track.Urls)
                        {
                            Logger.Debug(track.GetFilename(Filename, false, false));
                            Logger.Debug(track.Urls[0]);
                        }
                    }
                }

                if (!(Config.AudioOnly || Config.VideoOnly))
                {
                    if (playlist.SelectedSubtitleTracks.Count > 0)
                    {
                        Logger.Info("Downloading subtitles . . .");
                        foreach (var subtitle in playlist.SelectedSubtitleTracks)
                        {
                            DownloadAndConvertSubtitle(subtitle);
                        }
                        Logger.Verbose("All subtitles downloaded");
                    }
                }

                if (Config.SubsOnly && !Config.AudioOnly && !Config.VideoOnly)
                {
                    foreach (var subtitle in playlist.SelectedSubtitleTracks)
                    {
                        string subFilename = subtitle.GetFilename(Filename);
                        File.Move(subFilename, subFilename.Replace(Constants.TEMP_FOLDER, Constants.OUTPUT_FOLDER));
                    }
                    Logger.Info("Downloaded subtitles. Done!");
                    return(true);
                }

                Requests.ResetCounter();
                Logger.Info("Downloading video . . .");
                if (!Config.AudioOnly)
                {
                    foreach (var videoTrack in playlist.SelectedVideoTracks)
                    {
                        if (!DownloadTrack(videoTrack))
                        {
                            Logger.Error($"Error downloading video track {videoTrack.Id}");
                            Config.License = true;
                        }
                    }
                    ;
                }

                Requests.ResetCounter();
                Logger.Info("Downloading audio . . .");
                if (!Config.VideoOnly)
                {
                    foreach (var audioTrack in playlist.SelectedAudioTracks)
                    {
                        if (!DownloadTrack(audioTrack))
                        {
                            Logger.Error($"Error downloading audio track {audioTrack.Id}");
                            Config.License = true;
                        }
                    }
                    ;
                }
            }

            Console.Title = oldTitle;

            if (Config.EncryptedOnly)
            {
                foreach (ITrack track in playlist.SelectedAudioTracks.Cast <ITrack>().Concat(playlist.SelectedVideoTracks))
                {
                    try
                    {
                        string originalFilename = track.GetFilename(Filename, !track.Encrypted, false);
                        File.Move(originalFilename, originalFilename.Replace(Constants.TEMP_FOLDER, Constants.OUTPUT_FOLDER));
                    }
                    catch
                    {
                    }
                }
                if (!(Config.AudioOnly || Config.VideoOnly))
                {
                    foreach (var subtitle in playlist.SelectedSubtitleTracks)
                    {
                        string filename = subtitle.GetFilename(Filename, Config.SubtitleFormat);
                        File.Move(filename, filename.Replace(Constants.TEMP_FOLDER, Constants.OUTPUT_FOLDER));
                    }
                }

                return(true);
            }

            Logger.Info("Decrypting tracks . . .");

            List <ITrack> encryptedTracks = new List <ITrack>();

            if (!Config.AudioOnly)
            {
                encryptedTracks.AddRange(playlist.SelectedVideoTracks.Where(track => track.Encrypted == true).Cast <ITrack>());
            }
            if (!Config.VideoOnly)
            {
                encryptedTracks.AddRange(playlist.SelectedAudioTracks.Where(track => track.Encrypted == true).Cast <ITrack>());
            }

            foreach (ITrack track in encryptedTracks)
            {
                if (!DoDecrypt(track, playlist.ServerCertificateB64))
                {
                    return(false);
                }
            }

            if (Config.License)
            {
                return(true);
            }
            else
            {
                Logger.Verbose("All decryption complete");

                if (Config.DontMux)
                {
                    Logger.Info("Moving unmuxed tracks");
                    if (!Config.AudioOnly)
                    {
                        foreach (ITrack videoTrack in playlist.SelectedVideoTracks)
                        {
                            string videoFilename = videoTrack.GetFilename(Filename, true, false);
                            File.Move(videoFilename, videoFilename.Replace(Constants.TEMP_FOLDER, Constants.OUTPUT_FOLDER));
                        }
                    }

                    if (!Config.VideoOnly)
                    {
                        foreach (ITrack audioTrack in playlist.SelectedAudioTracks)
                        {
                            string audioFilename = audioTrack.GetFilename(Filename, true, false);
                            File.Move(audioFilename, audioFilename.Replace(Constants.TEMP_FOLDER, Constants.OUTPUT_FOLDER));
                        }
                    }

                    foreach (var subtitle in playlist.SelectedSubtitleTracks)
                    {
                        string filename = subtitle.GetFilename(Filename, Config.SubtitleFormat);
                        File.Move(filename, filename.Replace(Constants.TEMP_FOLDER, Constants.OUTPUT_FOLDER));
                    }
                }
                else
                {
                    Logger.Info("Muxing tracks . . .");
                    DoMerge(playlist.SelectedVideoTracks, playlist.SelectedAudioTracks, playlist.SelectedSubtitleTracks);
                }

                Logger.Verbose("Muxed file written");
            }

            if (Config.SkipCleanup)
            {
                Logger.Info("Skipping cleanup");
                return(true);
            }

            foreach (string file in Directory.GetFiles(Constants.TEMP_FOLDER, "*"))
            {
                if (file.Contains(Filename))
                {
                    File.Delete(file);
                }
            }

            foreach (string file in Cleanup.Distinct())
            {
                if (File.Exists(file))
                {
                    File.Delete(file);
                }
            }

            Logger.Info("Complete");

            return(true);
        }
예제 #43
0
파일: Form1.cs 프로젝트: itamarom/DDBot
 private byte GetByte(Requests command)
 {
     return(GetValue(command, 1)[0]);
 }
예제 #44
0
        public ActionResult RequestdeleteHistory(int RequestID)
        {
            Requests Request = db.Requests.Find(RequestID);

            return(View(Request));
        }
예제 #45
0
 public static ResponseBase BuildFrom(Requests.RequestBase request, params object[] obj)
 {
     throw new NotImplementedException();
 }
예제 #46
0
        public ActionResult BuildingRequestHistoryDelete(int RequestID)
        {
            Requests request = db.Requests.Find(RequestID);

            return(View(request));
        }
 public void OnIncomingRequest(object sender, Requests.IncomingCallRequest request)
 {
     Console.WriteLine("{0} received request for incoming connection from {1}", this.Number, request.Source);
 }
예제 #48
0
        protected void Page_Load(object sender, EventArgs e)
        {
            RequestItems    oRequestItem    = new RequestItems(intProfile, dsn);
            RequestFields   oRequestField   = new RequestFields(intProfile, dsn);
            ServiceRequests oServiceRequest = new ServiceRequests(intProfile, dsn);
            Services        oService        = new Services(intProfile, dsn);
            ServiceDetails  oServiceDetail  = new ServiceDetails(intProfile, dsn);
            int             intRequest      = Int32.Parse(Request.QueryString["rid"]);
            string          strStatus       = oServiceRequest.Get(intRequest, "checkout");
            DataSet         dsItems         = oRequestItem.GetForms(intRequest);
            int             intItem         = 0;
            int             intService      = 0;
            int             intNumber       = 0;

            if (dsItems.Tables[0].Rows.Count > 0)
            {
                bool boolBreak = false;
                foreach (DataRow drItem in dsItems.Tables[0].Rows)
                {
                    if (boolBreak == true)
                    {
                        break;
                    }
                    if (drItem["done"].ToString() == "0")
                    {
                        intItem    = Int32.Parse(drItem["itemid"].ToString());
                        intService = Int32.Parse(drItem["serviceid"].ToString());
                        intNumber  = Int32.Parse(drItem["number"].ToString());
                        boolBreak  = true;
                    }
                    if (intItem > 0 && (strStatus == "1" || strStatus == "2"))
                    {
                        bool   boolSuccess = true;
                        string strResult   = oService.GetName(intService) + " Completed";
                        string strError    = oService.GetName(intService) + " Error";
                        // ********* BEGIN PROCESSING **************
                        Requests  oRequest  = new Requests(intProfile, dsn);
                        Functions oFunction = new Functions(intProfile, dsn, intEnvironment);
                        Variables oVariable = new Variables(intEnvironment);
                        Users     oUser     = new Users(intProfile, dsn);
                        Pages     oPage     = new Pages(intProfile, dsn);
                        if (oRequest.Get(intRequest, "description") == "")
                        {
                            Customized oCustomized = new Customized(intProfile, dsn);
                            DataSet    dsStatement = oCustomized.GetIIS(intRequest, intItem, intNumber);
                            if (dsStatement.Tables[0].Rows.Count > 0)
                            {
                                oRequest.UpdateDescription(intRequest, dsStatement.Tables[0].Rows[0]["statement"].ToString());
                            }
                        }
                        int     intDevices  = 0;
                        double  dblQuantity = 0.00;
                        DataSet ds          = oService.GetSelected(intRequest, intService);
                        if (ds.Tables[0].Rows.Count > 0)
                        {
                            dblQuantity = double.Parse(ds.Tables[0].Rows[0]["quantity"].ToString());
                            intDevices  = Int32.Parse(ds.Tables[0].Rows[0]["quantity"].ToString());
                        }
                        double dblHours    = oServiceDetail.GetHours(intService, dblQuantity);
                        int    intResource = oServiceRequest.AddRequest(intRequest, intItem, intService, intDevices, dblHours, 2, intNumber, dsnServiceEditor);
                        if (oService.Get(intService, "typeid") == "3")
                        {
                        }
                        else if (oService.Get(intService, "typeid") == "2")
                        {
                        }
                        else
                        {
                            if (oServiceRequest.NotifyApproval(intResource, intResourceRequestApprove, intEnvironment, "", dsnServiceEditor) == false)
                            {
                                oServiceRequest.NotifyTeamLead(intItem, intResource, intAssignPage, intViewPage, intEnvironment, "", dsnServiceEditor, dsnAsset, dsnIP, 0);
                            }
                        }
                        // ******** END PROCESSING **************
                        if (oService.Get(intService, "automate") == "1" && boolSuccess == true)
                        {
                            strDone += "<p><span class=\"biggerbold\"><img src=\"/images/bigCheck.gif\" border=\"0\" align=\"absmiddle\"/> " + strResult + "</span></p>";
                        }
                        else
                        {
                            if (boolSuccess == false)
                            {
                                strDone += "<p><span class=\"biggerbold\"><img src=\"/images/bigError.gif\" border=\"0\" align=\"absmiddle\"/> " + strError + "</span></p>";
                            }
                            else
                            {
                                strDone += "<p><span class=\"biggerbold\"><img src=\"/images/bigCheck.gif\" border=\"0\" align=\"absmiddle\"/> " + oService.GetName(intService) + " Submitted</span></p>";
                            }
                        }
                        oRequestItem.UpdateFormDone(intRequest, intItem, intNumber, 1);
                    }
                }
            }
        }
예제 #49
0
 public abstract HTMLComponents.IHTMLComponent Get(Requests.Request request = null);
		public Responses.GetTemplateForEditResponse GetTemplateForDeleteConfirm(Requests.GetTemplateForDeleteConfirmRequest request)
		{
			return _context.SimpleOperation<GetTemplateForDeleteConfirmRequest, GetTemplateForEditResponse, IGetTemplateForEditQuery>(request, () => new { request = request });
		}
예제 #51
0
 public static new ResponseBase BuildFrom(Requests.RequestBase request, params object[] obj)
 {
     return BuildFrom(request);
 }
        public virtual ActionResult Update(Requests.Transformations.Update request)
        {
            var logger = ObjectFactory.GetInstance<Logger>();
            logger.Info("[Controllers].[TransformationsController].[Update] invoked.");

            var validator = new Validators.Transformations.Update(request);
            logger.Trace("[Controllers].[TransformationsController].[Update] [validator].[IsValid] = '{0}'.", validator.IsValid);

            Responses.Response response;
            if (!validator.IsValid)
            {
                logger.Debug("[Controllers].[TransformationsController].[Update] mapping [validator] to [response].");
                response = Mapper.Map<Validators.IValidator, Responses.Validation>(validator);
                logger.Info("[Controllers].[TransformationsController].[Update] returned validation errors.");
            }
            else
            {
                Transformation transformation = null;
                logger.Debug("[Controllers].[TransformationsController].[Update] selecting [transformation].");
                using (var connection = ObjectFactory.GetInstance<DatabaseConnections>().SmsToMail)
                {
                    transformation = connection.Get<Transformation>(validator.Result.Id);
                }

                logger.Debug("[Controllers].[TransformationsController].[Update] mapping [validator] to [transformation].");
                Mapper.Map<DTO.Transformations.Update, Entities.Transformation>(validator.Result, transformation);

                logger.Debug("[Controllers].[TransformationsController].[Update] updating [transformation].");
                using (var connection = ObjectFactory.GetInstance<DatabaseConnections>().SmsToMail)
                {
                    connection.Update(transformation);
                }

                response = new Responses.Transformations.Update();
                logger.Info("[Controllers].[TransformationsController].[Update] successfully updated transformation.");
                logger.Info("[Controllers].[TransformationsController].[Update] [transformation].[Id] == '{0}'.", transformation.Id);
            }

            logger.Trace("[Controllers].[TransformationsController].[Update] finished work.");
            return Json(response);
        }
    void handlerResponse(IDictionary response, Requests pathID )
    {
        IDictionary data = null;
        switch(pathID)
        {
        case Requests.REGISTER:
            data = (IDictionary)response["data"];
            Debug.Log("data: " + data["account_id"]);
            account_id = (string) data["account_id"];
            break;

        case Requests.REGISTERCHILD:
            data = (IDictionary)response["data"];
            Debug.Log("data: " + data["child_id"]);
            child_id = (string) data["child_id"];
            break;

        case Requests.GETCHILDLIST:
            break;
        case Requests.AUTH:
            Debug.Log("session_token: " + response["session_token"]);
            session_token = (string)response["session_token"];
            break;

        }

        if(delegates[(int)pathID] != null)
            delegates[(int)pathID](pathID,"OK", response);
    }
예제 #54
0
        public HtmlDocument Resolve()
        {
            var request = Requests.GetRequest(requestType);

            return(RequestDispatcher.SendRequest(request));
        }
 private void ts_AuthDelegate(Requests pathID, string error, IDictionary response )
 {
     if(error == "OK")
     {
         Debug.Log("ts_AuthDelegate");
         invokeTrackSet(TrackSet_options);
         TrackSet_options = null;
     }
 }
예제 #56
0
 /// <summary>
 /// Gets the request by id
 /// </summary>
 /// <returns>The request at the given order</returns>
 internal BatchRequest GetRequest(Guid id)
 {
     return(Requests.First(r => r.Value.Id == id).Value);
 }
예제 #57
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);
     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);
     oLocation        = new Locations(intProfile, dsn);
     oClass           = new Classes(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();
         if (!IsPostBack)
         {
             LoadLists();
         }
         // 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 + "');");
         }
     }
     strLocation = oLocation.LoadDDL("ddlState", "ddlCity", "ddlAddress", hdnLocation.ClientID, intLocation, true, "ddlCommon");
     ddlClass.Attributes.Add("onchange", "PopulateEnvironments('" + ddlClass.ClientID + "','" + ddlEnvironment.ClientID + "',0);");
     ddlEnvironment.Attributes.Add("onchange", "UpdateDropDownHidden('" + ddlEnvironment.ClientID + "','" + hdnEnvironment.ClientID + "');");
     ddlCluster.Attributes.Add("onchange", "ResetDiv(null);SwapDivDDL(this,'" + divClusterYes.ClientID + "','" + divClusterYesGroup.ClientID + "','" + divClusterNo.ClientID + "',null);");
     ddlClusterYesSQL.Attributes.Add("onchange", "ResetDiv('" + divClusterYesSQLNoMount.ClientID + "');SwapDivDDL(this,'" + divClusterYesSQLYes.ClientID + "',null,'" + divClusterYesSQLNo.ClientID + "',null);");
     ddlClusterYesSQLYesVersion.Attributes.Add("onchange", "ShowDivDDL(this,'" + divSQLYes2005.ClientID + "',1);");
     ddlClusterYesSQLGroup.Attributes.Add("onchange", "SwapDivDDL(this,'" + divClusterYesGroupNew.ClientID + "',null,'" + divClusterYesGroupExisting.ClientID + "',null);");
     ddlClusterYesSQLNoType.Attributes.Add("onchange", "ShowDivDDL(this,'" + divClusterYesSQLNoMount.ClientID + "',2);");
     ddlClusterNoSQL.Attributes.Add("onchange", "SwapDivDDL(this,'" + divClusterNoSQLYes.ClientID + "',null,'" + divClusterNoSQLNo.ClientID + "',null);");
     ddlClusterNoSQLYesVersion.Attributes.Add("onchange", "ShowDivDDL(this,'" + divSQLYes2005.ClientID + "',1);");
     txtClusterNoSQLDBA.Attributes.Add("onkeyup", "return AJAXTextBoxGet(this,'300','195','" + divClusterNoSQLDBA.ClientID + "','" + lstClusterNoSQLDBA.ClientID + "','" + hdnDBA.ClientID + "','" + oVariable.URL() + "/frame/users.aspx',2);");
     lstClusterNoSQLDBA.Attributes.Add("ondblclick", "AJAXClickRow();");
     txtClusterYesSQLDBA.Attributes.Add("onkeyup", "return AJAXTextBoxGet(this,'300','195','" + divClusterYesSQLDBA.ClientID + "','" + lstClusterYesSQLDBA.ClientID + "','" + hdnDBA.ClientID + "','" + oVariable.URL() + "/frame/users.aspx',2);");
     lstClusterYesSQLDBA.Attributes.Add("ondblclick", "AJAXClickRow();");
     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 + "','" + ddlClusterNoSQL.ClientID + "','" + ddlClusterNoSQLNo.ClientID + "','" + ddlClusterNoSQLYesVersion.ClientID + "','" + hdnDBA.ClientID + "','" + txtClusterNoSQLDBA.ClientID + "','" + ddlClusterYesSQL.ClientID + "','" + ddlClusterYesSQLYesVersion.ClientID + "','" + ddlClusterYesSQLGroup.ClientID + "','" + txtClusterYesGroupExisting.ClientID + "','" + chkClusterYesGroupNewNetwork.ClientID + "','" + txtClusterYesGroupNewNetwork.ClientID + "','" + chkClusterYesGroupNewIP.ClientID + "','" + txtClusterYesGroupNewIP.ClientID + "','" + txtClusterYesSQLDBA.ClientID + "','" + ddlClusterYesSQLNoType.ClientID + "','" + txtClusterYesSQLNoMount.ClientID + "')" +
                            " && ValidateText('" + txtDescription.ClientID + "','Please enter a description of the work to be performed')" +
                            " && ValidateDropDown('" + ddlClass.ClientID + "','Please select the class')" +
                            " && ValidateDropDown('" + ddlEnvironment.ClientID + "','Please select the environment')" +
                            " && ValidateDropDown('" + ddlFabric.ClientID + "','Please select the fabric')" +
                            " && ValidateDropDown('" + ddlReplicated.ClientID + "','Please select if this device is being replicated')" +
                            " && ValidateDropDown('" + ddlHA.ClientID + "','Please select if this device requires high availability storage')" +
                            " && ValidateDropDown('" + ddlType2.ClientID + "','Please select a type of storage')" +
                            " && ValidateDropDown('" + ddlExpand.ClientID + "','Please select if you want to expand a LUN or add an additional LUN')" +
                            " && ValidateNumber0('" + txtAdditional.ClientID + "','Please enter the total amount of storage')" +
                            ";");
     imgDate.Attributes.Add("onclick", "return ShowCalendar('" + txtDate.ClientID + "');");
     btnLunAdd.Attributes.Add("onclick", "return ValidateText('" + txtLUNs.ClientID + "','Please enter some text') && ValidateNoComma('" + txtLUNs.ClientID + "','The text cannot contain a comma (,)\\n\\nPlease click OK and remove all commas') && ListControlIn('" + lstLUNs.ClientID + "','" + hdnLUNs.ClientID + "','" + txtLUNs.ClientID + "');");
     btnLunDelete.Attributes.Add("onclick", "return ListControlOut('" + lstLUNs.ClientID + "','" + hdnLUNs.ClientID + "');");
     txtLUNs.Attributes.Add("onkeydown", "if(event.which || event.keyCode){if ((event.which == 13) || (event.keyCode == 13)) {document.getElementById('" + btnLunAdd.ClientID + "').click();return false;}} else {return true}; ");
 }
예제 #58
0
 internal static void SendRequest(string reqType, string name, string email, string addr, string state, string city, string zip, string comments)
 {
     Requests newRequest = new Requests(reqType, name, email, addr, state, city, zip, comments);
     _db.Requests.Add(newRequest);
     _db.SaveChanges();
 }
예제 #59
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);
            oRequest        = new Requests(intProfile, dsn);
            oRequestField   = new RequestFields(intProfile, dsn);
            oApplication    = new Applications(intProfile, dsn);
            oAccountRequest = new AccountRequest(intProfile, dsn);
            oUser           = new Users(intProfile, dsn);
            oDomain         = new Domains(intProfile, dsn);
            oFunction       = new Functions(intProfile, dsn, intEnvironment);


            //Menus
            int intMenuTab = 0;

            if (Request.QueryString["menu_tab"] != null && Request.QueryString["menu_tab"] != "")
            {
                intMenuTab = Int32.Parse(Request.QueryString["menu_tab"]);
            }
            Tab oTab = new Tab("", intMenuTab, "divMenu1", true, false);

            //Tab oTab = new Tab(hdnType.ClientID, intMenuTab, "divMenu1", true, false);

            oTab.AddTab("Account Properties", "");
            oTab.AddTab("Group Memberships", "");
            strMenuTab1 = oTab.GetTabs();

            //End Menus

            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();
                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 + "');");
                }
                if (!IsPostBack)
                {
                    ddlDomain.DataValueField = "id";
                    ddlDomain.DataTextField  = "name";
                    ddlDomain.DataSource     = oDomain.GetsAccountMaintenance(0, 1);
                    ddlDomain.DataBind();
                    ddlDomain.Items.Insert(0, new ListItem("-- SELECT --", "0"));
                }
                if (Request.QueryString["u"] != null && Request.QueryString["u"] != "" && Request.QueryString["d"] != null && Request.QueryString["d"] != "")
                {
                    if (!IsPostBack)
                    {
                        LoadObjects();
                    }
                    btnNext.Attributes.Add("onclick", "return ValidateText('" + txtFirst.ClientID + "','Please enter a first name')" +
                                           " && ValidateText('" + txtLast.ClientID + "','Please enter a last name')" +
                                           ";");
                }
                else
                {
                    btnNext.Enabled = false;
                }
                btnContinue.Attributes.Add("onclick", "return ValidateText('" + txtID.ClientID + "','Please enter a user ID')" +
                                           " && ValidateDropDown('" + ddlDomain.ClientID + "','Please select a domain')" +
                                           ";");
            }
            btnCancel1.Attributes.Add("onclick", "return confirm('Are you sure you want to delete this service request?');");
        }
 public int Create(Requests.Blog blog)
 {
     throw new NotImplementedException();
 }