Beispiel #1
0
 public ActivityJoinViewModel(Activity_Child selectedActivity, List <User> userQuery, List <User> userJoining, List <User_Log> userCreator, User_Equipment equipment)
 {
     this.userJoining         = userQuery;
     this.equipment           = equipment;
     this.userCreator         = userCreator;
     this.userCreatorActivity = userJoining;
     this.selectedActivity    = selectedActivity;
     this.name         = selectedActivity.Name;
     this.LocationCode = selectedActivity.Activity_Loc_Id;
     this.categoryName = selectedActivity.CategoryName;
     this.description  = selectedActivity.Description;
     this.UserName     = userJoining[0].Nickname;
     this.IsService    = selectedActivity.IsService;
     this.Start        = selectedActivity.Start_Act_Datetime.ToString();
     this.End          = selectedActivity.End_Act_Datetime.ToString();
     if (this.IsService)
     {
         this.Color = "Pink";
     }
     getFile();
     getFileUserEntry();
     getUserRating();
     getLocationRating();
     //this.UserName = "******" + userQuery[0].Nickname;
 }
Beispiel #2
0
        private async void fillEquipment()
        {
            int len = RandomId.length.Next(5, 10);

            equipment = new User_Equipment
            {
                Id = RandomId.RandomString(len),
                Phone_Model_Num = CrossDeviceInfo.Current.Platform.ToString(),
                Phone_Name      = CrossDeviceInfo.Current.DeviceName,
                Phone_Version   = CrossDeviceInfo.Current.Version,
                User_Id_FK      = userQuery[0].Id
            };

            try
            {
                await App.MobileService.GetTable <User_Equipment>().InsertAsync(equipment);
            }
            catch (Exception ex)
            {
                await Application.Current.MainPage.DisplayAlert("Error", ex.Message, "Ok");
            }

            userLog = new User_Log
            {
                Id                  = RandomId.RandomString(len),
                LogDateTime         = DateTime.Today,
                User_LogType_Id_FK1 = logType,
                User_Equipment_code = equipment.Id,
                User_Id_FK2         = userQuery[0].Id
            };

            try
            {
                await App.MobileService.GetTable <User_Log>().InsertAsync(userLog);
            }
            catch (Exception ex)
            {
                await Application.Current.MainPage.DisplayAlert("Error", ex.Message, "Ok");
            }
        }