Example #1
0
        public List <Book> GetFiltratedBooks(string namePart, bool?isFree, int fromYear, int toYear, List <int> authorsId)
        {
            if (fromYear == 0)
            {
                return(GetBooksByNamePart(namePart));
            }

            List <Book> books = _db.Books.Where(b => b.EditionYear.Year >= fromYear &&
                                                b.EditionYear.Year <= toYear).ToList();

            if (!authorsId.Equals(null) && !authorsId.Count.Equals(0))
            {
                books = books.Where(b => b.BookAuthors.Any(ba => authorsId.Contains(ba.AuthorId))).ToList();
            }

            if (!namePart.Equals(null) && !namePart.Length.Equals(0))
            {
                books = books.Where(b => b.Name.ToUpper().Contains(namePart.ToUpper())).ToList();
            }

            if (isFree.Equals(true))
            {
                books = books.Where(b => b.BookCopies.Any(bc => bc.BookCopyInDeals.All(bcd => bcd.ActualDateOfReturning.HasValue) ||
                                                          bc.BookCopyInDeals.Count.Equals(0))).ToList();
            }
            else if (isFree.Equals(false))
            {
                books = books.Where(b => b.BookCopies.All(bc => bc.BookCopyInDeals.Any(bcd => !bcd.ActualDateOfReturning.HasValue) &&
                                                          !bc.BookCopyInDeals.Count.Equals(0))).ToList();
            }
            books = books.ToList();

            return(books);
        }
Example #2
0
        public char?convertToChar(bool?statement)
        {
            char?result = null;

            if (statement.Equals(true))
            {
                result = 'Y';
            }
            else if (statement.Equals(false))
            {
                result = 'N';
            }
            return(result);
        }
        public string Dodeli_predmet_profesoru(UInt32 profesor, UInt32 predmet, sbyte tip)
        {
            bool?status = null;

            using (MySqlConnection con = new MySqlConnection(Baza.KONEKCIJA))
            {
                con.Open();

                string rtn = "dodaj_profesor_predmet_par";

                MySqlCommand cmd = new MySqlCommand(rtn, con);
                cmd.CommandType = CommandType.StoredProcedure;

                cmd.Parameters.AddWithValue("@profesor_in", profesor);
                cmd.Parameters.AddWithValue("@predmet_in", predmet);
                cmd.Parameters.AddWithValue("@tip_in", tip);


                MySqlDataReader rdr = cmd.ExecuteReader();

                if (rdr.Read())
                {
                    status = rdr.GetBoolean(rdr.GetOrdinal("msg"));
                }
            }
            if (status.Equals(null))
            {
                throw new Exception("greška prilikom dodavanja profesora predmetu, baza nije vratila odgovor");
            }
            else if ((bool)!status)
            {
                return("Profesor je već dodeljen datom predmetu.");
            }
            return("Profesoru uspešno dodeljen predmet.");
        }
Example #4
0
        public async Task <PaginationViewModel> GetPaginationAsync(string search, bool?lowScore, string userId, int offset, int limit, bool?done)
        {
            var result   = new PaginationViewModel();
            var sqlWhere = new StringBuilder();

            sqlWhere.Append($" WHERE (\"UserId\"=@userId ");
            if (!string.IsNullOrEmpty(search))//是否含有关键字搜索
            {
                sqlWhere.Append($"AND (\"Title\" LIKE '%{search.ReplaceSqlChars()}%' OR \"Remarks\" LIKE '%{search.ReplaceSqlChars()}%') ");
            }
            if (done.HasValue && done.Equals(true)) //是否归档
            {
                sqlWhere.Append($"AND \"IsDone\" = {done} ");
            }
            if (lowScore.HasValue && lowScore.Equals(true))
            {
                sqlWhere.Append($"AND \"Score\" < 3 ");
            }
            sqlWhere.Append(")");
            //查询搜索总数
            string selectCount = "SELECT COUNT(*) FROM \"public\".\"ServiceRecords\"" + sqlWhere;
            int    dataCount   = await _context.SqlQueryFirstAsync <int>(selectCount, new { userId });

            //查询数据
            var selectData = "SELECT * FROM \"public\".\"ServiceRecords\" " + sqlWhere + $" order by \"IsDone\", \"EndOfServiceTime\" LIMIT {limit} OFFSET {offset}";
            var data       = await _context.SqlQueryAsync <ServiceRecord>(selectData, new { userId });

            result.Total = dataCount;
            result.Rows  = data;
            return(result);
        }
