public SignaturePage(PropertyPassDbTable PropertyPassTableID_, List <AssetDisplayClass> PropertyPassDisplayList_, SQLiteConnection connection_) { InitializeComponent(); _PropertyPassTableID = PropertyPassTableID_; _PropertyPassDisplayList = PropertyPassDisplayList_; _connection = connection_; }
public static IEnumerable <PropertyPassItemDbTable> ConvertListToDb(PropertyPassDbTable PropertyPassTable, List <AssetDisplayClass> AssetList) { var List = new List <PropertyPassItemDbTable>(); foreach (AssetDisplayClass Asset in AssetList) { var JsonObj = JsonConvert.DeserializeObject <AssetJsonObject>(Asset.AssetJSONDb); var _PPI = new PropertyPassItemDbTable { Asset_ID_Internal = Asset.AssetIdInternal, Assigned_By = PropertyPassTable.Assigned_By, CheckOutDate = DateTime.Now.ToString(), DueDate = PropertyPassTable.DueDate, PropertyPassID_Internal = PropertyPassTable.PropertyPassID_Internal, ModifiedOn = DateTime.Now.ToString(), SiteIDInternal = JsonObj.SiteIDInternal, Quantity = Asset.Quantity, PropertyPassItemID_Internal = GUID.Generate(), AssetSerialNo = JsonObj.AssetSerialNo, CheckInDate = null, Synced = true, }; List.Add(_PPI); } return(List); }
public ScanBarcodePage(SQLiteConnection connection, string Person = null, bool PropertyPass = false, PropertyPassDbTable PropertyPassTableID = null) { MessagingCenter.Subscribe <string>(this, "Datawedge", (sender) => { searchbar.Text = sender; }); loadvalues(); if (Person != null) { _Person = Person; } _PropertyPass = PropertyPass; InitializeComponent(); BarcodeImage.Source = ImageSource.FromResource("eQuipMobile.Images.Camera_icon.png"); if (Application.Current.MainPage.Width < 768) { BarcodeImage.Margin = new Thickness(10, 0, 10, 0); } if (_PropertyPass) { _PropertyPassTableID = PropertyPassTableID; ScanLabel.Text = "Scan barcode of asset to add to property pass"; } _connection = connection; assetbarcodeListview.ItemsSource = defaultList; }
public PropertyPassItemsList(SQLiteConnection connection, PropertyPassDbTable PropertyPassTableID) { _connection = connection; InitializeComponent(); var propertyPassItems = Database.PropertyPassItem.GetTableDetailsByPropertyPassTable(_connection, PropertyPassTableID.PropertyPassID_Internal); _allPropItemsObs = new ObservableCollection <PropertyPassClass.PropertyPassDisplay>(PropertyPassClass.PropertyPassDisplay.GetData(propertyPassItems, _Names)); //convert the propertyPass records to Asset displays with checkboxes GetTableDetailsByPropertyPassTable PropertyPassItemList.ItemsSource = propertyPassItems; }
private async void AddPropertyPass(object sender, EventArgs e) { string siteName, personName; SitesClass siteInfo = new SitesClass(); PeopleClass personInfo = new PeopleClass(); var field = CheckValues(); if (field == "") { //gets site if (PropertyPassSite.SelectedIndex >= 0) { siteName = PropertyPassSite.Items[PropertyPassSite.SelectedIndex]; siteInfo = SitesClass.DbToSite(Database.Sites.GetTableData(_connection), _connection).Single(cm => cm.SiteName == siteName); } //gets people if (PropertyPassPerson.SelectedIndex >= 0) { personName = PropertyPassPerson.Items[PropertyPassPerson.SelectedIndex]; personInfo = PeopleClass.DbToPeople(Database.People.GetTableData(_connection), _connection).Single(cm => cm.PeopleName == personName); } var PPdata = new PropertyPassDbTable() { AssignedToEmail = PropertyPassEmail.Text, CreationDate = DateTime.Now.ToString("s"), AssignedToPhone = PropertyPassPhone.Text, ModifiedOn = DateTime.Now.ToString("s"), Comments = PropertyPassComments.Text, DueDate = PropertyPassDueDate.Date.ToString("s"), PeopleID_Internal = personInfo.PeopleIDInternal, SiteIDInternal = siteInfo.SiteIdInternal, PropertyPassID_Internal = GUID.Generate(), Assigned_By = Application.Current.Properties["user"].ToString(), Synced = true }; Database.PropertyPassTable.Insert(_connection, PPdata); await DisplayAlert("Complete", "The property pass table has been added.", "OK"); await Navigation.PopAsync(); } else { await DisplayAlert("Error", "The " + field + " field is required", "OK"); } }
public CheckinCheckoutPage(SQLiteConnection connection, string PropertyPassID) { var PPItemRecords = Database.PropertyPassItem.GetTableDataByPropertyPassTable(connection, PropertyPassID); _connection = connection; _PropertyPass = PropertyPassID; _PPTable = Database.PropertyPassTable.GetTableDataByID(_connection, _PropertyPass); InitializeComponent(); if (PPItemRecords.Count() > 0) { CheckIn.IsEnabled = true; } else { CheckOut.IsEnabled = true; } }
public PropertyPassTable(PropertyPassDbTable PropertyPassDb = null) { if (PropertyPassDb != null) { Assigned_By = PropertyPassDb.Assigned_By; AssignedToEmail = PropertyPassDb.AssignedToEmail; AssignedToPhone = PropertyPassDb.AssignedToPhone; Comments = PropertyPassDb.Comments; CreationDate = Convert.ToDateTime(PropertyPassDb.CreationDate); DueDate = Convert.ToDateTime(PropertyPassDb.DueDate); PeopleID_Internal = PropertyPassDb.PeopleID_Internal; PropertyPassID_Internal = PropertyPassDb.PropertyPassID_Internal; PropertyPassLevel = PropertyPassDb.PropertyPassLevel; SiteIDInternal = PropertyPassDb.SiteIDInternal; TerminationDate = Convert.ToDateTime(PropertyPassDb.TerminationDate); ModifiedOn = Convert.ToDateTime(PropertyPassDb.ModifiedOn); SignaturePic = PropertyPassDb.SignaturePic; } }