public ActionResult OKButtonClick(int tabletDeviceNumber)
        {
            // Only used by ViewOnly view, for tablet device that is not being used for scoring, to check if all results have been entered
            TabletDeviceStatus tabletDeviceStatus = AppData.TabletDeviceStatusList[tabletDeviceNumber];
            TableStatus        tableStatus        = AppData.TableStatusList.Find(x => x.SectionID == tabletDeviceStatus.SectionID && x.TableNumber == tabletDeviceStatus.TableNumber);
            ResultsList        resultsList        = new ResultsList(tabletDeviceNumber, tableStatus);

            if (!resultsList.GotAllResults)
            {
                resultsList.Message = "NOTALLRESULTS";
                if (AppData.IsIndividual)
                {
                    ViewData["Header"] = $"{tabletDeviceStatus.Location} - Round {tableStatus.RoundNumber} - {tableStatus.RoundData.NumberNorth}+{tableStatus.RoundData.NumberSouth} v {tableStatus.RoundData.NumberEast}+{tableStatus.RoundData.NumberWest}";
                }
                else
                {
                    ViewData["Header"] = $"{tabletDeviceStatus.Location} - Round {tableStatus.RoundNumber} - NS {tableStatus.RoundData.NumberNorth} v EW {tableStatus.RoundData.NumberEast}";
                }
                ViewData["ButtonOptions"]      = ButtonOptions.OKEnabled;
                ViewData["Title"]              = $"Show Boards - {tabletDeviceStatus.Location}";
                ViewData["TabletDeviceNumber"] = tabletDeviceNumber;
                return(View("ViewOnly", resultsList));
            }
            else
            {
                return(RedirectToAction("Index", "ShowRankingList", new { tabletDeviceNumber }));
            }
        }
        public ActionResult ViewResult(int tabletDeviceNumber, int boardNumber)
        {
            // Only used by ViewOnly view, for tablet device that is not being used for scoring, to check if result has been entered for this board
            TabletDeviceStatus tabletDeviceStatus = AppData.TabletDeviceStatusList[tabletDeviceNumber];
            TableStatus        tableStatus        = AppData.TableStatusList.Find(x => x.SectionID == tabletDeviceStatus.SectionID && x.TableNumber == tabletDeviceStatus.TableNumber);
            ResultsList        resultsList        = new ResultsList(tabletDeviceNumber, tableStatus);
            Result             result             = resultsList.Find(x => x.BoardNumber == boardNumber);

            if (result == null || result.ContractLevel < 0)
            {
                resultsList.Message = "NORESULT";
                if (AppData.IsIndividual)
                {
                    ViewData["Header"] = $"{tabletDeviceStatus.Location} - Round {tableStatus.RoundNumber} - {tableStatus.RoundData.NumberNorth}+{tableStatus.RoundData.NumberSouth} v {tableStatus.RoundData.NumberEast}+{tableStatus.RoundData.NumberWest}";
                }
                else
                {
                    ViewData["Header"] = $"{tabletDeviceStatus.Location} - Round {tableStatus.RoundNumber} - NS {tableStatus.RoundData.NumberNorth} v EW {tableStatus.RoundData.NumberEast}";
                }
                ViewData["ButtonOptions"]      = ButtonOptions.OKEnabled;
                ViewData["Title"]              = $"Show Boards - {tabletDeviceStatus.Location}";
                ViewData["TabletDeviceNumber"] = tabletDeviceNumber;
                return(View("ViewOnly", resultsList));
            }
            else
            {
                return(RedirectToAction("Index", "ShowTraveller", new { tabletDeviceNumber, boardNumber, fromView = true }));
            }
        }
Exemple #3
0
        async Task ExecuteLoadResultsCommand()
        {
            if (IsBusy)
            {
                return;
            }

            IsBusy = true;

            try
            {
                ResultsList.Clear();
                var items = await App.ResultDB.GetResultsByAssessmentSession(App.AssessmentSession.SessionId);

                foreach (var item in items)
                {
                    ResultsList.Add(item);
                }
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex);
            }
            finally
            {
                IsBusy = false;
            }
        }
        public ActionResult Index(int tabletDeviceNumber)
        {
            TabletDeviceStatus tabletDeviceStatus = AppData.TabletDeviceStatusList[tabletDeviceNumber];
            TableStatus        tableStatus        = AppData.TableStatusList.Find(x => x.SectionID == tabletDeviceStatus.SectionID && x.TableNumber == tabletDeviceStatus.TableNumber);
            ResultsList        resultsList        = new ResultsList(tabletDeviceNumber, tableStatus);

            tableStatus.ResultData = null;  // No board selected yet

            if (AppData.IsIndividual)
            {
                ViewData["Header"] = $"{tabletDeviceStatus.Location} - Round {tableStatus.RoundNumber} - {tableStatus.RoundData.NumberNorth}+{tableStatus.RoundData.NumberSouth} v {tableStatus.RoundData.NumberEast}+{tableStatus.RoundData.NumberWest}";
            }
            else
            {
                ViewData["Header"] = $"{tabletDeviceStatus.Location} - Round {tableStatus.RoundNumber} - NS {tableStatus.RoundData.NumberNorth} v EW {tableStatus.RoundData.NumberEast}";
            }
            ViewData["ButtonOptions"] = ButtonOptions.OKEnabled;
            ViewData["Title"]         = $"Show Boards - {tabletDeviceStatus.Location}";

            if (tabletDeviceStatus.Direction == Direction.North)
            {
                return(View("Scoring", resultsList));
            }
            else
            {
                resultsList.Message = "NOMESSAGE";
                return(View("ViewOnly", resultsList));
            }
        }
