示例#1
0
        public List <_App_User> ReadCell()
        {
            _userCount = 0;
            List <_App_User> _items = new List <_App_User>();
            int rowCount            = wr.Rows.Count;
            int colCount            = wr.Columns.Count;

            for (int i = 1; i <= rowCount; i++)
            {
                _userCount++;
                _App_User appUser = new _App_User();

                string hold_id = (wr.Cells[i, 1].Value2.ToString());
                try
                {
                    int id = Int32.Parse(hold_id);
                    appUser.ID = id;
                }
                catch (FormatException) { throw new FormatException(); }

                appUser.accountNumber = wr.Cells[i, 2].Value2.ToString();
                appUser.college       = wr.Cells[i, 3].Value2.ToString();
                appUser.course        = wr.Cells[i, 4].Value2.ToString();
                appUser.firstName     = wr.Cells[i, 5].Value2.ToString();
                appUser.lastName      = wr.Cells[i, 6].Value2.ToString();
                appUser.middleName    = wr.Cells[i, 7].Value2.ToString();
                appUser.status        = wr.Cells[i, 8].Value2.ToString();
                appUser.year          = wr.Cells[i, 9].Value2.ToString();
                appUser.password      = wr.Cells[i, 10].Value2.ToString();
                _items.Add(appUser);
            }
            return(_items);
        }
        public async Task Controller_ImportUsers(_App_User _au)
        {
            string Student_No = "unknown";

            try
            {
                Student_No = _au.accountNumber;
                await Task.Run(() => firebase.Child("Accounts/").Child(Student_No).Child("Profile/").PutAsync <_App_User>(_au));
            }
            catch (FirebaseException e) { Console.WriteLine("Problem -> Method: Controller ImportUsers"); throw; }
        }
 public async Task Controller_RegisterThisUser(_App_User _new_user)
 {
     try
     {
         // sort items first
         string email       = _new_user.accountNumber + "@usep.edu.ph"; // username
         string password    = _new_user.password;
         string displayName = _new_user.lastName + "," + _new_user.firstName + _new_user.middleName;
         var    c           = await ap.CreateUserWithEmailAndPasswordAsync(
             email, password, displayName, false
             );
     }
     catch (FirebaseAuthException e)
     {
         throw new FirebaseAuthException(e.RequestUrl, e.ResponseData, e.ResponseData, e.InnerException, e.Reason);
     }
     catch (FirebaseException e)
     {
         Console.WriteLine("Problem -> Method: Controller RegisterThisUser" + e.Message);
         throw;
     }
 }