コード例 #1
0
        public void CreateAccount()
        {
            if (Password.text == ConfPassword.text)
            {
                RegisterPlayFabUserRequest request = new RegisterPlayFabUserRequest();
                request.Username    = UserName.text;
                request.Password    = ConfPassword.text;
                request.Email       = Email.text;
                request.DisplayName = UserName.text;

                PlayFabClientAPI.RegisterPlayFabUser(request, result =>
                {
                    Alerts a = new Alerts();
                    StartCoroutine(a.CreateNewAlert(result.Username + " Has been created"));
                },
                                                     error =>
                {
                    Alerts a = new Alerts();
                    StartCoroutine(a.CreateNewAlert(error.ErrorMessage));
                });
            }
        }
コード例 #2
0
        private void btnDelete_Click(object sender, EventArgs e)
        {
            if (tablaUsuarios.CurrentRow.Selected)
            {
                try
                {
                    if (Alerts.ShowWarning("¿Seguro deseas eliminar este usuario?"))
                    {
                        string id = tablaUsuarios.Rows[tablaUsuarios.CurrentRow.Index].Cells["Id"].Value.ToString();

                        /*string name = tablaUsuarios.Rows[tablaUsuarios.CurrentRow.Index].Cells["Nombre"].Value.ToString();
                         * string user = tablaUsuarios.Rows[tablaUsuarios.CurrentRow.Index].Cells["Usuario"].Value.ToString();
                         *
                         * if (this.user._FindNodo(Seguridad.Encriptar(user)))
                         * {
                         *  this.user._DeleteNodo(Seguridad.Encriptar(user));
                         *  new Success("Se ha borrado correctamente").ShowDialog();
                         * }*/

                        UsersModel usersModel = new UsersModel();

                        if (usersModel.deleteUser(id))
                        {
                            Alerts.ShowSuccess("Se ha borrado correctamente");
                            tablaUsuarios.Rows.Remove(tablaUsuarios.CurrentRow);
                        }
                    }
                }
                catch (XmlException xe)
                {
                    Console.WriteLine(xe.Message.ToString());
                    Alerts.ShowError("Esta fila no se puede eliminar");
                }
            }
            else
            {
                Alerts.ShowInformation("Seleccione la fila que desea eliminar");
            }
        }
