Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            //input
            RetrieveData.ReadFileData();
            RetrieveData.DisplayData(false); // change to true to see red data from .txt

            ExamData ed = new ExamData();

            string answers = ed.GetAnswerLine();

            string[] studId  = ed.GetStudntId();
            string[] studAns = ed.GetStudntAnswers();

            //logic
            Console.WriteLine(" ********* MCQ STUDENT EXAM REPORT ********* ");
            int[] score = CountCorrectAnswer(answers, studAns);
            //output #1 Print student id and their score
            ShowStudScore(studId, score);
            //output #2 Print total candidate number
            Console.WriteLine("The total amount of eximninations marked : " + ShowTotalCandidates(studId));
            //output #3 Print the correct answer for each question
            ShowCorrectAnswerForQuestion();

            Console.ReadKey();
        }
Ejemplo n.º 2
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.ListNewMessages);

            string message = Intent.Extras.GetString("message", "");

            myID      = Intent.GetIntExtra("myID", -1);
            newImages = Intent.GetBooleanExtra("newImage", false);

            var toolbar = FindViewById <Android.Support.V7.Widget.Toolbar>(Resource.Id.toolbar);

            SetSupportActionBar(toolbar);

            lstNames = FindViewById <ListView>(Resource.Id.listViewMessages);
            txtImage = FindViewById <TextView>(Resource.Id.textView3);

            RetrieveData retrieve = new RetrieveData();  // retrieve "IsDoctor"

            IsDoctor = retrieve.RetreiveBool();

            adapter = new CustomAdapter4(contactsPerson5);
            Actions();

            //adapter = new CustomAdapter4(lstSource);

            lstNames.Adapter    = new CustomAdapter4(contactsPerson5);
            lstNames.ItemClick += LstNames_ItemClick;
        }
Ejemplo n.º 3
0
        public ActionResult Index(int id, int?page, bool?fromSearch, string searchBy, string search)
        {
            RetrieveData      data  = new RetrieveData();
            List <PhotoModel> model = new List <PhotoModel>();

            model = data.PhotosByAlbumId(id);

            string albumTitle = data.AlbumTitleByAlbumId(id);

            ViewBag.AlbumTitle = albumTitle;
            ViewBag.id         = id;

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

            if (fromSearch != null)
            {
                ViewBag.fromSearch = fromSearch;
                ViewBag.page       = page;
                ViewBag.searchBy   = searchBy;
                ViewBag.search     = search;
            }
            else
            {
                ViewBag.fromSearch = false;
            }

            return(View(model.ToPagedList(pageNumber, pageSize)));
        }
        public ActionResult Index(int?page, string searchBy, string search)
        {
            List <UserModel> model = new List <UserModel>();
            RetrieveData     data  = new RetrieveData();

            model = data.UserInfo();
            data.AlbumInfoByUserId(model);
            foreach (var user in model)
            {
                data.FirstAlbumThumnailByAlbumId(user);
            }

            List <UserModel> finalList = new List <UserModel>();

            ViewBag.search = search;
            ViewBag.page   = page;

            if (searchBy == "User's Name")
            {
                ViewBag.searchBy = "User's Name";
                finalList        = model.Where(x => x.name.ToLower().Contains(search)).ToList();
            }

            else //(searchBy == "Album Title")
            {
                ViewBag.searchBy = "Album Title";
                FilterModelOnAlbumTitle(search, model, finalList);
            }
            return(View(finalList.ToPagedList(page ?? 1, 1)));
        }
Ejemplo n.º 5
0
        public void Adduser(List <ContactsPerson2> contactsPerson2, int k)
        {
            string Message;

            RetrieveData retrieve = new RetrieveData();
            bool         IsDoctor = retrieve.RetreiveBool();

            if (IsDoctor == false && imageIds[k].Sender == 1)
            {
                Message = imageIds[k].FirstName + " " + imageIds[k].LastName;
            }
            else if (IsDoctor == true && imageIds[k].Sender == 0)
            {
                Message = imageIds[k].FirstName1 + " " + imageIds[k].LastName1;
            }
            else
            {
                Message = "My Message ";
            }

            contactsPerson2.Add(new ContactsPerson2()
            {
                FirstName = Message,                         //imageIds[k].DataSenderId.ToString(),
                LastName  = imageIds[k].Date.ToString(),
                ImageUrl  = "contact.png"
            });
        }