Example #5
0
 /// <summary>
 /// Returns true if this attribute specifies the same name and configuration as the given attribute.
 /// </summary>
 /// <param name="other">The attribute to compare.</param>
 /// <returns>True if the other object is equal to this object; otherwise false.</returns>
 protected virtual bool Equals(IndexAttribute other)
 {
     return(_name == other._name &&
            _order == other._order &&
            _isClustered.Equals(other._isClustered) &&
            _isUnique.Equals(other._isUnique));
 }
Example #6
0
        public override bool Equals(object x, object y)
        {
            //get boxed values.
            bool?xTyped = (bool?)x;

            return(xTyped.Equals(y));
        }
Example #7
0
        private void TratarComboStatusOferta(GridViewRowEventArgs e)
        {
            if (isAdmin.Equals(null))
            {
                isAdmin = bmUsuario.PerfilAdministrador();
            }

            //Procura o dropdownlist de status oferta nas linhas da grid
            DropDownList ddlStatusOferta = (DropDownList)e.Row.FindControl("ddlStatusOferta");

            if (ddlStatusOferta != null)
            {
                Dominio.Classes.MatriculaCapacitacao matriculaCapacitacao = (Dominio.Classes.MatriculaCapacitacao)e.Row.DataItem;

                if (matriculaCapacitacao != null)
                {
                    IList <StatusMatricula> listaStatusMatricula = new BMStatusMatricula().ObterTodosIncluindoEspecificos();//new ManterStatusMatricula().ObterTodosStatusMatricula();

                    int idStatusMatricula = (int)matriculaCapacitacao.StatusMatricula;
                    WebFormHelper.PreencherLista(listaStatusMatricula, ddlStatusOferta);
                    WebFormHelper.SetarValorNaCombo(idStatusMatricula.ToString(), ddlStatusOferta);

                    // Caso não seja administrador e a capacitação não permitir a alteração de status pelo gestor
                    if (isAdmin.HasValue && !isAdmin.Value && !matriculaCapacitacao.Capacitacao.PermiteAlterarSituacao)
                    {
                        ddlStatusOferta.Enabled = false;
                    }
                }
            }
        }
        public override bool Equals(object obj)
        {
            if (this == obj)
            {
                return(true);
            }
            //if (o == null || GetType() != o.GetType()) return false;

            ReaderConditional that = obj as ReaderConditional;

            if (that == null)
            {
                return(false);
            }

            if (_form != null ? !_form.Equals(that._form) : that._form != null)
            {
                return(false);
            }
            if (_splicing != null ? (!_splicing.Equals(that._splicing)) : (that._splicing != null))
            {
                return(false);
            }
            return(true);
        }