Exemple #5
0
        private void AddResultItemOrAddToItemResultListLog(IDebugItemResult itemToAdd, bool isDeserialize)
        {
            if (!string.IsNullOrWhiteSpace(itemToAdd.GroupName) && itemToAdd.GroupIndex > MaxItemDispatchCount && !isDeserialize)
            {
                _fileName = string.Format("{0}.txt", _itemId);
                var shouldCreateMoreLink = itemToAdd.GroupIndex == MaxItemDispatchCount + 1 && !_isMoreLinkCreated;
                if (shouldCreateMoreLink)
                {
                    ClearFile(_fileName);
                    _stringBuilder.AppendLine(itemToAdd.GetMoreLinkItem());
                    var clonedItem = itemToAdd.Clone();
                    var moreLink   = SaveFile(_stringBuilder.ToString(), _fileName);
                    _stringBuilder.Clear();
                    clonedItem.MoreLink = moreLink;
                    ResultsList.Add(clonedItem);
                    _isMoreLinkCreated = true;
                    return;
                }

                _stringBuilder.AppendLine(itemToAdd.GetMoreLinkItem());

                FlushResultListLogIfNeeded(itemToAdd);
                return;
            }

            TruncateItemResultIfNeeded(itemToAdd);

            ResultsList.Add(itemToAdd);
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsRetakeActive())
            {
                servercontent.InnerHtml = "<H3><center>No re-take entries are possible at this time.</center></H3>";
                Label1.Visible          = false; TextBox_cost.Visible = false;
                Button_submit.Visible   = false;
                Label_title.Visible     = false;
                return;
            }

            Utility u1 = new Utility();

            PersonID = u1.GetPersonIdfromRequest(Request);
#if DEBUG
            //u1.Is_student = true; PersonID = u1.GetPersonIDX(@"CHALLONERS\michael.warren");//development
            //u1.Is_student = true;PersonID = u1.GetPersonIDX(@"CHALLONERS\Henry.Anning");//development
#endif
            //u1.Is_student = true; PersonID = u1.GetPersonIDX(@"CHALLONERS\Benjamin.Smith1");//development
            if ((PersonID == Guid.Empty))
            {
                Response.Write("<center> No Data to display</center>"); return;
            }

            if (!IsPostBack)
            {
                ViewState.Add("PersonID", PersonID);
                ResultsList rl = new ResultsList();
                rl.LoadList("StudentPersonId", PersonID.ToString());
                resultlist1._results.Clear();
                ExamOption exo1 = new ExamOption();

                TextBox_cost.Text = "0";
                //first time we load ... get the results data...
                foreach (Result res1 in rl._results)
                {
                    if (res1.OptionItem == "U")
                    {
                        Result r1 = new Result();
                        r1 = res1; r1.Valid = false;
                        exo1.Load(res1.OptionId);
                        exo1.Load(exo1.m_OptionCode, RetakeSeason(), RetakeYear(), exo1.m_ExamBoardID);
                        r1.Valid = exo1.m_valid;
                        //if (exo1.NeedsTeacherMarks()) r1.Valid = false;//try to disable csewrk modules..??
                        resultlist1._results.Add(r1);
                        r1.OptionId = exo1.m_OptionID;//update optionID!!!!
                    }
                }
                ViewState.Add("ResultList", resultlist1);
            }
            resultlist1 = (ResultsList)ViewState["ResultList"];
            int cost = AddControls(resultlist1, !IsPostBack);
            if (!IsPostBack)
            {
                double x = (double)cost;
                x = x / 100;
                TextBox_cost.Text = x.ToString();
                ViewState.Add("cost", cost);
            }
        }
Exemple #7
0
    private void DoSearch()
    {
        if (Keywords.Text.Length > 0)
        {
            SearchResults ResultsObject = SearchResults.Search(cleanSearchString(Keywords.Text.ToString()), GetSearchType());

            if (ResultsObject.Count > 0)
            {
                NoResultsPnl.Visible   = false;
                ResultsList.DataSource = ResultsObject;
                ResultsList.DataBind();
                ResultsHeading.Text = ResultsObject.Count.ToString() + " results found.";
            }
            else
            {
                ResultsList.DataSource = null;
                ResultsList.DataBind();
                ResultsHeading.Text = "";
                keywordsLbl.Text    = "\"" + Keywords.Text.ToString() + "\"";
                // Keywords.Text = "";
                NoResultsPnl.Visible = true;
            }
        }
        else
        {
            NoResultsPnl.Visible = false;
            ResultsHeading.Text  = "Latest opportunities";
            SearchResults ResultsObject = SearchResults.GetLatest(GetSearchType());
            ResultsList.DataSource = ResultsObject;
            ResultsList.DataBind();
        }
    }