Ejemplo n.º 6
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.ListViewMainLayout);

            // Data from previous activity
            myID          = Intent.GetIntExtra("myID", -1);
            message       = Intent.GetBooleanExtra("messages", false);
            photo         = Intent.GetBooleanExtra("photos", false);
            sendData      = Intent.GetBooleanExtra("sendData", false);
            HealthHistory = Intent.GetBooleanExtra("HealthHistory", false);
            patientData   = Intent.GetBooleanExtra("patientData", false);
            Allergy       = Intent.GetBooleanExtra("Allergy", false);
            newvisit      = Intent.GetBooleanExtra("newvisit", false);

            myList   = FindViewById <ListView>(Resource.Id.listView);
            Cadapter = new CustomAdapter2(contactsPerson2);

            RetrieveData retrieve = new RetrieveData();  // retrieve "IsDoctor"

            IsDoctor = retrieve.RetreiveBool();

            Actions();

            myList.Adapter    = new CustomAdapter2(contactsPerson2);
            myList.ItemClick += MyList_ItemClick;
        }
Ejemplo n.º 7
0
        //Constructor
        public ProcessMonster(IMapper dataMapper, ref EMailData emailData, Lookup lookups)
        {
            retrieve = new RetrieveData(dataMapper);

            this.lookups = lookups;

            this.emailData = emailData;
        }
Ejemplo n.º 8
0
        static void xMain(string[] args)
        {
            RetrieveData retrieveData = new RetrieveData();


            //Collection<TreeViewModels.Season> Seasons = retrieveData.RetrieveTreeViewData_Seasons();

            Collection <TreeViewModels.Season> Seasons = retrieveData.RetrieveTreeViewData_GameSelectionList();
        }
Ejemplo n.º 9
0
 void Update()
 {
     foreach (KeyValuePair <string, DataPerContinent> data in RetrieveData.getAllData())
     {
         foreach (GameObject bar in bars)
         {
             if (bar.name == data.Key)
             {
                 bar.transform.localScale = new Vector3(bar.transform.localScale.x, bar.transform.localScale.y + barIncrememnt, bar.transform.localScale.z);
             }
         }
     }
 }
Ejemplo n.º 10
0
        static void xMain(string[] args)
        {
            RetrieveData retrieveData = new RetrieveData();

            //retrieveData.RetrieveAvailableSeasons();
            //retrieveData.RetrieveAvailableSeasons2();
            //retrieveData.RetrieveReferenceData();
            //retrieveData.RetrieveGame("MIN201609222");
            //retrieveData.RetrieveStartingPlayers("MIN201609222");
            //retrieveData.RetrievePlayByPlay("MIN201609222");
            //Console.WriteLine("All done!");
            // Console.ReadLine();
        }
Ejemplo n.º 11
0
        public ActionResult Index(int?page)
        {
            RetrieveData     data  = new RetrieveData();
            List <UserModel> model = new List <UserModel>();

            model = data.UserInfo();
            data.AlbumInfoByUserId(model);
            foreach (var user in model)
            {
                data.FirstAlbumThumnailByAlbumId(user);
            }

            return(View(model.ToPagedList(page ?? 1, 1)));
        }
        public Retrosheet_PlayBall_Seasons()
        {
            InitializeComponent();

            ShowsNavigationUI = false;

            RetrieveData retrieveData = new RetrieveData();

            //Collection<TreeViewModels.Season> Seasons = retrieveData.RetrieveTreeViewData_Seasons();

            Collection <TreeViewModels.Season> Seasons = retrieveData.RetrieveTreeViewData_GameSelectionList();

            trvSeasons.ItemsSource = Seasons;
        }