Example #9
0
 private void PopupLoginPage(object obj)
 {
     if (LoginUser == null)
     {
         bool?result = Common.StaticUtils.ShowLoginWindow();
         if (result.Equals(true))
         {
             LoginText  = Properties.Resources.LOGOUT_TEXT;
             IsLogin    = true;
             UserName   = LoginUser.USER_NM;
             UserNumber = LoginUser.USER_NO;
         }
         else
         {
             LoginText  = Properties.Resources.LOGIN_TEXT;
             IsLogin    = false;
             UserName   = string.Empty;
             UserNumber = string.Empty;
         }
     }
     else
     {
         string           messageBoxText = "로그아웃 했다";
         string           caption        = "랄라";
         MessageBoxButton button         = MessageBoxButton.OK;
         MessageBoxImage  icon           = MessageBoxImage.Warning;
         MessageBox.Show(messageBoxText, caption, button, icon);
         LoginUser  = null;
         LoginText  = "로그인";
         IsLogin    = false;
         UserName   = "";
         UserNumber = string.Empty;
     }
 }
        public IEnumerable <Bewoner> GetBy(string name = null, bool?EetOpKamer = null, bool?WordtGehaald = null)
        {
            var bewoners = _bewoners.AsQueryable();

            if (!string.IsNullOrEmpty(name))
            {
                bewoners = _bewoners.Where(r => r.Name.IndexOf(name) >= 0);
            }
            if (EetOpKamer.Equals(true))
            {
                bewoners = _bewoners.Where(r => r.EetOpKamer == EetOpKamer);
            }
            else
            {
                bewoners = _bewoners.Where(r => r.EetOpKamer != EetOpKamer);
            }
            if (WordtGehaald.Equals(true))
            {
                bewoners = _bewoners.Where(r => r.WordtGehaald == WordtGehaald);
            }
            else
            {
                bewoners = _bewoners.Where(r => r.WordtGehaald != WordtGehaald);
            }
            return(_bewoners.OrderBy(r => r.Name).ToList());
        }
Example #11
0
        public IActionResult ChangeStatus(string menteeId, bool?isDisable)
        {
            BaseResponseDto responseDto = null;

            if (menteeId == null)
            {
                return(BadRequest("Mentee Id must not be null."));
            }
            if (isDisable.Equals(null))
            {
                return(BadRequest("Must specify isDisable parameter in order to allow this function works correctly"));
            }

            bool disable = isDisable.Value;

            try
            {
                responseDto = _mentee.ChangeStatus(menteeId, disable);
            }
            catch (Exception e)
            {
                return(StatusCode(500, e));
            }

            if (responseDto.Status == 1 || responseDto.Status == 2)
            {
                return(BadRequest(responseDto.Message));
            }

            return(disable ? Ok("Mentee is disabled.")
                : Ok("Mentee is enabled."));
        }
Example #12
0
        public Object visitBinarySentence(BinarySentence bs, Object arg)
        {
            bool?firstValue  = (bool?)bs.getFirst().accept(this, null);
            bool?secondValue = (bool?)bs.getSecond().accept(this, null);

            if (!firstValue.HasValue || !secondValue.HasValue)
            {
                // strictly not true for or/and
                // -FIX later
                return(null);
            }
            else
            {
                String op = bs.getOperator();
                if (op.Equals("AND"))
                {
                    return(firstValue.Value && secondValue.Value);
                }
                else if (op.Equals("OR"))
                {
                    return(firstValue.Value || secondValue.Value);
                }
                else if (op.Equals("=>"))
                {
                    return(!(firstValue.Value && !secondValue.Value));
                }
                else if (op.Equals("<=>"))
                {
                    return(firstValue.Equals(secondValue));
                }
                return(null);
            }
        }
Example #13
0
        public void pb_ValidarUsuario(string pe_usuChrLogin, string pe_usuBinClave, ref bool?ps_estadoProceso, ref string ps_mensaje)
        {
            try{
                char[] vCaracteres = { '@', '#', '$', '%', '^', '&', '*', '(', ')', ']', '*', '[', '!', '/', '=', '?', '¿' };

                for (int i = 0; i < pe_usuChrLogin.Length; i++)
                {
                    for (int j = 0; j < vCaracteres.Length; j++)
                    {
                        if (pe_usuChrLogin.Substring(i, 1).Equals(vCaracteres[j].ToString()))
                        {
                            ps_mensaje       = "El carácter '" + pe_usuChrLogin.Substring(i, 1) + "' no es válido como parte del nombre de usuario.";
                            ps_estadoProceso = false;
                        }
                    }
                }

                if (!ps_estadoProceso.Equals(false))
                {
                    pv_ValidarUsuario(pe_usuChrLogin, pe_usuBinClave, ref ps_estadoProceso, ref ps_mensaje);
                }
            } catch (Exception ex) {
                throw ex;
            }
        }