Exemple #8
0
 private void BindData()
 {
     try
     {
         IList <SearchResult> searchResult = Provider.GetNewItems();
         ResultsList.DataSource = searchResult;
         FoundItems             = searchResult.Count;
         ResultsList.DataBind();
         if (IncludeInfo)
         {
             ((Panel)ResultsList.FindControl("InfoPanel")).Visible = true;
             ((Label)ResultsList.FindControl("FoundItems")).Text   = string.Format(Localization.GetString("FoundItems.Text", LocalResourceFile), FoundItems, NumberOfDays);
         }
         else
         {
             ((Panel)ResultsList.FindControl("InfoPanel")).Visible = false;
         }
         ResultsPager.Visible = (FoundItems > PageSize);
     }
     catch (Exception exc)
     {
         NoNewsFoundMessagePanel.Visible = true;
         Exceptions.LogException(exc);
     }
 }
Exemple #9
0
        /// <summary>
        /// Generates a list of food trucks by name and address from the JSON object returned by the API call, and filters the results by businesses that are currently open.
        /// </summary>
        /// <returns>List of food trucks open at the time of the API call</returns>
        public async Task <List <ResultsList> > GetFoodTrucks()
        {
            List <ResultsList> results = new List <ResultsList>();

            HttpResponseMessage response = await _client.GetAsync(_client.BaseAddress);

            if (response.IsSuccessStatusCode)
            {
                FoodTrucks.Rootobject list = JsonConvert.DeserializeObject <FoodTrucks.Rootobject>(await response.Content.ReadAsStringAsync());

                var query = from n in list.Features
                            select n.Properties;

                var openFoodTrucks = await FilterOpenFoodTrucks(query);

                foreach (var item in openFoodTrucks)
                {
                    ResultsList foodTruck = new ResultsList();
                    foodTruck.Name    = item.Applicant;
                    foodTruck.Address = item.Location;
                    results.Add(foodTruck);
                }
            }

            return(results);
        }
        private void DoWork(object param)
        {
            bool _result = false;

            CollectorThreadParams _params = param as CollectorThreadParams;

            if (_params != null)
            {
                _params.Collector.CurrentMovie = this.CurrentMovie;
                DateTime _start = DateTime.UtcNow;
                try
                {
                    _result = _params.Collector.GetResults(_params.Keywords, _params.ImdbId, _params.SkipImages);
                }
                finally
                {
                    DateTime _end = DateTime.UtcNow;
                    TimeSpan _ts  = TimeSpan.FromMilliseconds((_end - _start).TotalMilliseconds);
                    _params.Collector.SearchTime = String.Format("{0:00}:{1:00}:{2:00}.{3:00}", _ts.Hours, _ts.Minutes, _ts.Seconds, _ts.Milliseconds / 10);
                    Loggy.Logger.Debug("Collector: {0} Search time: {1}", _params.Collector.CollectorName, _params.Collector.SearchTime.ToString());
                }
            }
            if (_params.Collector != null)
            {
                lock (m_LockMe)
                {
                    ResultsList.AddRange(_params.Collector.ResultsList);
                }
            }

            if (_params.Event != null)
            {
                _params.Event.Set();
            }
        }
 public SearchList()
 {
     Search.Placeholder  = "Name...";
     Search.TextChanged += Search_TextChanged;
     BindingContext      = this;
     ResultsList.SetBinding <SearchList>(ListView.ItemsSourceProperty, x => x.Results);
     ResultsList.ItemSelected += (sender, args) => ItemSelectedCommand.Execute(args.SelectedItem);
     _httpClient.BaseAddress   = UriSource;
     ResultsList.ItemTemplate  = new DataTemplate(() =>
     {
         var viewCell = new ViewCell();
         var name     = new Label {
             Margin = new Thickness(15, 0), LineBreakMode = LineBreakMode.TailTruncation
         };
         name.SetBinding <SearchListSelectItem>(Label.TextProperty, x => x.Name);
         viewCell.View = name;
         return(viewCell);
     });
     Content = new StackLayout
     {
         Children =
         {
             Search,
             ResultsList
         }
     };
 }
        private async void BrowseForImages()
        {
            StatusText = "Running...";
            FileOpenPicker openPicker = new FileOpenPicker();

            openPicker.CommitButtonText = "Open";
            openPicker.FileTypeFilter.Add(".jpg");
            openPicker.FileTypeFilter.Add(".jpe");
            openPicker.FileTypeFilter.Add(".bmp");
            openPicker.FileTypeFilter.Add(".png");
            openPicker.FileTypeFilter.Add(".gif");
            openPicker.ViewMode = PickerViewMode.Thumbnail;
            openPicker.SuggestedStartLocation = PickerLocationId.DocumentsLibrary;
            IReadOnlyList <StorageFile> files = await openPicker.PickMultipleFilesAsync();

            if (files.Count > 0)
            {
                ResultsList.Clear();
            }
            foreach (StorageFile file in files)
            {
                try
                {
                    var result = await ProcessImage(file);

                    ResultsList.Add(result);
                }
                catch (Exception ex)
                {
                    Debug.WriteLine(ex);
                }
            }
            StatusText = "Ready";
        }