コード例 #3
0
        public int insertIgreja(entitie.RegisterIgreja obj)
        {
            try
            {
                cmd.CommandText = "insert into igrejas (congregacao, dirigente, rua, numero, bairro, cidade," +
                                  " estado, telefone, tipo,inaugurada) " +
                                  "values(?,?,?,?,?,?,?,?,?,?)";


                cmd.Parameters.Add("1", MySqlDbType.VarChar, 50).Value  = obj.Congregacao;
                cmd.Parameters.Add("2", MySqlDbType.VarChar, 1).Value   = obj.Dirigente;
                cmd.Parameters.Add("3", MySqlDbType.VarChar, 50).Value  = obj.Rua;
                cmd.Parameters.Add("4", MySqlDbType.VarChar, 30).Value  = obj.Numero;
                cmd.Parameters.Add("5", MySqlDbType.VarChar, 15).Value  = obj.Bairro;
                cmd.Parameters.Add("6", MySqlDbType.VarChar, 15).Value  = obj.Cidade;
                cmd.Parameters.Add("7", MySqlDbType.VarChar, 30).Value  = obj.Estado;
                cmd.Parameters.Add("8", MySqlDbType.VarChar, 30).Value  = obj.Telefone;
                cmd.Parameters.Add("9", MySqlDbType.VarChar, 30).Value  = obj.Tipo;
                cmd.Parameters.Add("10", MySqlDbType.VarChar, 10).Value = obj.Inaugurada;

                cmd.Connection = DB.conectar();
                cmd.ExecuteNonQuery();


                Alerts.showAlert("Dados Cadastrados com Sucesso", "", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return(1);
            }
            catch (Exception e)
            {
                Alerts.showAlert(e.Message, "Falha ao inserir", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return(0);
            }
            finally
            {
                cmd.Parameters.Clear();

                DB.desconectar();
            }
        }
コード例 #4
0
ファイル: HPI.Indicator.CS プロジェクト: yuxi214/multicharts
 protected override void CalcBar()
 {
     if (Bars.CurrentBar == 1)
     {
         m_applicationtype.Value = (Int32)Environment.ApplicationCode;
     }
     m_hpivalue.Value = m_hpi1[0] * 1E-05;
     Plot1.Set(0, m_hpivalue.Value);
     Plot2.Set(0, 0);
     if (Color.Empty != upcolor && Color.Empty != dncolor)
     {
         m_colorlevel = m_normgradientcolor1[0];
         if (m_applicationtype.Value == 1)
         {
             Plot1.Colors[0] = m_colorlevel;
         }
         else
         {
             if (m_applicationtype.Value > 1)
             {
                 Plot1.Colors[0] = gridforegroundcolor;
                 Plot1.BGColor   = m_colorlevel;
             }
         }
     }
     if (Bars.Close.LowestBar(alertlength) == 0 &&
         PublicFunctions.DoubleGreater(m_hpivalue.LowestBar(alertlength), 0))
     {
         Alerts.Alert("Bullish divergence - new low not confirmed");
     }
     else
     {
         if (Bars.Close.HighestBar(alertlength) == 0 &&
             PublicFunctions.DoubleGreater(m_hpivalue.HighestBar(alertlength), 0))
         {
             Alerts.Alert("Bearish divergence - new high not confirmed");
         }
     }
 }
コード例 #5
0
ファイル: MainMenu.cs プロジェクト: pandabearnoah/1v1UnityFPS
    void CheckUserInventory()
    {
        GetUserInventoryRequest requestInventory = new GetUserInventoryRequest();

        PlayFabClientAPI.GetUserInventory(requestInventory, result =>
        {
            foreach (ItemInstance item in result.Inventory)
            {
                if (item.ItemId == "AKM")
                {
                    PlayerOwnsAKM = true;
                }

                if (item.ItemId == "M4")
                {
                    PlayerOwnsM4 = true;
                }

                if (item.ItemId == "L96")
                {
                    PlayerOwnsL96 = true;
                }

                if (item.ItemId == "Glock")
                {
                    PlayerOwnsGlock = true;
                }

                if (item.ItemId == "Shotgun")
                {
                    PlayerOwnsShotgun = true;
                }
            }
        }, error =>
        {
            Alerts a = new Alerts();
            StartCoroutine(a.CreateNewAlert(error.ErrorMessage));
        });
    }
コード例 #6
0
        protected override void CalcBar()
        {
            EResolution resolution = Bars.Info.Resolution.Type;

            if (resolution < EResolution.Day || EResolution.Volume == resolution ||
                EResolution.Second == resolution || resolution > EResolution.Quarter)
            {
                if ((Bars.Time[0].Date != Bars.Time[1].Date))
                {
                    m_lowestlo.Value = Bars.Low[0];
                }
                else
                {
                    if (PublicFunctions.DoubleLess(Bars.Low[0], m_lowestlo.Value))
                    {
                        Plot1.Set(0, Bars.Low[0]);
                        Alerts.Alert();
                        m_lowestlo.Value = Bars.Low[0];
                    }
                }
            }
        }
コード例 #7
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (Alerts != false)
            {
                hash ^= Alerts.GetHashCode();
            }
            if (ExtendedProperties != false)
            {
                hash ^= ExtendedProperties.GetHashCode();
            }
            if (scope_ != null)
            {
                hash ^= Scope.GetHashCode();
            }
            if (source_ != null)
            {
                hash ^= Source.GetHashCode();
            }
            return(hash);
        }
コード例 #8
0
        public void iniciartcp()
        {
            try
            {
                int maxConect = 5;

                while (active)
                {
                    if (count < maxConect)
                    {
                        client = listener.AcceptTcpClient();
                        Console.WriteLine("Conectado");
                        c._UpdateTcpServer(this.name, Convert.ToString(this.port), this.type, "Conectado");
                        /*********************************ENVIO A TCPPROCESS***************************************/
                        TCPClientData tcpClienData = new TCPClientData(this, client, Convert.ToString(count), listClient);
                        listClient.Add(tcpClienData);
                        tcpClienData.iniciarTcp();

                        /// <summary>
                        /// Area de almacenamiento de conexiones
                        /// </summary>

                        /*string ipconexion = ((IPEndPoint)client.Client.RemoteEndPoint).Address.ToString();
                         * string hour = DateTime.Now.ToString("hh:mm:ss");
                         * xmlConnection._Add(ipconexion,hour);*/
                        count++;
                    }
                    else
                    {
                        Alerts.ShowInformation("Maximo de conecciones alcanzadas\n¡No se aceptaran más conecciones!");
                        active = false;
                    }
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message.ToString());
            }
        }
コード例 #9
0
        protected override void CalcBar()
        {
            m_mymacd.Value = m_macd1[0];
            var m_macdavg = m_xaverage1[0];

            m_macddiff.Value = m_mymacd.Value - m_macdavg;
            Plot1.Set(0, m_mymacd.Value);
            Plot2.Set(0, m_macdavg);
            Plot3.Set(0, m_macddiff.Value);
            Plot4.Set(0, 0);
            if (this.CrossesOver(m_macddiff, 0))
            {
                Alerts.Alert("Bullish alert");
            }
            else
            {
                if (this.CrossesUnder(m_macddiff, 0))
                {
                    Alerts.Alert("Bearish alert");
                }
            }
        }
コード例 #10
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //RedirectToLoginIfNecessary();

            var contact = Contact;

            if (contact != null)
            {
                var homeAlertsSavedQuery = XrmContext.CreateQuery("savedquery").FirstOrDefault(query => query.GetAttributeValue <OptionSetValue>("statecode") != null && query.GetAttributeValue <OptionSetValue>("statecode").Value == 0 && query.GetAttributeValue <string>("name") == HomeAlertsSavedQueryName);

                var alerts = Opportunities.Where(opp => (opp.GetAttributeValue <OptionSetValue>("statuscode") != null && opp.GetAttributeValue <OptionSetValue>("statuscode").Value == (int)Adxstudio.Xrm.Partner.Enums.OpportunityStatusReason.Delivered) ||
                                                 XrmContext.GetOpportunityLatestStatusModifiedOn(opp) <= DateTime.Now.AddDays(-ServiceContext.GetInactiveDaysUntilOverdue(Website)))
                             .OrderByDescending(opp => GetAlertType(opp.Id)).ThenBy(opp => opp.GetRelatedEntity(XrmContext, new Relationship("opportunity_customer_accounts")).GetAttributeValue <string>("name"));

                var columnsGenerator = new SavedQueryColumnsGenerator(XrmContext, homeAlertsSavedQuery);

                Alerts.DataKeyNames     = new[] { "opportunityid" };
                Alerts.DataSource       = columnsGenerator.ToDataTable(alerts);
                Alerts.ColumnsGenerator = columnsGenerator;
                Alerts.DataBind();

                var newOpportunities = Opportunities.Where(opp => opp.GetAttributeValue <OptionSetValue>("statuscode") != null && opp.GetAttributeValue <OptionSetValue>("statuscode").Value ==
                                                           (int)Adxstudio.Xrm.Partner.Enums.OpportunityStatusReason.Delivered);

                NewOpportunityCount.Text = newOpportunities.Count().ToString();
                NewOpportunityValue.Text = newOpportunities.Where(o => o.GetAttributeValue <Money>("estimatedvalue") != null).Sum(opp => opp.GetAttributeValue <Money>("estimatedvalue").Value).ToString("C");

                var acceptedOpportunities = Opportunities.Where(opp => opp.GetAttributeValue <OptionSetValue>("statuscode") != null && opp.GetAttributeValue <OptionSetValue>("statuscode").Value !=
                                                                (int)Adxstudio.Xrm.Partner.Enums.OpportunityStatusReason.Delivered);

                AcceptedOpportunityCount.Text = acceptedOpportunities.Count().ToString();
                AcceptedOpportunityValue.Text = acceptedOpportunities.Where(o => o.GetAttributeValue <Money>("estimatedvalue") != null).Sum(opp => opp.GetAttributeValue <Money>("estimatedvalue").Value).ToString("C");
            }
            else
            {
                PartnerHomePanel.Visible = false;
            }
        }
