示例#1
0
        //get
        public ActionResult GetTicketByTitle()
        {
            string title  = Request.Form["inputStr"];
            var    result = SearchLogic.GetTicketByTitle(title);

            return(View(result));
        }
示例#2
0
 public void SetCharacterData(AuthorizedCharacterData data)
 {
     Assets               = new AssetsLogic(client, config, data);
     Bookmarks            = new BookmarksLogic(client, config, data);
     Calendar             = new CalendarLogic(client, config, data);
     Character            = new CharacterLogic(client, config, data);
     Clones               = new ClonesLogic(client, config, data);
     Contacts             = new ContactsLogic(client, config, data);
     Contracts            = new ContractsLogic(client, config, data);
     Corporation          = new CorporationLogic(client, config, data);
     FactionWarfare       = new FactionWarfareLogic(client, config, data);
     Fittings             = new FittingsLogic(client, config, data);
     Fleets               = new FleetsLogic(client, config, data);
     Industry             = new IndustryLogic(client, config, data);
     Killmails            = new KillmailsLogic(client, config, data);
     Location             = new LocationLogic(client, config, data);
     Loyalty              = new LoyaltyLogic(client, config, data);
     Mail                 = new MailLogic(client, config, data);
     Market               = new MarketLogic(client, config, data);
     Opportunities        = new OpportunitiesLogic(client, config, data);
     PlanetaryInteraction = new PlanetaryInteractionLogic(client, config, data);
     Search               = new SearchLogic(client, config, data);
     Skills               = new SkillsLogic(client, config, data);
     UserInterface        = new UserInterfaceLogic(client, config, data);
     Wallet               = new WalletLogic(client, config, data);
     Universe             = new UniverseLogic(client, config, data);
 }
    protected override void OnContentChanged() {
      base.OnContentChanged();
      if (Content != null) {
        var data = Content.Data;
        var filterLogic = new FilterLogic(data);
        var searchLogic = new SearchLogic(data, filterLogic);
        var statisticsLogic = new StatisticsLogic(data, searchLogic);
        var manipulationLogic = new ManipulationLogic(data, searchLogic, statisticsLogic);

        var viewShortcuts = new ItemList<IViewShortcut> {
          new DataGridContent(data, manipulationLogic, filterLogic),
          new StatisticsContent(statisticsLogic),

          new LineChartContent(data),
          new HistogramContent(data),
          new ScatterPlotContent(data),
          new CorrelationMatrixContent(Content),
          new DataCompletenessChartContent(searchLogic),
          
          new FilterContent(filterLogic),
          new ManipulationContent(manipulationLogic, searchLogic, filterLogic),
          new TransformationContent(data, filterLogic)
        };

        viewShortcutListView.Content = viewShortcuts.AsReadOnly();

        viewShortcutListView.ItemsListView.Items[0].Selected = true;
        viewShortcutListView.Select();

      } else {
        viewShortcutListView.Content = null;
      }
    }
示例#4
0
        private void ShowSearchLogicSelection()
        {
            var dialog = new SearchSelectorWindow(searchLogics);

            if (dialog.ShowDialog() == true)
            {
                searchLogic = dialog.SearchLogic;
            }
        }
        protected override void OnContentChanged()
        {
            base.OnContentChanged();
            if (Content != null)
            {
                var data              = Content.Data;
                var filterLogic       = new FilterLogic(data);
                var searchLogic       = new SearchLogic(data, filterLogic);
                var statisticsLogic   = new StatisticsLogic(data, searchLogic);
                var manipulationLogic = new ManipulationLogic(data, searchLogic, statisticsLogic);

                var viewShortcuts = new ItemList <IViewShortcut> {
                    new DataGridContent(data, manipulationLogic, filterLogic),
                    new StatisticsContent(statisticsLogic),

                    new LineChartContent(data),
                    new HistogramContent(data),
                    new ScatterPlotContent(data),
                    new CorrelationMatrixContent(Content),
                    new DataCompletenessChartContent(searchLogic),

                    new FilterContent(filterLogic),
                    new ManipulationContent(manipulationLogic, searchLogic, filterLogic),
                    new TransformationContent(data, filterLogic)
                };

                viewShortcutListView.Content = viewShortcuts.AsReadOnly();
                viewShortcutListView.ItemsListView.Items[0].Selected = true;
                viewShortcutListView.Select();

                applyTypeContextMenuStrip.Items.Clear();
                exportTypeContextMenuStrip.Items.Clear();
                foreach (var exportOption in Content.GetSourceExportOptions())
                {
                    var applyMenuItem = new ToolStripMenuItem(exportOption.Key)
                    {
                        Tag = exportOption.Value
                    };
                    applyMenuItem.Click += applyToolStripMenuItem_Click;
                    applyTypeContextMenuStrip.Items.Add(applyMenuItem);

                    var exportMenuItem = new ToolStripMenuItem(exportOption.Key)
                    {
                        Tag = exportOption.Value
                    };
                    exportMenuItem.Click += exportToolStripMenuItem_Click;
                    exportTypeContextMenuStrip.Items.Add(exportMenuItem);
                }
                var exportCsvMenuItem = new ToolStripMenuItem(".csv");
                exportCsvMenuItem.Click += exportCsvMenuItem_Click;
                exportTypeContextMenuStrip.Items.Add(exportCsvMenuItem);
            }
            else
            {
                viewShortcutListView.Content = null;
            }
        }