Exemple #13
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (Request.QueryString.Count >= 2)
                {
                    string s   = "test";
                    string id0 = Request.QueryString["StudentId"];
                    ViewState.Add("StudentId", id0);
                    string id1 = Request.QueryString["OptionId"];
                    ExamComponentResultList ecrl1 = new ExamComponentResultList();
                    ecrl1.Load_OptionStudent(new Guid(id1), new Guid(id0));
                    SimplePupil   pupil1 = new SimplePupil(); pupil1.Load(id0);
                    ExamOption    exo1   = new ExamOption(); exo1.Load(new Guid(id1));
                    ExamComponent ec1    = new ExamComponent();
                    ResultsList   rl1    = new ResultsList();
                    rl1.LoadListSimple(" WHERE (ExamsOptionId = '" + id1 + "') AND (StudentID = '" + id0 + "')");
                    Result r1 = new Result();
                    r1 = (Result)rl1._results[0];
                    s  = " <p><h3> Component Scores for ";
                    s += pupil1.m_GivenName + " " + pupil1.m_Surname + " for " + exo1.m_OptionTitle + "(" + r1.Text + ")</h3></p>";
                    s += "This table gives your component marks for this subject. Please note these are <b>not</b> UMS marks. ";
                    s += "<br/> The sum of the component marks gives your TQM (Total Qualification Mark), which leads to your final grade.";
                    s += "The table below tells you how the TQM is related to the final grade, i.e. the grade boundaries, if we know them! If not, please speak to a member of staff in school.";

                    s += "<br/><br /> Note that for Drama and Music the non-integer Scaling factors may mean that the component marks do not exactly add up to the TQM. In this case the TQM is CORRECT!<br/>";

                    s += "<br/><br /><TABLE BORDER   class=\"ResultsTbl\" style = \"font-size:small\"   align=\"center\">";
                    s += "<TR><th>Syllabus Code</th><th>Option Code</th><th>Component Code</th><th>Component Name</th>";
                    s += "<th>Mark</th> <th>Max Mark</th></tr>";
                    foreach (ExamComponentResult r in ecrl1.m_list)
                    {
                        ec1.Load(r.ComponentId);
                        s += "<tr align=\"center\">";
                        s += "<td>" + exo1.m_Syllabus_Code + "</td>";
                        s += "<td>" + exo1.m_OptionCode + "</td>";
                        s += "<td>" + ec1.m_ComponentCode + "</td>";
                        s += "<TD>" + ec1.m_ComponentTitle + "</td>";
                        s += "<td>" + r.ComponentScaledMark.ToString() + "</td>";
                        s += "<td>" + ec1.m_MaximumMark.ToString() + "</td>";
                        s += " </tr>";
                    }
                    s += "</table>";
                    ExamTQMBoundaryList bl1 = new ExamTQMBoundaryList();//will be ordered largest first
                    bl1.LoadList(new Guid(id1), exo1.m_year_Code, exo1.m_Season_code);

                    s += "<br/><br/>"; s += " <p><h3 align=\"center\" > TQM Grade Boundaries</h3></p>";
                    s += "<TABLE BORDER   class=\"TimetableTable\" style = \"font-size:small\" align=\"center\"  >";
                    s += "<tr><th>Grade</th><th>  TQM   </th></tr>";
                    foreach (ExamTQMBoundary eb in bl1.m_list)
                    {
                        s += "<tr><td>" + eb.Grade + "</td><td>" + eb.Mark + "</td></tr>";
                    }

                    s += "</table>";

                    content.InnerHtml = s;
                }
            }
        }
        private bool ProcessPage(string input, string id, bool skipImages, string link, string title, string originalTitle)
        {
            bool _result = false;

            if (!string.IsNullOrEmpty(input))
            {
                MovieInfo _movieInfo = GetMovieInfo(input);

                if (skipImages)
                {
                    if (!string.IsNullOrEmpty(_movieInfo.Name))
                    {
                        ResultMovieItem _movieItem = new ResultMovieItem(id, _movieInfo.Name, null, this.CollectorName);
                        _movieItem.MovieInfo         = _movieInfo;
                        _movieItem.CollectorMovieUrl = link;
                        ResultsList.Add(_movieItem);
                        _result = true;
                    }
                }
                else
                {
                    // process the VisualSection
                    bool _res = ProcessVisualSection(_movieInfo, id);
                    if (_res)
                    {
                        _result = true;
                    }
                }
            }

            return(_result);
        }
        private bool ProcessVisualSection(MovieInfo movieInfo, string id)
        {
            bool _result = false;

            // first posters
            string _page = Helpers.GetPage(string.Format("http://www.kinopoisk.ru/level/17/film/{0}", id), null, Encoding.GetEncoding("Windows-1251"), "", true, true);

            if (!string.IsNullOrEmpty(_page))
            {
                if (_page.Contains("<title>Архив постеров на КиноПоиск.ru</title>"))
                {
                    // movie has no posters
                    return(_result);
                }
                Regex _reg = new Regex(PostersRegex, RegexOptions.IgnoreCase | RegexOptions.Multiline);
                if (_reg.IsMatch(_page))
                {
                    for (int _i = 0; _i <= (_reg.Matches(_page).Count - 1); _i++)
                    {
                        string _imageUrl = string.Format("{0}", _reg.Matches(_page)[_i].Groups["Cover"].Value.Replace("sm_", ""));

                        ResultMovieItem _movieItem = new ResultMovieItem(id, movieInfo.Name, _imageUrl, this.CollectorName);
                        _movieItem.CollectorMovieUrl = string.Format("http://www.kinopoisk.ru/level/1/film/{0}/sr/1/", id);
                        _movieItem.MovieInfo         = movieInfo;

                        ResultsList.Add(_movieItem);
                        _result = true;
                    }
                }
            }

            //then backdrops
            _page = Helpers.GetPage(string.Format("http://www.kinopoisk.ru/level/13/film/{0}", id), null, Encoding.GetEncoding("Windows-1251"), "", true, true);

            if (!string.IsNullOrEmpty(_page))
            {
                Regex _reg = new Regex(BackdropsRegex, RegexOptions.IgnoreCase | RegexOptions.Singleline);
                if (_reg.IsMatch(_page))
                {
                    foreach (Match _m2 in _reg.Matches(_page))
                    {
                        string _thumbUrl    = string.Format("http://www.kinopoisk.ru/{0}", _m2.Groups["Backdrop"].Value);
                        string _originalUrl = _thumbUrl.Replace("sm_", "");

                        if (!string.IsNullOrEmpty(movieInfo.Name) && !string.IsNullOrEmpty(_thumbUrl) && !string.IsNullOrEmpty(_originalUrl))
                        {
                            string _width  = _m2.Groups["Width"].Value;
                            string _height = _m2.Groups["Height"].Value;

                            BackdropItem _bi = new BackdropItem(id, movieInfo.IMDBID, this.CollectorName, _thumbUrl, _originalUrl);
                            _bi.SetSize(_width, _height);
                            BackdropsList.Add(_bi);
                        }
                    }
                }
            }

            return(_result);
        }
        public static ResultsList ParseSearchResultsPage(String pageContent, ResultsList list)
        {
            HtmlDocument doc = new HtmlDocument();
            doc.LoadHtml(pageContent);
            HtmlNode docNode = doc.DocumentNode;
            HtmlNode currentNode;

            // Get total number of search results
            currentNode = docNode.SelectSingleNode("//span[contains(@id,'searchTermDisplay')]");
            var match = Regex.Match(currentNode.InnerText, "(([\\d]+))");
            list.TotalResults = Int32.Parse(match.Value);
            list.NumPages = 1 + (list.TotalResults / 100);

            if (list.TotalResults == 0)
                return list;

            // Get the link to the next page
            currentNode = docNode.SelectSingleNode("//div[contains(@id, 'topPagingControls')]//a[last()]");
            if (currentNode != null)
            {
                if (currentNode.InnerText.Contains("&gt;"))
                    list.NextPageUrl = "http://gatherer.wizards.com" + HttpUtility.HtmlDecode(currentNode.Attributes["href"].Value);
                else
                    list.NextPageUrl = String.Empty;
            }

            // Process results on page.
            var nodeList = docNode.SelectNodes("//tr[contains(@class, 'cardItem')]");
            foreach (var node in nodeList)
            {
                CardPreview cPrev = new CardPreview();
                var nameNode = node.SelectSingleNode(".//td[1]/a");

                // Parse name and id
                cPrev.Name = nameNode.InnerText.Trim();
                cPrev.MultiverseId = UInt32.Parse(Regex.Match(nameNode.Attributes["href"].Value, "multiverseid=([\\d]+)").Groups[1].Value);

                // Parse mana cost
                cPrev.Cost = ParseImgsToManaCost(node.SelectNodes(".//td[2]/img"));

                // Parse types and subtypes
                var typeStr = node.SelectSingleNode(".//td[3]").InnerText.Trim();
                var tuple = _ParseTypes(typeStr);
                cPrev.Types = tuple.Item1;
                cPrev.SubTypes = tuple.Item2;

                // Parse power and toughness
                cPrev.Power = node.SelectSingleNode(".//td[4]").InnerText.Trim();
                cPrev.Toughness = node.SelectSingleNode(".//td[5]").InnerText.Trim();

                // Parse printings
                cPrev.Printings = _ParsePrintings(node.SelectNodes(".//div[contains(@id,'cardPrintings')]/a"));

                list.Add(cPrev);
                list.ProcessedResults++;
            }

            return list;
        }