Ejemplo n.º 13
0
        private void ListView_ItemClick(object sender, AdapterView.ItemClickEventArgs e)
        {
            Toast.MakeText(this, "you clicked on " + _lstDataItem2[e.Position], ToastLength.Short).Show();
            AlertDialog.Builder alert = new AlertDialog.Builder(this);
            alert.SetTitle(receivedMes[e.Position].FirstName + "  " + receivedMes[e.Position].LastName);
            alert.SetMessage(receivedMes[e.Position].Text);
            alert.SetIcon(Resource.Drawable.messageImage);
            alert.SetCancelable(true);
            Dialog dialog = alert.Create();

            dialog.Show();

            RetrieveData RD = new RetrieveData();

            RD.DeleteFromNew(receivedMes[e.Position].DataSenderID);
        }
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            RetrieveData retrieve = new RetrieveData();  // retrieve "IsDoctor"

            IsDoctor = retrieve.RetreiveBool();

            //Datafrom Previous Activity
            myID       = Intent.GetIntExtra("myID", -1);
            receivedID = Intent.GetIntExtra("receiverID", -1);

            SetContentView(Resource.Layout.Listallergies);
            mListView = FindViewById <ListView>(Resource.Id.AllergiesListView);

            Actions();
        }
        private void Actions()
        {
            string       endpoint;
            bool         IsValidJson;
            ConsumeRest  cRest        = new ConsumeRest();
            ValidateJson validateJson = new ValidateJson();

            object  strResponse;
            Address address = new Address();

            RetrieveData retrieve = new RetrieveData();  // retrieve "IsDoctor"
            bool         IsDoctor = retrieve.RetreiveBool();

            if (IsDoctor == false)
            {
                endpoint = address.Endpoint + "PatientNewPhotos/" + myID;
            }
            else
            {
                endpoint = address.Endpoint + "DoctorNewPhotos/" + myID;
            }

            strResponse = cRest.makeRequest(endpoint);
            IsValidJson = validateJson.IsValidJson(strResponse);
            if (IsValidJson == true)
            {
                imageIds = JsonConvert.DeserializeObject <List <imageIDs> >(strResponse.ToString());
                imageIds = imageIds.OrderBy(i => i.FirstName).ToList();
                SetData();
            }
            else
            {
                imageIds = JsonConvert.DeserializeObject <List <imageIDs> >("[]".ToString());

                new AlertDialog.Builder(this)
                .SetTitle("An error has occured")
                .SetIcon(Resource.Drawable.error)
                .SetMessage("No data found due to unexpected problem" + "\n" + strResponse)
                .Show();
            }
        }
        public ActionResult Index(int id, bool?fromSearch, int?page, string searchBy, string search)
        {
            UserDetailModel model = new UserDetailModel();
            RetrieveData    data  = new RetrieveData();

            model.User  = data.UserInfoByUserId(id);
            model.Posts = data.PostsByUserId(id);

            if (fromSearch != null)
            {
                ViewBag.fromSearch = fromSearch;
                ViewBag.page       = page;
                ViewBag.searchBy   = searchBy;
                ViewBag.search     = search;
            }
            else
            {
                ViewBag.fromSearch = false;
            }
            return(View(model));
        }
Ejemplo n.º 17
0
 private void Start()
 {
     InitialData = FindObjectOfType <RetrieveData>();
     lerp        = FindObjectOfType <LerpToDestination>();
 }
Ejemplo n.º 18
0
 public void RetrieveData()
 {
     Rules    = new DbDataRules();
     TestData = new RetrieveData();
 }
Ejemplo n.º 19
0
        public Retrosheet_PlayBall_PlayByPlay(string gameID)
        {
            InitializeComponent();
            ShowsNavigationUI = true;

            string SeasonYear;
            string SeasonGameType;
            string HomeTeamID;
            string VisitingTeamID;

            RetrieveData = new RetrieveData();

            dgGameInfoItems.ItemsSource = RetrieveData.RetrieveGameInformation(gameID);
            PageTitle.Text = RetrieveData.PageTitle;

            SeasonYear       = RetrieveData.SeasonYear;
            SeasonGameType   = RetrieveData.SeasonGameType;
            HomeTeamID       = RetrieveData.HomeTeamID;
            VisitingTeamID   = RetrieveData.VisitingTeamID;
            HomeTeamName     = RetrieveData.HomeTeamName;
            VisitingTeamName = RetrieveData.VisitingTeamName;

            RetrieveData.RetrieveStartingPlayers(SeasonYear,
                                                 SeasonGameType,
                                                 gameID);

            RetrieveData.RetrieveSubstitutePlayers(SeasonYear,
                                                   SeasonGameType,
                                                   gameID);

            PlayBeventInformation = RetrieveData.RetrievePlayBevent(SeasonYear,
                                                                    SeasonGameType,
                                                                    HomeTeamID,
                                                                    VisitingTeamID,
                                                                    gameID);

            RetrieveData.RetrievePlayerLineup();

            RetrieveData.RetrieveReplay(SeasonYear,
                                        SeasonGameType,
                                        gameID);

            RetrieveData.RetrieveBatterAdjustment(SeasonYear,
                                                  SeasonGameType,
                                                  HomeTeamID,
                                                  VisitingTeamID,
                                                  gameID);

            RetrieveData.RetrievePlayerEjection(gameID);

            RetrieveData.RetrieveGameComment(gameID);

            RetrieveData.RetrieveGameData(gameID);

            RetrieveData.RetrievePitcherAdjustmentInformation(SeasonYear,
                                                              SeasonGameType,
                                                              gameID);

            RetrieveData.RetrieveSubstituteUmpireInformation(gameID);

            // set the dgPlayBevents data source after retrieving all data cause it will trigger the dbPlayEvents_SelectedCellsChanged event
            dgPlayBevents.ItemsSource = PlayBeventInformation;
        }