示例#6
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="config"></param>
        public EsiClient(IOptions <EsiConfig> _config)
        {
            config = _config.Value;
            client = new HttpClient(new HttpClientHandler
            {
                AutomaticDecompression = DecompressionMethods.GZip | DecompressionMethods.Deflate
            });

            // Enforce user agent value
            if (string.IsNullOrEmpty(config.UserAgent))
            {
                throw new ArgumentException("For your protection, please provide an X-User-Agent value. This can be your character name and/or project name. CCP will be more likely to contact you rather than just cut off access to ESI if you provide something that can identify you within the New Eden galaxy.");
            }
            else
            {
                client.DefaultRequestHeaders.Add("X-User-Agent", config.UserAgent);
            }

            client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
            client.DefaultRequestHeaders.AcceptEncoding.Add(new StringWithQualityHeaderValue("gzip"));
            client.DefaultRequestHeaders.AcceptEncoding.Add(new StringWithQualityHeaderValue("deflate"));

            SSO                  = new SsoLogic(client, config);
            Alliance             = new AllianceLogic(client, config);
            Assets               = new AssetsLogic(client, config);
            Bookmarks            = new BookmarksLogic(client, config);
            Calendar             = new CalendarLogic(client, config);
            Character            = new CharacterLogic(client, config);
            Clones               = new ClonesLogic(client, config);
            Contacts             = new ContactsLogic(client, config);
            Contracts            = new ContractsLogic(client, config);
            Corporation          = new CorporationLogic(client, config);
            Dogma                = new DogmaLogic(client, config);
            FactionWarfare       = new FactionWarfareLogic(client, config);
            Fittings             = new FittingsLogic(client, config);
            Fleets               = new FleetsLogic(client, config);
            Incursions           = new IncursionsLogic(client, config);
            Industry             = new IndustryLogic(client, config);
            Insurance            = new InsuranceLogic(client, config);
            Killmails            = new KillmailsLogic(client, config);
            Location             = new LocationLogic(client, config);
            Loyalty              = new LoyaltyLogic(client, config);
            Mail                 = new MailLogic(client, config);
            Market               = new MarketLogic(client, config);
            Opportunities        = new OpportunitiesLogic(client, config);
            PlanetaryInteraction = new PlanetaryInteractionLogic(client, config);
            Routes               = new RoutesLogic(client, config);
            Search               = new SearchLogic(client, config);
            Skills               = new SkillsLogic(client, config);
            Sovereignty          = new SovereigntyLogic(client, config);
            Status               = new StatusLogic(client, config);
            Universe             = new UniverseLogic(client, config);
            UserInterface        = new UserInterfaceLogic(client, config);
            Wallet               = new WalletLogic(client, config);
            Wars                 = new WarsLogic(client, config);
        }
示例#7
0
 public ActionResult Index(DictionaryModel objDctionaryModel)
 {
     if (ModelState.IsValid)
     {
         SearchLogic objSearchLogic = new SearchLogic();
         objDctionaryModel.SearchResult = objSearchLogic.SearchModel(objDctionaryModel.Search);
         return(View(objDctionaryModel));
         //return PartialView("WordListPartial", objDctionaryModel);
     }
     return(View(objDctionaryModel));
 }
 /// <summary>
 /// set the enum for logic based on radio selection
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void rbAndLogic_CheckedChanged(object sender, EventArgs e)
 {
     if (rbAndLogic.Checked)
     {
         currentSearchLogic = SearchLogic.AND;
     }
     else
     {
         currentSearchLogic = SearchLogic.OR;
     }
 }