コード例 #11
0
        public async Task <IActionResult> OnGet()
        {
            if (User?.Identity?.IsAuthenticated == true)
            {
                var user = _dataService.GetUserByName(User.Identity.Name);
                if (user is null)
                {
                    await _signInManager.SignOutAsync();

                    return(RedirectToPage());
                }

                if (_appConfig.Require2FA && !user.TwoFactorEnabled)
                {
                    return(RedirectToPage("TwoFactorRequired"));
                }

                DefaultPrompt = _dataService.GetDefaultPrompt(User.Identity.Name);
                var groups = _dataService.GetDeviceGroups(User.Identity.Name);
                if (groups?.Any() == true)
                {
                    DeviceGroups.AddRange(groups.Select(x => new SelectListItem(x.Name, x.ID)));
                }
                var alerts = _dataService.GetAlerts(user.Id);
                if (alerts.Any())
                {
                    Alerts.AddRange(alerts);
                }

                Motd = _appConfig.MessageOfTheDay;
            }
            else
            {
                DefaultPrompt = _dataService.GetDefaultPrompt();
            }

            return(Page());
        }
コード例 #12
0
        protected override void CalcBar()
        {
            m_avgdouble.Value = m_dema[0];
            // indicator logic
            if (((Displace >= 0) || Bars.CurrentBar > Math.Abs(Displace)))
            {
                Plot1.Set(Displace, m_avgdouble.Value);
            }
            if (BreakSignal)
            {
                if (m_dema[0] >= Bars.Close[0])
                {
                    if (!MarketStage.Equals("Falling"))
                    {
                        MarketStage = "Falling";
                        Alerts.Alert("Get ready for the falling trend start");
                    }
                    CellColor = Color.Red;
                                        #if DEBUG
                    //Output.WriteLine("Be ready for break down");
                                        #endif
                }
                else if (m_dema[0] <= Bars.Close[0])
                {
                    if (!MarketStage.Equals("Rising"))
                    {
                        MarketStage = "Rising";
                        Alerts.Alert("Get ready for the rising trend start");
                    }
                    CellColor = Color.Green;
                                        #if DEBUG
                    //Output.WriteLine("Be ready for break up");
                                        #endif
                }
            }

            Plot2.Set(MarketStage, CellColor);
        }