Exemple #17
0
        public List <ChartFoodCharacterResultSet> GetChartFoodCharacter()
        {
            StoredProc <ChartFoodCharacter> getChartFoodCharacter = new StoredProc <ChartFoodCharacter>(typeof(ChartFoodCharacterResultSet));
            ResultsList results = _getChartFoodCharacterDal.CallStoredProc(getChartFoodCharacter, null);
            var         r1      = results.ToList <ChartFoodCharacterResultSet>();

            return(r1);
        }
Exemple #18
0
        public List <ChartGoodsTypeResultSet> GetChartGoodsType()
        {
            StoredProc <ChartGoodsType> getChartGoodsType = new StoredProc <ChartGoodsType>(typeof(ChartGoodsTypeResultSet));
            ResultsList results = _getChartGoodsTypeDal.CallStoredProc(getChartGoodsType, null);
            var         r1      = results.ToList <ChartGoodsTypeResultSet>();

            return(r1);
        }
Exemple #19
0
        public List <ChartGoodsKindResultSet> GetChartGoodsKind()
        {
            StoredProc <ChartGoodsKind> getChartGoodsKind = new StoredProc <ChartGoodsKind>(typeof(ChartGoodsKindResultSet));
            ResultsList results = _getChartGoodsKindDal.CallStoredProc(getChartGoodsKind, null);
            var         r1      = results.ToList <ChartGoodsKindResultSet>();

            return(r1);
        }