示例#9
0
 /// <summary>
 /// Return all vehicles that available for rent between two dates
 /// All the logic to know if the vehicle available or not supplied in the BL
 ///
 /// After this The filter menu displayed
 /// </summary>
 /// <param name="startDate">The start date</param>
 /// <param name="endDate">The end date</param>
 /// <returns>To ajax list of vehicle types / BadRequest</returns>
 public ActionResult SearchResults(DateTime?startDate, DateTime?endDate)
 {
     try
     {
         SearchLogic logic = new SearchLogic();
         return(Json(logic.SearchByDates(startDate.Value, endDate.Value), JsonRequestBehavior.AllowGet));
     }
     catch (Exception)
     {
         return(new HttpStatusCodeResult(HttpStatusCode.BadRequest, "We have problem on the server, Please try again later!"));
     }
 }
        public void FindStr_False()
        {
            List <string[]> list = new List <string[]>
            {
                new string[] { "1", "one" },
                new string[] { "2", "two" },
                new string[] { "3", "three" },
            };
            var result = SearchLogic.Search(list, "four");

            Assert.AreEqual(0, result.Count);
            Assert.IsNull(result.FirstOrDefault());
        }
示例#11
0
        public ActionResult Search(SearchModel searchmodel)
        {
            var search = new SearchLogic(db);
            var model  = search.GetProducts(searchmodel);

            return(View(new FilmesViewModel
            {
                Filmes = model.ToList(),
                User = db.Users.Find(User.Identity.GetUserId()),
                UserFilmes = db.UserFilmes.ToList()
            }));
            //return View(model);
        }
示例#12
0
        public void Search(string searchValue, string path)
        {
            ResetCounters();

            // Add new Search to DB and get a new SearchID
            #region GetSearchID
            int SearchID;
            using (SearchLogic logic = new SearchLogic())
            {
                SearchDTO result = logic.AddSearch(searchValue, path);
                SearchID = result.ID;
            }
            #endregion

            if (path == null || path == "")
            {
                // Search All the Drivers on the machine if path is not specified
                #region SearchDrivers
                List <string> drivers = Directory.GetLogicalDrives().ToList();
                drivers.ForEach(d =>
                {
                    try
                    {
                        SearchFiles(d, searchValue, SearchID);
                    }
                    catch (Exception e)
                    {
                        DriverErrorCounter++;
                    }
                });
                #endregion
            }
            else
            {
                // Checking given path and search it
                #region SearchPath
                if (Directory.Exists(path))
                {
                    SearchFiles(path, searchValue, SearchID);
                }
                else
                {
                    throw new Exception("Path does not exists!");
                }
                #endregion
            }
            using (SearchLogic logic = new SearchLogic())
            {
                logic.SetSearchResults(SearchID, FileFoundCounter);
            }
        }
        public void FindStr_Success()
        {
            List <string[]> list = new List <string[]>
            {
                new string[] { "1", "one" },
                new string[] { "2", "two" },
                new string[] { "3", "three" },
            };
            var result = SearchLogic.Search(list, "two");

            Assert.AreEqual(1, result.Count);
            Assert.AreEqual("2", result.First()[0]);
            Assert.AreEqual("two", result.First()[1]);
        }
示例#14
0
    // Use this for initialization
    void Start()
    {
        Instance = this;

        EventQueue = new EventQueue();

        string name = CurUserName;

        UserLogic   = GameObject.Find("UserAgent").GetComponent <UserLogic>();
        MenuLogic   = GameObject.Find("MenuAgent").GetComponent <MenuLogic>();
        LoginLogic  = GameObject.Find("LoginAgent").GetComponent <LoginLogic>();
        BuildLogic  = GameObject.Find("BuildAgent").GetComponent <BuildLogic>();
        SearchLogic = GameObject.Find("SearchAgent").GetComponent <SearchLogic>();
        FightLogic  = GameObject.Find("FightAgent").GetComponent <FightLogic>();
    }
        public BookSearch()
        {
            InitializeComponent();
            dataSet = new DataSet();
            this.myCombo.Items.AddRange(new object[] {
                "Title",
                "Published Year",
                "Language",
                "Author",
                "Category"
            });

            search = new SearchLogic();
            this.Controls.Add(resultGridView);
        }