Example #14
0
        protected override DataObject EvaluateBinary(DataObject ob1, DataObject ob2, IEvaluateContext context)
        {
            bool?b1 = ob1.ToBoolean();
            bool?b2 = ob2.ToBoolean();

            // If either ob1 or ob2 are null
            if (!b1.HasValue)
            {
                return(b2.HasValue && b2.Equals(false) ? DataObject.BooleanFalse : DataObject.BooleanNull);
            }
            if (!b2.HasValue)
            {
                return(b1.Equals(false) ? DataObject.BooleanFalse : DataObject.BooleanNull);
            }

            // If both true.
            return(DataObject.Boolean(b1.Equals(true) && b2.Equals(true)));
        }
Example #15
0
            public override DataObject Evaluate(DataObject ob1, DataObject ob2, IGroupResolver group, IVariableResolver resolver, IQueryContext context)
            {
                bool?b1 = ob1.ToBoolean();
                bool?b2 = ob2.ToBoolean();

                // If either ob1 or ob2 are null
                if (!b1.HasValue)
                {
                    return(b2.HasValue && b2.Equals(false) ? DataObject.BooleanFalse : DataObject.BooleanNull);
                }
                if (!b2.HasValue)
                {
                    return(b1.Equals(false) ? DataObject.BooleanFalse : DataObject.BooleanNull);
                }

                // If both true.
                return(DataObject.Boolean(b1.Equals(true) && b2.Equals(true)));
            }
Example #16
0
 bool?dependantProperty(bool?prop, bool?dependant)
 {
     if (dependant == null)
     {
         return(prop);
     }
     if (prop == null)
     {
         return(prop);
     }
     return(dependant.Equals(true) && prop.Equals(true));
 }
Example #17
0
        public ActionResult checkPassword(string MSID)
        {
            bool? result          = null;
            login toCheckPassword = new login();

            result = toCheckPassword.getPassword(MSID.ToUpper());
            if (result.Equals(false))
            {
                result = null;
            }
            return(Content(result.ToString()));
        }
Example #18
0
        public static void Main()
        {
            LoadingWindow loading = new LoadingWindow();

            bool?result = loading.ShowDialog();

            if (result.Equals(true))
            {
                Application app = new Application();
                app.StartupUri = new Uri("Windows/MainWindow.xaml", UriKind.Relative);
                app.Run();
            }
        }
Example #19
0
        void ShowLoginWindow()
        {
            this.Hide();
            var  loginWindow = new LoginWindow();
            bool?result      = loginWindow.ShowDialog();

            if (bool.Equals(result, null) ||
                result.Equals(false))
            {
                App.Current.Shutdown();
            }
            this.Show();
        }
        public static bool ImportShortcuts(ref string defaultPath)
        {
            ShortcutsImportViewModel viewModel = new ShortcutsImportViewModel();

            viewModel.ImportPath = defaultPath;

            ShortcutsImportDialog dlg = new ShortcutsImportDialog(viewModel);

            dlg.DataContext = viewModel;

            bool?wasOK = dlg.ShowDialog();

            defaultPath = viewModel.ImportPath;
            return(wasOK.HasValue && wasOK.Equals(true));
        }
Example #21
0
 public DocumentAttribute(Guid idAttribute, string name, bool isRequired, short?keyOrder,
                          DocumentAttributeMode mode, bool?isMainDate, bool?isEnumerator, string attributeType, short?conservationPosition,
                          string keyFilter, string keyFormat)
 {
     this.IdAttribute          = idAttribute;
     this.Name                 = name;
     this.IsRequired           = isRequired.Equals(1);
     this.KeyOrder             = keyOrder;
     this.Mode                 = mode;
     this.IsMainDate           = isMainDate.Equals(1);
     this.IsEnumerator         = isEnumerator.Equals(1);
     this.AttributeType        = attributeType;
     this.ConservationPosition = conservationPosition;
     this.KeyFilter            = keyFilter;
     this.KeyFormat            = keyFormat;
 }
