1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677 |
- using System;
- using System.Collections.Generic;
- using Xamarin.Forms;
- using InABox.Core;
- using Comal.Classes;
- using InABox.Clients;
- using System.Linq;
- using System.Threading.Tasks;
- using Syncfusion.XForms.PopupLayout;
- using Xamarin.Essentials;
- using System.Windows.Input;
- using InABox.Mobile;
- using XF.Material.Forms.UI.Dialogs;
- using LogType = InABox.Core.LogType;
- using PRSSecurity = InABox.Core.Security;
- namespace comal.timesheets
- {
-
- public partial class StaffStatusPage
- {
-
- private SfPopupLayout popup;
-
- public StaffStatusPage()
- {
- popup = new SfPopupLayout();
-
- InitializeComponent();
-
- _staff.Columns
- .BeginUpdate()
- .Clear();
-
- if (!PRSSecurity.IsAllowed<CanViewMobileInOutBoardDetails>())
- _staff.Columns.Add(new MobileGridImageColumn<InOutShell>() { Column = x =>x.In, Width=40 });
-
- _staff.Columns.Add(new MobileGridTextColumn<InOutShell>() { Column = x => x.Name, Alignment = TextAlignment.Start, Width = GridLength.Star });
-
- if (PRSSecurity.IsAllowed<CanViewMobileInOutBoardDetails>())
- _staff.Columns
- .Add(new MobileGridTimeColumn<InOutShell>() { Column = x => x.Start, Width = 50 })
- .Add(new MobileGridTimeColumn<InOutShell>() { Column = x => x.Finish, Width = 50 });
- _staff.Columns.Add(new MobileGridImageColumn<InOutShell>() { Column = x => x.Call, Width = 40, Tapped = CallEmployee });
-
- _staff.Columns.EndUpdate();
- App.Data.InOut.Refresh(false, RefreshScreen);
- }
- private async void CallEmployee(IMobileGridColumn column, object shell)
- {
- if (shell is InOutShell inout)
- {
- var copy = await MaterialDialog.Instance.ConfirmAsync(message: inout.Mobile,
- title: "Contact Details",
- confirmingText: "Call",
- dismissiveText: "Cancel");
- if (copy == true)
- PhoneDialer.Open(inout.Mobile);
- }
- }
- private void RefreshScreen()
- {
- _staff.ItemsSource = App.Data.InOut.Items;
- }
-
- private void _staff_OnRefreshRequested(object sender, MobileGridRefreshRequestArgs args)
- {
- App.Data.InOut.Refresh(true, RefreshScreen);
- }
-
- }
- }
|