示例#16
0
 public void Setup()
 {
     _iMovieContext    = new MovieMemoryContext();
     _iGenreContext    = new GenreMemoryContext();
     _iPlaylistContext = new PlaylistMemoryContext();
     _iMediaContext    = new MediaMemoryContext();
     _iRatingContext   = new RatingMemoryContext();
     _genreLogic       = new GenreLogic(_iGenreContext);
     _searchLogic      = new SearchLogic(_genreLogic);
     _playlistLogic    = new PlaylistLogic(_iPlaylistContext, _iMediaContext);
     _mediaLogic       = new MediaLogic(_iMediaContext);
     _ratingLogic      = new RatingLogic(_iRatingContext, _mediaLogic);
     _movieLogic       = new MovieLogic(_iMovieContext, _genreLogic, _searchLogic, _playlistLogic, _mediaLogic, _ratingLogic);
     _testGenre1       = new GenreModel("test1", 1);
 }
示例#17
0
 //Initialize Global Variables
 public TabViewControl(UserModel user)
 {
     InitializeComponent();
     localDate    = DateTime.Now;
     currentTime  = localDate.GetDateTimeFormats()[0].ToString().Replace("/", "-");
     userID       = user.userID;
     userLevel    = user.userLevel;
     dataSet      = new DataSet();
     adminLogic   = new AdminLogic();
     search       = new SearchLogic();
     borrowLogic  = new BorrowLogic();
     reserveLogic = new ReserveLogic();
     returnLogic  = new ReturnLogic();
     defaultBook  = new BookModel();
     //user Level has being passed from the login screen
     changeVisibilityDependingOnThe(userLevel);
 }
示例#18
0
 public void DisplaySearchHistory()
 {
     using (SearchLogic logic = new SearchLogic())
     {
         List <SearchDTO> history = logic.GetAllSearches();
         if (history.Count > 0)
         {
             Console.WriteLine("{0,-25} | {1,-25} | {2,-10} |", "Value", "Path", "Results");
             Console.WriteLine("--------------------------------------------------------------------");
             history.ForEach(h => Console.WriteLine("{0,-25} | {1,-25} | {2,-10} |", h.Value, h.Path, h.Results));
             Console.WriteLine();
         }
         else
         {
             Console.WriteLine("There is no Searches to display.");
             Console.WriteLine();
         }
         EndMenu(false);
     }
 }
示例#19
0
        public ActionResult Index(DictionaryModel objDctionaryModel)
        {
            if (ModelState.IsValid)
            {
                KuttyPayanPosTaggerClass    objTagger = new KuttyPayanPosTaggerClass();
                Dictionary <string, string> POSText   = objTagger.PosTaggerMethod(objDctionaryModel.Search);
                //objDctionaryModel.NLPSearchResult = objTagge

                KuttyPayan.MongodbLibrary.KuttyPayanMongodbClass   ObjClass  = new KuttyPayan.MongodbLibrary.KuttyPayanMongodbClass();
                KuttyPayan.DBReaderLibrary.KuttyPayanDbReaderClass ObjDbRead = new KuttyPayan.DBReaderLibrary.KuttyPayanDbReaderClass();
                List <SearchInputTags> KPTags = ObjDbRead.SearchTextToDBMethod(POSText, objDctionaryModel.Search);
                bool status = ObjClass.KuttyPayanSearchTagInsert(KPTags);


                SearchLogic objSearchLogic = new SearchLogic();
                objDctionaryModel.SearchResult = objSearchLogic.SearchModel(objDctionaryModel.Search);
                return(View(objDctionaryModel));
                //return PartialView("WordListPartial", objDctionaryModel);
            }
            return(View(objDctionaryModel));
        }
示例#20
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            jukeController = JukeController.Instance;

            jukeController.Player.SongPlayed += Player_SongPlayed;

            if (!File.Exists("library.xml"))
            {
                Messenger.Log("Library doesn't exist. Create new one.");
                CreateLibrary();
            }
            else
            {
                Messenger.Log("Loading existing library");
                LoadLibrary();
            }

            searchLogics = new SearchLogicFactory().CreateAll(viewModel);
            searchLogic  = searchLogics[0];
            Messenger.Log("Main window loaded");
        }