Example #22
0
        // methods
        /// <inheritdoc/>
        public bool Equals(ClusterDescription other)
        {
            if (other == null)
            {
                return(false);
            }

            return
                (_clusterId.Equals(other._clusterId) &&
                 _connectionMode == other._connectionMode &&
                 _connectionModeSwitch == other._connectionModeSwitch &&
                 _directConnection.Equals(other._directConnection) &&
                 object.Equals(_dnsMonitorException, other._dnsMonitorException) &&
                 _servers.SequenceEqual(other._servers) &&
                 _type == other._type);
        }
        // GET: PurchasePCComponents
        public ActionResult Index(string SearchString, string CurrentFilter, int?page, string client, bool?clientRet)
        {
            if (SearchString != null)
            {
                page = 1;
            }
            else
            {
                SearchString = CurrentFilter;
            }
            ViewBag.CurrentFilter = SearchString;
            var purchase = from s in context.PurchasePCComponents
                           select s;

            purchase = purchase.Include(p => p.Component).Include(p => p.Model).Include(p => p.Supplier);
            if (!String.IsNullOrEmpty(SearchString))
            {
                purchase = purchase.Where((s => s.Model.ModelName.Contains(SearchString) || s.Specifications.Contains(SearchString)));
            }
            var GenreLst = new List <string>();
            var GenreQrt = from g in context.PurchasePCComponents
                           orderby g.Component.ComponentName
                           select g.Component.ComponentName;
            var GenreLs = new List <bool>();
            var GenreQr = from a in context.PurchasePCComponents
                          orderby a.Availabity
                          select a.Availabity;

            GenreLst.AddRange(GenreQrt.Distinct());
            GenreLs.AddRange(GenreQr.Distinct());

            if (!String.IsNullOrEmpty(client) && !client.Equals("Все"))
            {
                purchase = purchase.Where(r => r.Component.ComponentName == client);
            }
            if (clientRet != null && !clientRet.Equals("Все"))
            {
                purchase = purchase.Where(r => r.Availabity == clientRet);
            }
            ViewBag.client    = new SelectList(GenreLst, "ComponentName");
            ViewBag.clientRet = new SelectList(GenreLs, "Availabity");

            int pageSize   = 5;
            int pageNumber = (page ?? 1);

            return(View(purchase.OrderBy(e => e.Component.ComponentName).ToPagedList(pageNumber, pageSize)));
        }
        public ProductsReturn GetRecommendedItemsForCart(UserSelectedContext catalogInfo, List <string> cartItems, UserProfile profile, int?pageSize, bool?getImages)
        {
            List <RecommendedItemsModel> recommendedItems = _recommendedItemsRepository.GetRecommendedItemsForCustomer(catalogInfo.CustomerId, catalogInfo.BranchId, cartItems, 50);

            ProductsReturn productsReturn = _catalogRepository.GetProductsByIdsWithoutProprietaryItems(catalogInfo.BranchId, recommendedItems.Select(x => x.RecommendedItem).ToList());
            List <Product> validProducts  = new List <Product>();

            AddPricingInfo(productsReturn, catalogInfo);

            foreach (Product product in productsReturn.Products)
            {
                bool hasImages  = false;
                bool hasPricing = false;

                if (product.HasPrice)
                {
                    hasPricing = true;
                }

                if (product.HasPrice && getImages.HasValue == true && getImages.Value == true)
                {
                    _catalogLogic.AddProductImageInfo(product);

                    if (product.ProductImages.Any() == true)
                    {
                        hasImages = true;
                    }
                }

                if ((getImages.Equals(true) && hasImages == true) || (getImages.HasValue == false || getImages.Equals(false)))
                {
                    validProducts.Add(product);
                }

                if (pageSize.HasValue && validProducts.Count >= pageSize)
                {
                    break;
                }
            }

            productsReturn.Products = validProducts;

            GetAdditionalProductInfo(profile, productsReturn, catalogInfo, false);
            ApplyRecommendedTagging(productsReturn);

            return(productsReturn);
        }
