Ejemplo n.º 1
0
        public SignInListItem(SignInEvent inEvent)
        {
            InEvent = inEvent;

            this.Text = InEvent.SignInYear + " - " + InEvent.SignInMonth + " - " + InEvent.SignInDate;
            this.SubItems.Add(new ListViewSubItem(this, "" + InEvent.SignInHour + ":" + InEvent.SignInMinute));
            this.SubItems.Add(new ListViewSubItem(this, "" + InEvent.SignOutHour + ":" + InEvent.SignOutMinute));
            this.SubItems.Add(new ListViewSubItem(this, "" + InEvent.TimeElapsed.TotalHours));
        }
Ejemplo n.º 2
0
        public InEventListItem(SignInEvent inEvent)
        {
            Number = inEvent.Number;
            Member member = DriveInteraction.Interactions.LookupMember(Number);

            FirstName = (member != null ? member.FirstName : "<Invalid>");
            LastName  = (member != null ? member.LastName : "<Invalid>");
            TimeIn    = new DateTime(inEvent.SignInYear, inEvent.SignInMonth, inEvent.SignInDate, inEvent.SignInHour, inEvent.SignInMinute, inEvent.SignInSecond);;

            this.Text = "" + Number;
            this.SubItems.Add(new ListViewSubItem(this, FirstName));
            this.SubItems.Add(new ListViewSubItem(this, LastName));
            this.SubItems.Add(new ListViewSubItem(this, "" + TimeIn.Hour + ":" + TimeIn.Minute));
        }
Ejemplo n.º 3
0
        /// <summary>
        /// This method is in charge of retrieving the data entered by the user in the Sign In dialog fragment.
        /// </summary>
        /// <param name="sender"> Reference to the object that raised the event </param>
        /// <param name="e"> Contains the event data </param>
        private void SignInResult(object sender, SignInEvent e)
        {
            string toastText;

            switch (e.Message)
            {
            case "3":
                toastText = "Please fill in all of the information";
                break;

            case "2":
                toastText = "The combination of user/password doesn't exist";
                break;

            case "0":
                toastText = "Incorrect password";
                break;

            default:
            {
                toastText = "Signed in!";

                using var webClient = new WebClient { BaseAddress = "http://" + Ipv4 + ":8080/CookTime_war/cookAPI/" };

                var url = "resources/getUser?id=" + e.UserEmail;
                webClient.Headers[HttpRequestHeader.ContentType] = "application/json";
                var send = webClient.DownloadString(url);

                var intent = new Intent(this, typeof(NewsfeedActivity));
                intent.PutExtra("User", send);
                StartActivity(intent);
                OverridePendingTransition(Android.Resource.Animation.SlideInLeft, Android.Resource.Animation.SlideOutRight);
                Finish();
                break;
            }
            }
            _toast = Toast.MakeText(this, toastText, ToastLength.Short);
            _toast.Show();
        }
Ejemplo n.º 4
0
        private void OnSignIn(object parameter)
        {
            var values   = (object[])parameter;
            var login    = ((TextBox)values[0]).Text;
            var password = ((PasswordBox)values[1]).Password;

            var userList = UserStorageManager.Instance.GetItemsList();

            if (login.Length == 0 || password.Length == 0)
            {
                NotificationEvent.Notify("Fields should not be empty!");
                return;
            }

            if (userList.Any(user => user.Login == login && user.Password == password))
            {
                SignInEvent.SignIn(true);
                return;
            }

            NotificationEvent.Notify("Incorrect Credentials!");
            SignInEvent.SignIn(false);
        }
Ejemplo n.º 5
0
 protected virtual void RaiseSignInEvent(SignInEventArgs eventArgs)
 {
     SignInEvent?.Invoke(this, eventArgs);
 }
Ejemplo n.º 6
0
 public async Task Handle(SignInEvent message, CancellationToken cancellationToken)
 {
     await Task.Run(() =>
     {
     });
 }
Ejemplo n.º 7
0
 private void OnSignOut(bool value)
 {
     SignInEvent.SignIn(false);
 }
Ejemplo n.º 8
0
 public static void SignInEventCall(string id)
 {
     SignInEvent.Invoke(id);
 }
Ejemplo n.º 9
0
 public async Task Handle(SignInEvent message, CancellationToken cancellationToken)
 {
 }