示例#21
0
        public async Task <Page <UserSearchResponse> > Get(string searchText, string profilePropertyName = null,
                                                           int?profilePropertyId         = null, bool searchUsername = false, bool searchSubAccounts = false,
                                                           SearchOperator searchOperator = SearchOperator.Equals, int pageSize = 5, int pageOffset   = 0,
                                                           string sortField = null, bool sortAscending = true, bool includeAvatar = false)
        {
            var searchLogic = new SearchLogic(Cache, Context);

            var search = new UserSearch
            {
                SearchText          = searchText,
                ProfilePropertyName = profilePropertyName,
                ProfilePropertyId   = profilePropertyId,
                SearchUsername      = searchUsername,
                Operator            = searchOperator,
                PageSize            = pageSize,
                PageOffset          = pageOffset,
                IsAdmin             = IsAdmin,
                SortAscending       = sortAscending,
                SortField           = sortField,
                IncludeAvatar       = includeAvatar
            };

            return(await searchLogic.Search(search));
        }
        protected override void OnContentChanged()
        {
            base.OnContentChanged();
            if (Content != null)
            {
                var data              = Content.Data;
                var filterLogic       = new FilterLogic(data);
                var searchLogic       = new SearchLogic(data, filterLogic);
                var statisticsLogic   = new StatisticsLogic(data, searchLogic);
                var manipulationLogic = new ManipulationLogic(data, searchLogic, statisticsLogic);

                var viewShortcuts = new ItemList <IViewShortcut> {
                    new DataGridContent(data, manipulationLogic, filterLogic),
                    new StatisticsContent(statisticsLogic),

                    new LineChartContent(data),
                    new HistogramContent(data),
                    new ScatterPlotContent(data),
                    new CorrelationMatrixContent(Content),
                    new DataCompletenessChartContent(searchLogic),

                    new FilterContent(filterLogic),
                    new ManipulationContent(manipulationLogic, searchLogic, filterLogic),
                    new TransformationContent(data, filterLogic)
                };

                viewShortcutListView.Content = viewShortcuts.AsReadOnly();

                viewShortcutListView.ItemsListView.Items[0].Selected = true;
                viewShortcutListView.Select();
            }
            else
            {
                viewShortcutListView.Content = null;
            }
        }