Exemple #20
0
        private void AddResultItem(string id, MovieInfo movie, string imageUrl)
        {
            var movieItem = new ResultMovieItem(id, movie.Name, imageUrl, CollectorName);

            movieItem.CollectorMovieUrl = string.Format("http://www.themoviedb.org/movie/{0}", id);
            movieItem.MovieInfo         = movie;
            ResultsList.Add(movieItem);
        }
Exemple #21
0
 private static ResultsListDto BuildResultsList(ResultsList model)
 {
     return(new ResultsListDto
     {
         Title = model.Title,
         ResultsListId = model.ResultsListId,
         Columns = model.Columns.Select(BuildResultsColumn).ToList()
     });
 }
Exemple #22
0
        public DateTime GetSysDateTime()
        {
            StoredProc <GetSysDateTime> getSysDateTime = new StoredProc <GetSysDateTime>(typeof(GetSysDateTimeResultSet));
            GetSysDateTime pams1   = new GetSysDateTime();
            ResultsList    results = _getSysDateTimeDal.CallStoredProc(getSysDateTime, pams1);
            var            r1      = results.ToList <GetSysDateTimeResultSet>();

            return(r1.FirstOrDefault().currentDate);
        }
Exemple #23
0
        private bool ProcessPage(string input, string id, bool skipImages, string link, string title, string originalTitle)
        {
            bool _result = false;

            if (!string.IsNullOrEmpty(input))
            {
                MovieInfo _movieInfo = GetMovieInfo(input);

                if (!string.IsNullOrEmpty(this.IMDBID) && !string.IsNullOrEmpty(_movieInfo.IMDBID) && this.IMDBID != _movieInfo.IMDBID)
                {
                    return(false);
                }

                // extra for torec... eliminate duplicates
                var _items = from c in ResultsList
                             where c.MovieInfo.IMDBID == _movieInfo.IMDBID
                             select c;
                if (_items != null && _items.Count() != 0)
                {
                    return(false);
                }


                string _imageUrl = string.Format("{0}{1}", Host, GetCoverLink(input));

                if (string.IsNullOrEmpty(_movieInfo.Name))
                {
                    _movieInfo.Name = title;
                }
                if (string.IsNullOrEmpty(_movieInfo.OriginalTitle))
                {
                    _movieInfo.OriginalTitle = originalTitle;
                }

                if (!string.IsNullOrEmpty(_movieInfo.Name))
                {
                    ResultMovieItem _movieItem = new ResultMovieItem(id, _movieInfo.Name, _imageUrl, this.CollectorName);
                    _movieItem.MovieInfo         = _movieInfo;
                    _movieItem.CollectorMovieUrl = link;
                    ResultsList.Add(_movieItem);
                    _result = true;
                }

                if (!skipImages && !string.IsNullOrEmpty(VisualSectionRegex))
                {
                    // process the VisualSection if any
                    bool _res = ProcessVisualSection(GetItem(input, VisualSectionRegex, 1), _movieInfo, id);
                    if (_res)
                    {
                        _result = true;
                    }
                }
            }

            return(_result);
        }
        protected void DropDownList_VAmethods_SelectedIndexChanged(object sender, EventArgs e)
        {
            VaM = (ValueAddedMethod)ml1._ValueAddedMethodList[DropDownList_VAmethods.SelectedIndex];
            ResultsList rl1 = new ResultsList();

            rl1.LoadListSimple("WHERE ResultType=" + VaM.m_ValueAddedOutputResultType + "  ORDER BY dbo.tbl_Core_Results.ResultDate  DESC ");
            DateTime d1    = new DateTime(); d1 = DateTime.Now;
            bool     found = false;

            if (rl1._results.Count > 0)
            {
                Result r = new Result(); r = (Result)rl1._results[0];
                d1 = (DateTime)r.Date; found = true;
            }

            int y = d1.Year; ListItem l = new ListItem();

            if (!found)
            {
                l = new ListItem("No results found!", "0"); DropDownList_Cohort.Items.Clear(); DropDownList_Cohort.Items.Add(l); DropDownList_Cohort.Enabled = false;
            }
            else
            {
                switch (VaM.m_ValueAddedOutputResultType)
                {
                case 9:    //A2
                    DropDownList_Cohort.Items.Clear();
                    l = new ListItem("A-level Results" + y.ToString(), y.ToString());
                    DropDownList_Cohort.Items.Add(l); y--;
                    l = new ListItem("A-level Results" + y.ToString(), y.ToString());
                    DropDownList_Cohort.Items.Add(l); y--;
                    l = new ListItem("A-level Results" + y.ToString(), y.ToString());
                    DropDownList_Cohort.Items.Add(l); y--;
                    break;

                case 10:    //GCSE
                    DropDownList_Cohort.Items.Clear();
                    l = new ListItem("GCSE Results" + y.ToString(), y.ToString());
                    DropDownList_Cohort.Items.Add(l); y--;
                    l = new ListItem("GCSE Results" + y.ToString(), y.ToString());
                    DropDownList_Cohort.Items.Add(l); y--;
                    l = new ListItem("GCSE Results" + y.ToString(), y.ToString());
                    DropDownList_Cohort.Items.Add(l); y--;
                    break;

                default:
                    break;
                }
                DropDownList_Cohort.Enabled = true;
            }
            DropDownList_Cohort.Enabled = true;
            //find dates.......

            string s = VaM.m_ValeAddedDescription;
        }
        protected void SaveResult(string stud_id, string grade, string CourseID)
        {
            Utility     u     = new Utility();
            string      s     = "";
            bool        found = false;
            ResultsList rl1   = new ResultsList();

            DateTime ResultDate = new DateTime();

            ResultDate          = System.Convert.ToDateTime(TextBox2.Text);
            rl1.m_parameters    = 3; rl1.m_db_field2 = "ResultType"; rl1.m_value2 = "5";
            rl1.m_db_extraquery = " AND (dbo.tbl_Core_Results.ResultDate >= CONVERT(DATETIME, '" + ResultDate.ToString("yyyy-MM-dd HH:mm:ss") + "', 102) )";
            rl1.LoadList("dbo.tbl_Core_Students.StudentId", stud_id);
            foreach (Result r in rl1._results)
            {
                if (r.CourseID.ToString() == TextBox3.Text)
                {
                    // we have a value...
                    //update
                    found = true;
                    s     = "UPDATE tbl_Core_Results SET ResultValue='" + grade + "' ";
                    s    += "WHERE ResultID = '" + r.ResultID.ToString() + "'";
                    Encode en1 = new Encode();
                    en1.ExecuteSQL(s);
                }
            }
            if (!found)
            {
                string struser    = Context.User.Identity.Name;
                string staff_code = "";
                //Guid personID = u.GetPersonID(struser, out staff_code);
                Guid personID = u.GetPersonIdfromRequest(Request);
                staff_code = u.GetsStaffCodefromRequest(Request);
                SimplePupil pupil1 = new SimplePupil(); pupil1.Load(stud_id.ToString());
                if (personID != Guid.Empty)
                {
                    struser = u.Get_StaffCode(personID);
                }
#if DEBUG
                struser = "******";
#endif
                s = DateTime.Now.ToShortDateString() + "," + DateTime.Now.ToShortTimeString() + "," + TextBox1.Text + "," + struser + "," + pupil1.m_GivenName + "," + pupil1.m_Surname + "," + pupil1.m_adno.ToString() + "," + grade;
                //u.WriteToLogFile("resultslog.txt", s);
                s  = "INSERT INTO dbo.tbl_Core_Results (ResultType, StudentID, ResultValue, ResultDate, ResultText, ";
                s += "CourseId  )";
                s += " VALUES ( '5', '";
                s += stud_id + "', '";
                s += grade + "', ";
                s += " CONVERT(DATETIME, '" + ResultDate.ToString("yyyy-MM-dd HH:mm:ss") + "', 102), '";
                s += " ',  '";
                s += CourseID + "' )";
                Encode en1 = new Encode();
                en1.ExecuteSQL(s);
            }
        }
        private void _processTimer_Tick(object sender, EventArgs e)
        {
            if (SourceMediaElement.Position.Seconds < 1)
            {
                return;
            }



            var w = SourceMediaElement.ActualWidth;
            var h = SourceMediaElement.ActualHeight;

            System.Drawing.Size dpi = new System.Drawing.Size(96, 96);

            RenderTargetBitmap bmp = new RenderTargetBitmap((int)w, (int)h, dpi.Width, dpi.Height, PixelFormats.Pbgra32);

            bmp.Render(SourceMediaElement);


            MemoryStream  stream  = new MemoryStream();
            BitmapEncoder encoder = new BmpBitmapEncoder();

            encoder.Frames.Add(BitmapFrame.Create(bmp));
            encoder.Save(stream);

            Bitmap bitmap = new Bitmap(stream);

            // try to recognize image
            AlprResultsNet result = _process.Recognize(bitmap);

            foreach (var plate in result.Plates)
            {
                if (plate.BestPlate.Characters.Length >= 7)
                {
                    if (plate.BestPlate.OverallConfidence > Confidence)
                    {
                        ResultsList.Add(new ResultViewModel(plate.BestPlate.Characters, SourceMediaElement.Position, plate.BestPlate.OverallConfidence, true));
                        LastRecognizedPlate = plate.BestPlate.Characters;
                    }
                    else
                    {
                        ResultsList.Add(new ResultViewModel(plate.BestPlate.Characters, SourceMediaElement.Position, plate.BestPlate.OverallConfidence));
                    }


                    _lineTimer.Start();
                }

                SetFirstLines(plate);
                SetSecondLines(plate);
                SetThirdLines(plate);
                SetFourthLines(plate);
            }
        }
        protected void OK_Click2(object sender, EventArgs e)
        {
            //now to do the work
            //load students results for this set
            VaM = (ValueAddedMethod)ml1._ValueAddedMethodList[DropDownList_VAmethods.SelectedIndex];
            ResultsList rl1 = new ResultsList();

            rl1.LoadListSimple("WHERE ResultType=" + VaM.m_ValueAddedOutputResultType + "  ORDER BY dbo.tbl_Core_Results.ResultDate  DESC ");

            ResultsList rl0 = new ResultsList();

            rl0.LoadListSimple("WHERE ResultType=" + VaM.m_ValueAddedBaseResultType + "  ORDER BY dbo.tbl_Core_Results.ResultDate  DESC ");
            ResultsList rl2 = new ResultsList();
            CourseList  cl1 = new CourseList(5);

            foreach (Result r in rl1._results)
            {
                if (r.Date.Year == VAmodel.ResultsYear)
                {
                    rl2._results.Add(r);
                }
            }

            foreach (Course c in cl1._courses)
            {
                ValueAddedEquation veqn = new ValueAddedEquation(c._CourseID, VaM.m_ValueAddedMethodID);
                foreach (Result r in rl2._results)
                {
                    if (r.CourseID == c._CourseID)
                    {
                        foreach (Result r2 in rl0._results)
                        {
                            if (r.StudentID == r2.StudentID)
                            {
                                //match!!!


                                //Double d = veqn.m_coef0+veqn.m_coef1
                            }
                        }
                    }
                }
            }



            //ValueAddedEquation vaEqn = new ValueAddedEquation()


            //load VA Equation

            //Proces
        }