Example #25
0
        private void contextMenuStrip1_Click(object sender, EventArgs e)
        {
            string ID = dGridAllCustomers.CurrentRow.Cells["ID"].Value.ToString();

            DialogResult result = MessageBox.Show(this, "Are Your Sure You Want to delete\nCustomer with ID " + ID, "Confirmation", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2);

            if (result == DialogResult.Yes)
            {
                bool?res = cstomerService.Delete(Convert.ToInt32(ID));

                if (res.Equals(true))
                {
                    MessageBox.Show(this, "Sucessfully Delete Customer", "Suceed", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    LoadCustomerDetails();
                }
            }
        }
        private void contextMenuStrip1_Click(object sender, EventArgs e)
        {
            string       id          = dGridAllSuppliers.CurrentRow.Cells["ID"].Value.ToString();
            DialogResult userCommand = MessageBox.Show(this, "Confirm Delete Supplier\nSupplier ID :" + id, "Confirmation", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2);

            if (userCommand == DialogResult.Yes)
            {
                bool?methodReturn = supMgr.Delete(Convert.ToInt32(id));
                if (methodReturn.Equals(true))
                {
                    MessageBox.Show(this, "Sucessfully Delete Supplier", "Suceed", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    dGridAllSuppliers.DataBindings.Clear();
                    dGridAllSuppliers.DataSource = supMgr.SelectAll();
                    dGridAllSuppliers.Refresh();
                }
            }
        }
Example #27
0
        /// <summary>
        /// Retorna um DataTable contendo as autorizações a partir de um nome
        /// </summary>
        /// <param name="nome">O nome do funcionário que possua autorização</param>
        /// <returns>DataTable com as autorizações que possuem o nome do funcionário</returns>
        public DataTable GetByNome(string nome, bool?status)
        {
            try
            {
                vw_autorizacoes = new vw_autorizacoesTableAdapter();

                if (status.Equals(null))
                {
                    return(vw_autorizacoes.GetDataByNomeTodas(nome));
                }
                return(vw_autorizacoes.GetDataByNome(nome, status));
            }
            catch (SqlException exception)
            {
                throw exception;
            }
        }
Example #28
0
        /// <summary>
        /// Retorna as autorizações  a partir do tipo de mantenedor
        /// </summary>
        /// <param name="mantenedor"></param>
        /// <param name="status"></param>
        /// <returns></returns>
        public DataTable GetByMantenedor(string mantenedor, bool?status)
        {
            try
            {
                vw_autorizacoes = new vw_autorizacoesTableAdapter();
                if (status.Equals(null))
                {
                    return(vw_autorizacoes.GetDataByMantenedorTodas(mantenedor));
                }

                return(vw_autorizacoes.GetDataByMantenedor(status, mantenedor));
            }
            catch (Exception)
            {
                throw;
            }
        }
Example #29
0
        public override bool Equals(object obj)
        {
            if (obj == null || obj.GetType() != typeof(ClusterKey))
            {
                return(false);
            }
            var rhs = (ClusterKey)obj;

            return
                (_hashCode == rhs._hashCode && // fail fast
                 _allowInsecureTls == rhs._allowInsecureTls &&
                 _applicationName == rhs._applicationName &&
                 object.ReferenceEquals(_clusterConfigurator, rhs._clusterConfigurator) &&
                 _compressors.SequenceEqual(rhs._compressors) &&
                 _connectionMode == rhs._connectionMode &&
                 _connectionModeSwitch == rhs._connectionModeSwitch &&
                 _connectTimeout == rhs._connectTimeout &&
                 _credentials.SequenceEqual(rhs._credentials) &&
                 _directConnection.Equals(rhs._directConnection) &&
                 _heartbeatInterval == rhs._heartbeatInterval &&
                 _heartbeatTimeout == rhs._heartbeatTimeout &&
                 _ipv6 == rhs._ipv6 &&
                 KmsProvidersHelper.Equals(_kmsProviders, rhs.KmsProviders) &&
                 _loadBalanced == rhs._loadBalanced &&
                 _localThreshold == rhs._localThreshold &&
                 _maxConnecting == rhs._maxConnecting &&
                 _maxConnectionIdleTime == rhs._maxConnectionIdleTime &&
                 _maxConnectionLifeTime == rhs._maxConnectionLifeTime &&
                 _maxConnectionPoolSize == rhs._maxConnectionPoolSize &&
                 _minConnectionPoolSize == rhs._minConnectionPoolSize &&
                 _receiveBufferSize == rhs._receiveBufferSize &&
                 _replicaSetName == rhs._replicaSetName &&
                 _schemaMap.IsEquivalentTo(rhs._schemaMap, object.Equals) &&
                 _scheme == rhs._scheme &&
                 _sdamLogFilename == rhs._sdamLogFilename &&
                 _sendBufferSize == rhs._sendBufferSize &&
                 _serverApi == rhs._serverApi &&
                 _servers.SequenceEqual(rhs._servers) &&
                 _serverSelectionTimeout == rhs._serverSelectionTimeout &&
                 _socketTimeout == rhs._socketTimeout &&
                 _srvMaxHosts == rhs._srvMaxHosts &&
                 object.Equals(_sslSettings, rhs._sslSettings) &&
                 _useTls == rhs._useTls &&
                 _waitQueueSize == rhs._waitQueueSize &&
                 _waitQueueTimeout == rhs._waitQueueTimeout);
        }
Example #30
0
        // public methods
        /// <summary>
        /// Indicates whether the current object is equal to another object of the same type.
        /// </summary>
        /// <param name="other">An object to compare with this object.</param>
        /// <returns>
        /// true if the current object is equal to the <paramref name="other" /> parameter; otherwise, false.
        /// </returns>
        public bool Equals(Collation other)
        {
            if (object.ReferenceEquals(other, null) || other.GetType() != typeof(Collation))
            {
                return(false);
            }

            return
                (_alternate.Equals(other._alternate) &&
                 _backwards.Equals(other._backwards) &&
                 _caseFirst.Equals(other._caseFirst) &&
                 _caseLevel.Equals(other._caseLevel) &&
                 _locale.Equals(other._locale) &&
                 _maxVariable.Equals(other._maxVariable) &&
                 _normalization.Equals(other._normalization) &&
                 _numericOrdering.Equals(other._numericOrdering) &&
                 _strength.Equals(other._strength));
        }
Example #31
0
        private void StartThread()
        {
            string windowSizeText = lTextBox.Text;
            string imagesNumberText = pTextBox.Text;
            string learningCoefficientText = aTextBox.Text;
            string maxErrorText = errorTextBox.Text;
            string maxIterationsText = nTextBox.Text;

            int windowSize = 0;
            int imagesNumber = 0;
            double learningCoefficient = 0.0;
            double maxError = 0.0;
            int maxIterations = 0;

            if (!Int32.TryParse(windowSizeText, out windowSize) ||
                !Int32.TryParse(imagesNumberText, out imagesNumber) ||
                !Double.TryParse(learningCoefficientText, out learningCoefficient) ||
                !Double.TryParse(maxErrorText, out maxError) ||
                !Int32.TryParse(maxIterationsText, out maxIterations))
            {
                return;
            }

            sequenseTextBox.IsEnabled = false;
            showIteration = showIterationCheckBox.IsChecked;
            predictedSequenceLabel.Text = "";

            if (showIteration.Equals(true))
            {
                stopButton.IsEnabled = true;
            }

            GetSequense();

            network = new Network(windowSize, imagesNumber, learningCoefficient, maxError, maxIterations);

            backgroundWorker.ProgressChanged += new ProgressChangedEventHandler(backgroundWorker_ProgressChanged);

            backgroundWorker.RunWorkerAsync(network);
        }