示例#23
0
        public async Task <int> FindExistingUserOrRegister(GoogleUserProfile googleUser, bool isAdmin)
        {
            //Search for user by GoogleId PP
            var searchLogic = new SearchLogic(Cache, UserContext);

            var search = new UserSearch
            {
                SearchText          = googleUser.Id,
                ProfilePropertyName = "GoogleId"
            };

            Page <UserSearchResponse> searchResponse = await searchLogic.Search(search);

            if (searchResponse != null && searchResponse.Records != null && searchResponse.Records.Count > 0)
            {
                return(searchResponse.Records.Select(x => x.UserId).FirstOrDefault());
            }
            else
            {
                //Search for user by Google Email as Username
                var usernameSearch = new UserSearch
                {
                    SearchText     = googleUser.Email,
                    SearchUsername = true
                };

                searchResponse = await searchLogic.Search(usernameSearch);
            }

            if (searchResponse != null && searchResponse.Records != null && searchResponse.Records.Count > 0)
            {
                UserSearchResponse user = searchResponse.Records.FirstOrDefault();
                await AddGoogleIdToProfileProperty(user, googleUser.Id, isAdmin);

                return(user.UserId);
            }
            else
            {
                //Search for user by Google Email as Email PP
                var emailSearch = new UserSearch
                {
                    SearchText          = googleUser.Email,
                    ProfilePropertyName = "Email"
                };

                searchResponse = await searchLogic.Search(emailSearch);
            }

            if (searchResponse != null && searchResponse.Records != null && searchResponse.Records.Count > 0)
            {
                UserSearchResponse user = searchResponse.Records.FirstOrDefault();
                await AddGoogleIdToProfileProperty(user, googleUser.Id, isAdmin);

                return(user.UserId);
            }
            else
            {
                //User does not exist, so Register them
                return(await RegisterGoogleUser(googleUser, isAdmin));
            }
        }
        /// <summary>
        /// get the Proc data table  for matching procs
        /// </summary>
        /// <param name="pramName">param name</param>
        /// <param name="paramType">param sql datatype</param>
        /// <param name="isOutput">Bool is the param output</param>
        /// <param name="isNulable">Bool is the param nullable</param>
        /// <param name="isReadOnly">Bool is the param readonly</param>
        /// <param name="columnName">Column name text to serarch</param>
        /// <param name="tableName">Table name text to serarch</param>
        /// <param name="freeText">free text to serarch</param>
        /// <param name="sqlFunction">text to serarch for sql func</param>
        /// <param name="searchLogic">enum search locgic And or OR logic</param>
        /// <returns></returns>
        private DataTable GetProcsByParamerterFilter(
            string pramName, SqlDataType paramType, bool isOutput, bool isNulable, bool isReadOnly
            , string columnName, string tableName, string freeText, string sqlFunction, SearchLogic searchLogic
            )
        {
            procsTable.Clear();
            SqlConnectionStringBuilder connStr = new SqlConnectionStringBuilder();

            connStr.Authentication         = SqlAuthenticationMethod.SqlPassword;
            connStr.ConnectTimeout         = 0;
            connStr.UserID                 = ConfigurationManager.AppSettings["ServerUser"].ToString();
            connStr.Password               = ConfigurationManager.AppSettings["ServerUserPassword"].ToString();
            connStr.DataSource             = ConfigurationManager.AppSettings["ServerAddress"].ToString();
            connStr.InitialCatalog         = currentDBName;
            connStr.ApplicationName        = Application.ProductName + "ver. " + Application.ProductVersion;
            connStr.TrustServerCertificate = true;
            List <KeyValuePair <string, int> > procs = new List <KeyValuePair <string, int> >();
            SqlConnection sqlcon = new SqlConnection(connStr.ConnectionString);

            try
            {
                sqlcon.Open();
                SqlCommand command = new SqlCommand();
                command.CommandText    = "SELECT sp.[name] AS[Name],sp.[object_id] AS[ID] FROM sys.all_objects AS sp WHERE sp.[type] = 'P' AND is_ms_shipped = 0";
                command.CommandTimeout = 0;
                command.Connection     = sqlcon;
                SqlDataReader sprd = command.ExecuteReader();
                while (sprd.Read())
                {
                    KeyValuePair <string, int> currentPair = new KeyValuePair <string, int>(sprd[0].ToString(), int.Parse(sprd[1].ToString()));
                    procs.Add(currentPair);
                }

                sqlcon.Close();
            }
            catch (SqlException ex)
            {
                MessageBox.Show("Error geting Storer Procedures ID-s\nError message: " + ex.Message);
            }

            ServerConnection srvcon = new ServerConnection(sqlcon);
            Server           srv    = new Server(srvcon);
            List <KeyValuePair <string, bool> > spTextChecks  = new List <KeyValuePair <string, bool> >();
            List <KeyValuePair <string, bool> > spParamChecks = new List <KeyValuePair <string, bool> >();

            var dbs = from Database db in srv.Databases
                      where db.Name == currentDBName
                      select db;

            currentDB = dbs.First();

            for (int i = 0; i < procs.Count; i++)
            {
                StoredProcedure currentProc     = currentDB.StoredProcedures.ItemById(procs[i].Value);
                StringBuilder   currentProcText = new StringBuilder();
                currentProcText.Append(currentProc.TextBody);
                List <StoredProcedureParameter>     spParams   = currentProc.Parameters.Cast <StoredProcedureParameter>().ToList();
                List <KeyValuePair <string, bool> > pramChecks = spPrameterChecks(spParams, pramName, paramType, isOutput, isNulable, isReadOnly);
                List <KeyValuePair <string, bool> > textCehcks = sptxtChecks(currentProcText, tableName, columnName, freeText, sqlFunction);
                AddProcToTable(procsTable, pramChecks, textCehcks, currentProc, searchLogic);
            }

            return(procsTable);
        }
 public DataCompletenessChartContent(DataCompletenessChartContent content, Cloner cloner)
   : base(content, cloner) {
   SearchLogic = content.SearchLogic;
 }
 public DataCompletenessChartContent(SearchLogic searchLogic) {
   SearchLogic = searchLogic;
 }