Exemple #28
0
        public string[] bestResults()
        {
            ResultsList = ResultsList.OrderBy(o => o.Score).Reverse().ToList();
            int r = Math.Min(10, ResultsList.Count());

            string[] lines = new string[r];
            for (int i = 0; i < r; i++)
            {
                lines[i] = ResultsList.ElementAt <Result>(i).ToString();
            }
            return(lines);
        }
Exemple #29
0
        public string GetBillNo(int billNoId, string OriginalDept)
        {
            StoredProc <GetBillNo> getBillNo = new StoredProc <GetBillNo>(typeof(GetBillNoResultSet));
            GetBillNo pams1 = new GetBillNo();

            pams1.bill_id  = billNoId;
            pams1.num_bit  = 3;
            pams1.org_code = OriginalDept;
            ResultsList results = _sysBillNoDal.CallStoredProc(getBillNo, pams1);
            var         r1      = results.ToList <GetBillNoResultSet>();

            return(r1.FirstOrDefault().billNumber);
        }
Exemple #30
0
        public List <ChartGoodsTrendByYearResultSet> GetChartGoodsTrendByYear(int inoutType, string startDate, string endDate)
        {
            StoredProc <ChartGoodsTrendByYear> getChartGoodsTrendByYear = new StoredProc <ChartGoodsTrendByYear>(typeof(ChartGoodsTrendByYearResultSet));
            ChartGoodsTrendByYear pams1 = new ChartGoodsTrendByYear();

            pams1.flag       = inoutType;
            pams1.begin_time = startDate;
            pams1.end_time   = endDate;
            ResultsList results = _getChartGoodsTrendByYearDal.CallStoredProc(getChartGoodsTrendByYear, pams1);
            var         r1      = results.ToList <ChartGoodsTrendByYearResultSet>();

            return(r1);
        }
