private void SetUp()
 {
     PopUpContents = new DataTemplate(() =>
     {
         SfTextInputLayout rideCreditsInputLayout = new SfTextInputLayout
         {
             Hint                = "Amount",
             FocusedColor        = Color.Black,
             UnfocusedColor      = Color.Black,
             ContainerType       = ContainerType.Outlined,
             OutlineCornerRadius = 8
         };
         amount = new Entry();
         rideCreditsInputLayout.InputView    = amount;
         rideCreditsInputLayout.ErrorText    = "Field cant be left blank";
         rideCreditsInputLayout.FocusedColor = Color.Black;
         return(new StackLayout {
             VerticalOptions = LayoutOptions.Center, HorizontalOptions = LayoutOptions.Center, Children = { rideCreditsInputLayout }
         });
     });
     PopupLayout = new SfPopupLayout();
     PopupLayout.PopupView.HeaderTitle       = "Puchase Ride Credits";
     PopupLayout.PopupView.ContentTemplate   = PopUpContents;
     PopupLayout.PopupView.AnimationMode     = AnimationMode.Fade;
     PopupLayout.PopupView.AppearanceMode    = AppearanceMode.TwoButton;
     PopupLayout.PopupView.HorizontalOptions = LayoutOptions.CenterAndExpand;
     PopupLayout.PopupView.VerticalOptions   = LayoutOptions.Center;
     PopupLayout.Closed += PopupLayout_Closed;
     PopupLayout.Opened += PopupLayout_Opened;
     PopupLayout.PopupView.AcceptCommand = new Command(() => { Purchase_Ride_Credits(); });
     RhodesDataBase = new RhodesDataBase();
 }
Exemple #2
0
 /// <summary>
 /// @dev responsible for setting up connection to the following
 /// @var rhodeITDB the RhodesIT Platforms Database
 /// @var rhodesDataBase represents Rhodes Universities DB
 /// @var web3 responsible for establishing a connection between RChain (Private Blockchain) and the Mobile App
 /// @var SmartContractFunctions responsible for allowing access to all smart contract functions
 /// </summary>
 public void SetupAsync()
 {
     BaseContract   = new RhodeITDeployment();
     rhodesDataBase = new RhodesDataBase();
     Account        = new ManagedAccount(Variables.adminAddress, Variables.Passwordd);
     web3           = new Web3Quorum(Variables.RPCAddressNodeGenesis);
     web3.TransactionManager.DefaultGas      = new System.Numerics.BigInteger(8000000);
     web3.TransactionManager.DefaultGasPrice = new System.Numerics.BigInteger(20000000000);
     SmartContractFunctions = new RhodeITService();
 }
Exemple #3
0
        private void Proload()
        {
            RhodesDataBase db       = new RhodesDataBase();
            List <Student> students = new List <Student>();

            using (var input = context.Assets.Open("Students.json"))
                using (StreamReader sr = new StreamReader(input))
                {
                    dynamic stuff = JsonConvert.DeserializeObject(sr.ReadLine());
                    students.Add(new Student {
                        StudentNo = stuff.StudentNumber, Password = stuff.Password
                    });
                }
            db.StoreStudents(students);
        }
        public void StoreStudents()
        {
            List <Student> students = new List <Student>();
            RhodesDataBase db       = new RhodesDataBase();
            var            text     = System.IO.File.OpenText("Files/RhodesMap.geojson");
            string         line     = text.ReadLine();

            while (true)
            {
                if (string.IsNullOrEmpty(line))
                {
                    break;
                }
                dynamic stuff = JsonConvert.DeserializeObject(line);
                students.Add(new Student {
                    StudentNo = stuff.StudentNumber, Password = stuff.Password
                });
                line = text.ReadLine();
            }
            db.StoreStudents(students);
        }