示例#27
0
        public async Task <UserCredential> FindAndCreateCredentialFromResetText(string resetEntry)
        {
            var userLoginLogic = new UserLoginLogic(AuthContext);
            var searchLogic    = new SearchLogic(Cache, UserContext);
            var userLogic      = new UserLogic(Cache, UserContext);

            UserSearch usernameSearch = new UserSearch
            {
                SearchText     = resetEntry,
                SearchUsername = true,
                Operator       = SearchOperator.Equals,
                PageSize       = 1
            };

            // Search by username
            Page <UserSearchResponse> result = await searchLogic.Search(usernameSearch);

            if (result != null && result.Records.Count > 0)
            {
                var userResult = result.Records.FirstOrDefault();

                return(await userLoginLogic.CreateEmptyLogin(userResult.UserId, userResult.SearchFieldValue));
            }

            UserSearch emailSearch = new UserSearch
            {
                SearchText          = resetEntry,
                ProfilePropertyName = "email",
                Operator            = SearchOperator.Equals,
                PageSize            = 1
            };

            // Search by email
            Page <UserSearchResponse> emailResult = await searchLogic.Search(emailSearch);

            if (emailResult != null && emailResult.Records.Count > 0)
            {
                if (emailResult.TotalRecordCount > 1)
                {
                    // Should this be friendly? What can we even do if this happens?
                    // We could only check email if it marked unique
                    throw new CallerException("Multiple users have this email");
                }

                var emailUserResult = emailResult.Records.FirstOrDefault();

                var user = await userLogic.GetUserWithoutRelated(emailUserResult.UserId);

                var userCredentialLogic = new UserCredentialLogic(AuthContext);

                var credential = await userCredentialLogic.GetUserCredential(user.Username);

                if (credential != null)
                {
                    return(credential);
                }

                return(await userLoginLogic.CreateEmptyLogin(user.UserId, user.Username));
            }

            return(null);
        }
 public Search(ILogger <IndexModel> logger, ElasticClient elasticClient)
 {
     _logger        = logger;
     _elasticClient = elasticClient;
     _searchLogic   = new SearchLogic(_elasticClient);
 }
示例#29
0
 public ManipulationContent(ManipulationLogic theManipulationLogic, SearchLogic theSearchLogic, FilterLogic theFilterLogic) {
   manipulationLogic = theManipulationLogic;
   searchLogic = theSearchLogic;
   filterLogic = theFilterLogic;
 }
 private void okBUtton_Click(object sender, RoutedEventArgs e)
 {
     SearchLogic  = listBox.SelectedItem as SearchLogic;
     DialogResult = true;
     Close();
 }