Exemple #31
0
        public override bool GetResults(string keywords, string imdbID, bool skipImages)
        {
            bool _result = false;

            m_IMDbId = imdbID;

            try
            {
                m_EpisodeData = EpisodeData.GetEpisodeData(this.CurrentMovie.Filename);
            }
            catch { }

            try
            {
                // don't start querying if there's no episode number detected
                if (!string.IsNullOrEmpty(m_EpisodeData.Episode) && GetMirrors())
                {
                    if (GetSeries(keywords))
                    {
                        foreach (KeyValuePair <int, TheTVDBSerieItem> _item in m_Series)
                        {
                            if (FileManager.CancellationPending)
                            {
                                return(ResultsList.Count != 0);
                            }

                            if (skipImages)
                            {
                                string          _id        = _item.Value.ID.ToString();
                                ResultMovieItem _movieItem = new ResultMovieItem(_id, _item.Value.Title, null, CollectorName);
                                _movieItem.MovieInfo = _item.Value.MovieInfo;
                                SetCurrentEpisodeRelatedInfo(Convert.ToInt32(_id), _movieItem.MovieInfo);

                                _movieItem.CollectorMovieUrl = !string.IsNullOrEmpty(_id) ? string.Format("http://thetvdb.com/index.php?tab=series&id={0}", _id) : null;
                                ResultsList.Add(_movieItem);
                            }
                            else
                            {
                                GetEpisodes(_item.Value);
                                GetPosters(_item.Value);
                            }

                            _result = true;
                        }
                    }
                }
            }
            catch { }

            return(_result);
        }