コード例 #13
0
        public int insert(entitie.Register obj)
        {
            try
            {
                cmd.CommandText = "insert into pessoas (nome, sexo, estado_civil, email, rg, cpf, cargo, situacao," +
                                  " id_congregacao) " +
                                  "values(?,?,?,?,?,?,?,?,?)";


                cmd.Parameters.Add("1", MySqlDbType.VarChar, 50).Value = obj.Nome;
                cmd.Parameters.Add("2", MySqlDbType.VarChar, 1).Value  = obj.Sexo;
                cmd.Parameters.Add("3", MySqlDbType.VarChar, 20).Value = obj.EstadoCivil;
                cmd.Parameters.Add("4", MySqlDbType.VarChar, 30).Value = obj.Email;
                cmd.Parameters.Add("5", MySqlDbType.VarChar, 15).Value = obj.Rg;
                cmd.Parameters.Add("6", MySqlDbType.VarChar, 15).Value = obj.Cpf;
                cmd.Parameters.Add("7", MySqlDbType.VarChar, 30).Value = obj.Cargo;
                cmd.Parameters.Add("8", MySqlDbType.VarChar, 30).Value = obj.Situacao;
                cmd.Parameters.Add("9", MySqlDbType.VarChar, 30).Value = obj.Congregacao;

                cmd.Connection = DB.conectar();
                cmd.ExecuteNonQuery();


                Alerts.showAlert("Dados Cadastrados com Sucesso", "", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return(1);
            }
            catch (Exception e)
            {
                Alerts.showAlert(e.Message, "Falha ao inserir", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return(0);
            }
            finally
            {
                cmd.Parameters.Clear();

                DB.desconectar();
            }
        }
コード例 #14
0
 private void Save()
 {
     if (ValidateInputs())
     {
         try
         {
             if (IsClient())
             {
                 if (_ctrCliente.PrepareSave())
                 {
                     BindClientFormData();
                     _userRegistrationService.RegisterClient(_clienteRegistracionDTO);
                     Alerts.ShowInfo(MSG_USER_REGISTRATION_SAVE_CLIENT_SUCESS);
                     _parent.BackToPreviousForm(this);
                 }
             }
         }
         catch (Exception ex)
         {
             Alerts.ShowWarning(ex.Message);
         }
     }
 }
コード例 #15
0
        private async Task <bool> SignIn()
        {
            if (string.IsNullOrEmpty(EmployeeCardNumberEntryText) || string.IsNullOrEmpty(PasswordEntryText))
            {
                Alerts.PopAlertMessage("Invalid Fields", "Please fill in all the fields");
                return(false);
            }

            bool isEmployee = int.TryParse(EmployeeCardNumberEntryText, out int employeeNumber);

            _employeeNumber = employeeNumber;
            _password       = PasswordEntryText;

            User newUser = new User()
            {
                EmployeeCardNumber = _employeeNumber,
                Password           = _password,
            };

            UserApiRequest request = new UserApiRequest();

            return(await request.SignInRequest(newUser));
        }
コード例 #16
0
ファイル: PopUpGridSearch.cs プロジェクト: iConsu/Biblioteca
 private void ButtonCreateReport_Click(object sender, EventArgs e)
 {
     if (GridSearch.Rows.Count > 0)
     {
         using (SaveFileDialog ObjDialog = new SaveFileDialog()
         {
             Filter = "Excel Workbook|*xls"
         })
         {
             if (ObjDialog.ShowDialog() == DialogResult.OK)
             {
                 using (CreateExcel ObjExcel = new CreateExcel())
                 {
                     ObjExcel.ExportDataGridView(ObjDialog.FileName, (DataTable)GridSearch.DataSource);
                     using (Alerts ObjAlerts = new Alerts("Información Exportada", "", "La información de su reporte fue exportada en Excel (formato \".xls\").\n\nSe generó un reporte con " + GridSearch.Rows.Count.ToString() + " filas.", 1))
                     {
                         ObjAlerts.ShowDialog();
                     }
                 }
             }
         }
     }
 }
コード例 #17
0
    public override void UpdateNormState(EntityUid entity, FixedPoint2 threshold)
    {
        base.UpdateNormState(entity, threshold);

        if (!TryComp <DamageableComponent>(entity, out var damageable))
        {
            return;
        }

        if (!TryComp <MobStateComponent>(entity, out var stateComponent))
        {
            return;
        }

        short modifier = 0;

        if (TryGetEarliestIncapacitatedState(stateComponent, threshold, out _, out var earliestThreshold) && damageable.TotalDamage != 0)
        {
            modifier = (short)(damageable.TotalDamage / (earliestThreshold / 5) + 1);
        }

        Alerts.ShowAlert(entity, AlertType.HumanHealth, modifier);
    }
コード例 #18
0
        private void RegisterToChanges()
        {
            ShowObserved.PropertyChanged += (sender, args) =>
            {
                AlertsToSee = ShowObserved.Value ? Alerts : UnobservedAlerts;
                OnPropertyChanged(() => AlertsToSee);
            };

            ServerAlerts.CollectionChanged += (sender, args) =>
            {
                Alerts.Clear();
                foreach (var serverAlert in ServerAlerts)
                {
                    Alerts.Add(new AlertProxy(serverAlert));
                }
            };

            ShowObserved.Value = false;

            Alerts.CollectionChanged += (sender, args) => UpdateUnobserved();

            OnPropertyChanged(() => ServerAlerts);
        }
コード例 #19
0
        protected async Task <HttpResponseMessage> GenerateGetRequest(string endPoint)
        {
            try
            {
                var httpClient = new HttpClient();

                httpClient.DefaultRequestHeaders.Add("Authorization", $"Basic {Settings.Token}");
                httpClient.DefaultRequestHeaders.Add("Id", $"{Settings.UserId}");

                var response = await httpClient.GetAsync(endPoint);

                if (ResponseHelper.HasHttpError(response))
                {
                    return(null);
                }
                return(response);
            }
            catch (Exception e)
            {
                Alerts.ServiceUnavailable();
                return(null);
            }
        }
コード例 #20
0
        public MainNotificationWindow()
        {
            InitializeComponent();
            alerts = new Alerts(taskbarIcon);
            this.alertList.objectList.ItemsSource = this.alerts.List;

            dispatcherTimer = new DispatcherTimer();
            dispatcherTimer.Tick += new EventHandler(dispatcherTimer_Tick);
            dispatcherTimer.Interval = new TimeSpan(0, 0, 1);
            dispatcherTimer.Start();

            if (WarframeUnity.Properties.Settings.Default.ShowAll)
            {
                ProgramOptions.ShowAll = true;
            }
            else
            {
                ProgramOptions.ShowAll = false;
            }
            ProgramOptions.MinCredits = Int32.Parse(WarframeUnity.Properties.Settings.Default.MinCredits);
            ProgramOptions.Sound = GetSound(WarframeUnity.Properties.Settings.Default.Sound);
            ProgramOptions.PlaySound = WarframeUnity.Properties.Settings.Default.PlaySound;
        }
コード例 #21
0
 protected override void CalcBar()
 {
     if (m_pivotreversalgen1[0] == 1)
     {
         Plot1.Set(0, m_opivotprice.Value);
         if ((colorscheme == 1))
         {
             Plot1.Colors[0] = plotcolor;
         }
         else
         {
             if ((colorscheme == 2))
             {
                 Plot1.BGColor = plotcolor;
             }
         }
         Alerts.Alert(((((("Pivot reversal: Lo = " + Math.Round(m_opivotprice.Value, 2))
                          + ", RS = ")
                         + Math.Round(m_opivotrstren.Value, 0))
                        + ", LS = ")
                       + Math.Round(m_opivotlstren.Value, 0)));
     }
 }
コード例 #22
0
        protected override void CalcBar()
        {
            EResolution resolution = Bars.Info.Resolution.Type;

            if (resolution > EResolution.Quarter)
            {
                return;
            }

            if ((Bars.Time[0].Year != Bars.Time[1].Year))
            {
                m_highesthi.Value = Bars.High[0];
            }
            else
            {
                if (PublicFunctions.DoubleGreater(Bars.High[0], m_highesthi.Value))
                {
                    Plot1.Set(0, Bars.High[0]);
                    Alerts.Alert();
                    m_highesthi.Value = Bars.High[0];
                }
            }
        }
コード例 #23
0
        public AlarmControl()
        {
            entityAlarmRepository = new EntityAlarmRepository();
            authorAlarmRepository = new AuthorAlarmRepository();
            entityRepository      = new EntityRepository();

            InitializeComponent();

            try
            {
                LoadSentimentTypes();
                LoadEntities();
                LoadTimeMeasures();
                rbtnEntity_CheckedChanged(null, null);
                EnableFields(false);
                HideFields(true);
                CleanFields();
            }
            catch (DatabaseException ex)
            {
                Alerts.CrashApp(ex.Message);
            }
        }
コード例 #24
0

        
コード例 #25
0
 protected override void CalcBar()
 {
     if (m_criteria(0))
     {
         var m_count = m_criteria.CountIF(length);
         if (PublicFunctions.DoubleGreaterEquals(m_count, occur))
         {
             Plot1.Set(0, Bars.High[0]);
             Alerts.Alert();
             if (showtext)
             {
                 m_textid        = DrwText.Create(new ChartPoint(Bars.Time[0], Bars.High[0]), m_count.ToString());
                 m_textid.HStyle = ETextStyleH.Center;
                 m_textid.VStyle = ETextStyleV.Above;
                 m_textid.Color  = textcolor;
             }
         }
     }
     else
     {
         Plot1.Reset();
     }
 }
コード例 #26
0
        public async Task Create()
        {
            // Arrange
            var type       = AlertType.StatsNotification;
            var emailTo    = "*****@*****.**";
            var frequency  = Frequency.Weekly;
            var percentage = 75;

            var mockHttp = new MockHttpMessageHandler();

            mockHttp.Expect(HttpMethod.Post, Utils.GetSendGridApiUri(ENDPOINT)).Respond("application/json", SINGLE_ALERT_JSON);

            var client = Utils.GetFluentClient(mockHttp);
            var alerts = new Alerts(client);

            // Act
            var result = await alerts.CreateAsync(type, emailTo, frequency, percentage, null, CancellationToken.None).ConfigureAwait(false);

            // Assert
            mockHttp.VerifyNoOutstandingExpectation();
            mockHttp.VerifyNoOutstandingRequest();
            result.ShouldNotBeNull();
        }
コード例 #27
0
 private void Save()
 {
     if (ValidateInputs())
     {
         try
         {
             BindFormData();
             if (_ctrlCliente.VerifyIsCreditCardExist(_tarjetaCreditoDTO))
             {
                 Alerts.ShowWarning(MSG_CREDIT_CARD_EXISTING);
             }
             else
             {
                 _ctrlCliente.AddCreditCard(_tarjetaCreditoDTO);
                 _parent.CloseForm(this);
             }
         }
         catch (Exception ex)
         {
             Alerts.ShowWarning(ex.Message);
         }
     }
 }
コード例 #28
0
        private void btnDelete_Click(object sender, EventArgs e)
        {
            if (tablaRuteo.CurrentRow.Selected)
            {
                try
                {
                    if (Alerts.ShowWarning("¿Seguro deseas eliminar esta fila?"))
                    {
                        string serverName = tablaRuteo.Rows[tablaRuteo.CurrentRow.Index].Cells["ServerName"].Value.ToString();
                        string serverType = tablaRuteo.Rows[tablaRuteo.CurrentRow.Index].Cells["ServerType"].Value.ToString();
                        string modemName  = tablaRuteo.Rows[tablaRuteo.CurrentRow.Index].Cells["ModemName"].Value.ToString();
                        string modemType  = tablaRuteo.Rows[tablaRuteo.CurrentRow.Index].Cells["ModemType"].Value.ToString();

                        string serverid = tablaRuteo.Rows[tablaRuteo.CurrentRow.Index].Cells["IdServer"].Value.ToString();
                        string modemid  = tablaRuteo.Rows[tablaRuteo.CurrentRow.Index].Cells["IdModem"].Value.ToString();


                        if (r._FindNodoBeforeDelete(serverName, serverType, modemName, modemType, serverid, modemid))
                        {
                            r._DeleteNodo(serverName, serverType, modemName, modemType, serverid, modemid);
                            Alerts.ShowSuccess("Se ha borrado corectamente,\n No se requiere guardar despues de eliminar");
                        }

                        tablaRuteo.Rows.Remove(tablaRuteo.CurrentRow);
                    }
                }
                catch (XmlException xe)
                {
                    Console.WriteLine(xe.Message.ToString());
                    Alerts.ShowError("Esta fila no se puede eliminar");
                }
            }
            else
            {
                Alerts.ShowInformation("Seleccione la fila que desea eliminar");
            }
        }
コード例 #29
0
        public async Task MuteUser(SocketGuildUser user)
        {
            var muter = Context.User as SocketGuildUser;
            var guild = Context.Guild as SocketGuild;

            if (muter.Id == user.Id)
            {
                await Context.Channel.SendMessageAsync("You cannot mute yourself.");

                return;
            }

            if (muter.Hierarchy <= user.Hierarchy)
            {
                await Context.Channel.SendMessageAsync(Alerts.GetAlert("MUTEHIGHERWARNING"));

                return;
            }

            var mutedRole = Context.Guild.Roles.FirstOrDefault(x => x.Name == "Silenced");

            if (user.Roles.Contains(mutedRole))
            {
                await Context.Channel.SendMessageAsync(String.Format("{0} is already muted.", user.Username));

                return;
            }

            if (mutedRole == null)
            {
                await guild.CreateRoleAsync("Silenced");
            }

            await user.AddRoleAsync(mutedRole);

            await Context.Channel.SendMessageAsync(String.Format("{0} is now muted.", user.Username));
        }  // end public async Task MuteUser(SocketGuildUser user)
コード例 #30
0
        protected override void CalcBar()
        {
            m_mom.Value = m_price.Momentum(length);
            var m_accel = m_mom.Momentum(1);

            Plot1.Set(0, m_mom.Value);
            Plot2.Set(0, 0);
            if (!upcolor.IsEmpty && !dncolor.IsEmpty)
            {
                var m_colorlevel = m_normgradientcolor1[0];
                if (m_applicationtype == 1)
                {
                    Plot1.Colors[0] = m_colorlevel;
                }
                else
                {
                    if (m_applicationtype > 1)
                    {
                        Plot1.Colors[0] = gridforegroundcolor;
                        Plot1.BGColor   = m_colorlevel;
                    }
                }
            }
            if (PublicFunctions.DoubleGreater(m_mom.Value, 0) &&
                PublicFunctions.DoubleGreater(m_accel, 0))
            {
                Alerts.Alert("Indicator positive and increasing");
            }
            else
            {
                if (PublicFunctions.DoubleLess(m_mom.Value, 0) &&
                    PublicFunctions.DoubleLess(m_accel, 0))
                {
                    Alerts.Alert("Indicator negative and decreasing");
                }
            }
        }
コード例 #31
0
        public virtual async Task <IActionResult> OnPostAsync()
        {
            try
            {
                ValidateModel();

                await AccountAppService.ResetPasswordAsync(
                    new ResetPasswordDto
                {
                    UserId     = UserId,
                    ResetToken = ResetToken,
                    Password   = Password
                }
                    );
            }
            catch (AbpIdentityResultException e)
            {
                if (!string.IsNullOrWhiteSpace(e.Message))
                {
                    Alerts.Warning(GetLocalizeExceptionMessage(e));
                    return(Page());
                }

                throw;
            }
            catch (AbpValidationException e)
            {
                return(Page());
            }

            //TODO: Try to automatically login!
            return(RedirectToPage("./ResetPasswordConfirmation", new
            {
                returnUrl = ReturnUrl,
                returnUrlHash = ReturnUrlHash
            }));
        }
コード例 #32
0
    /// <summary>
    /// แสดง ColorBox เป็นกล่องข้อความเตือน
    /// </summary>
    /// <param name="Header">ข้อความ</param>
    /// <param name="Message">ข้อความ</param>
    /// <param name="Width">กว้าง</param>
    /// <param name="Height">สูง</param>
    /// <param name="AlertImage">ภาพ</param>
    public void Alert(string Header = "ข้อความเตือน", string Message = "โปรดกรอกรายละเอียด", string Width = "inherit", string Height = "inherit", Alerts AlertImage = Alerts.Info)
    {
        #region Variable
        alertHeader = Header;
        alertMessage = Message;
        _width = Width;
        _height = Height;
        if (AlertImage != Alerts.None)
        {
            alert = "<img src='" + ResolveClientUrl("Images/Alert/" + AlertImage.ToString() + ".png") + "' alt='Alert'/>";
        }
        else
        {
            alert = "";
        }
        #endregion

        if (Width != "inherit" || Height != "inherit")
        {
            Page.ClientScript.RegisterStartupScript(Page.GetType(),
                "ColorBoxAlert" + _uid + "",
                "ColorBoxAlert" + _uid + "();",
                true);
        }
        else
        {
            Page.ClientScript.RegisterStartupScript(Page.GetType(),
                "ColorBoxAlert" + _uid + "",
                "ColorBoxAlert" + _uid + "();ColorBoxAlertResize" + _uid + "();",
                true);
        }
    }