示例#31
0
        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            services.Configure <CookiePolicyOptions>(options =>
            {
                // This lambda determines whether user consent for non-essential cookies is needed for a given request.
                options.CheckConsentNeeded    = context => true;
                options.MinimumSameSitePolicy = SameSiteMode.None;
            });

            services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1);

            services.AddSingleton(Configuration);

            services.AddTransient <IMovieContext, MovieSQLContext>(m =>
            {
                string c = Configuration.GetConnectionString("DefaultConnection");
                return(new MovieSQLContext(c));
            });
            services.AddTransient <IGenreContext, GenreSQLContext>(g =>
            {
                string c = Configuration.GetConnectionString("DefaultConnection");
                return(new GenreSQLContext(c));
            });
            services.AddTransient <IUserContext, UserSQLContext>(u =>
            {
                string c = Configuration.GetConnectionString("DefaultConnection");
                return(new UserSQLContext(c));
            });
            services.AddTransient <IPlaylistContext, PlaylistSQLContext>(p =>
            {
                string c = Configuration.GetConnectionString("DefaultConnection");
                return(new PlaylistSQLContext(c));
            });
            services.AddTransient <IMediaContext, MediaSQLContext>(m =>
            {
                string c = Configuration.GetConnectionString("DefaultConnection");
                return(new MediaSQLContext(c));
            });
            services.AddTransient <IRatingContext, RatingSQLContext>(r =>
            {
                string c = Configuration.GetConnectionString("DefaultConnection");
                return(new RatingSQLContext(c));
            });

            services.AddTransient(m =>
            {
                IMovieContext mc = m.GetService <IMovieContext>();
                GenreLogic gl    = m.GetService <GenreLogic>();
                SearchLogic sl   = m.GetService <SearchLogic>();
                PlaylistLogic p  = m.GetService <PlaylistLogic>();
                MediaLogic me    = m.GetService <MediaLogic>();
                RatingLogic rl   = m.GetService <RatingLogic>();
                return(new MovieLogic(mc, gl, sl, p, me, rl));
            });

            services.AddTransient(g =>
            {
                IGenreContext gc = g.GetService <IGenreContext>();
                return(new GenreLogic(gc));
            });

            services.AddTransient(s =>
            {
                GenreLogic gl = s.GetService <GenreLogic>();
                return(new SearchLogic(gl));
            });

            services.AddTransient(s =>
            {
                IUserContext uc  = s.GetService <IUserContext>();
                PlaylistLogic pl = s.GetService <PlaylistLogic>();
                RatingLogic rl   = s.GetService <RatingLogic>();
                return(new UserLogic(uc, pl, rl));
            });

            services.AddTransient(p =>
            {
                IPlaylistContext pl = p.GetService <IPlaylistContext>();
                IMediaContext m     = p.GetService <IMediaContext>();
                return(new PlaylistLogic(pl, m));
            });

            services.AddTransient(me =>
            {
                IMediaContext m = me.GetService <IMediaContext>();
                return(new MediaLogic(m));
            });

            services.AddTransient(r =>
            {
                IRatingContext rc = r.GetService <IRatingContext>();
                MediaLogic m      = r.GetService <MediaLogic>();
                return(new RatingLogic(rc, m));
            });



            services.AddAuthentication(CookieAuthenticationDefaults.AuthenticationScheme)
            .AddCookie(options =>
            {
                options.LoginPath = "/User/Login";
            });

            services.AddAuthorization(options =>
            {
                options.AddPolicy("Admin", p => p.RequireAuthenticatedUser().RequireRole("Admin"));
                options.AddPolicy("User", p => p.RequireAuthenticatedUser().RequireRole("User"));
            });
        }
        private static int ProgressCnt = 0; // is used in the progress event (for the switch case)
        #region Startup Functions
        public static int Startup()
        {
            ConsoleKeyInfo?userInput        = null; // value that gets the key input
            int            userChoice       = -1;   // value for parsing the user input
            string         userSearchTerm   = "";
            string         userSearchedPath = "";

            SearchLogic newSearch = new SearchLogic();                //start a new search after all conditions are filled

            newSearch.ResultFoundEvent += NewSearch_ResultFoundEvent; // register to the results found event
            newSearch.ShowProgress     += NewSearch_ShowProgress;     // register to the progres event

            Console.Clear();
            Console.WriteLine("Welcome to Ori's files search engine.");
            Console.WriteLine();
            Console.WriteLine("*** Note - the search engine will not search protected folders ***");
            Console.WriteLine();
            Console.WriteLine("Please choose an operation:");
            Console.WriteLine();
            Console.WriteLine("1. Search all computer -  NOTE:This search may take long time");
            Console.WriteLine("2. Search in a known directory and its sub-directories");
            Console.WriteLine("3. Show all searches in DB");
            Console.WriteLine("4. Exit");
            Console.WriteLine();
            Console.WriteLine();

            while (userChoice < 1 || userChoice > 4) //make sure user choice is from 1-4
            {
                if (userInput != null)
                {
                    Console.WriteLine("Please choose operation 1-4");
                }

                userInput = System.Console.ReadKey(true);                    //gets the key input
                int.TryParse(userInput?.KeyChar.ToString(), out userChoice); //parse the key input to a number
            }

            switch (userChoice)
            {
            case 1:

                userSearchTerm = GetUserTerm();
                break;

            case 2:
                bool beenHere = false;     //flag for the path retry message

                userSearchTerm = GetUserTerm();

                Console.WriteLine("Please enter path to search:");
                while (!System.IO.Directory.Exists(userSearchedPath))     //if the path does not exists
                {
                    if (beenHere)
                    {
                        Console.WriteLine("Directory not found. Please use a valid path.");
                    }

                    userSearchedPath = Console.ReadLine();     //gets the path from user
                    beenHere         = true;
                }
                break;

            case 3:
                List <string> CurrentDbData = newSearch.ReturnDBData();    // new list to get the current DB searches and results
                if (CurrentDbData.Count > 0)
                {
                    CurrentDbData.ForEach(row => Console.WriteLine(row));     //run the get DBData func and print the rows to console
                }
                else
                {
                    Console.WriteLine("There is no data in the DB");
                }

                return(0);

            case 4: return(4);    //exit
            }

            Console.WriteLine($"Please wait while Im searching:'{userSearchTerm}' .........");
            Console.WriteLine();
            newSearch.MainSearchFunc(userSearchTerm, userSearchedPath); //send the search term + path to the main search function

            return(0);
        }
示例#33
0
        public ActionResult GetRelatedTickets(string input)
        {
            var titles = SearchLogic.GetRelatedTickets(input);

            return(Json(titles, JsonRequestBehavior.AllowGet));
        }
示例#34
0
        //get
        public ActionResult GetTicketById(int id)
        {
            var result = SearchLogic.GetTicketById(id);

            return(View(result));
        }