123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- using Comal.Classes;
- using InABox.DynamicGrid;
- namespace PRSDesktop
- {
- internal class CustomerGrid : DynamicDataGrid<Customer>
- {
- public CustomerGrid()
- {
- Options.BeginUpdate();
- Options.AddRange(
- DynamicGridOption.SelectColumns,
- DynamicGridOption.MultiSelect,
- DynamicGridOption.FilterRows,
- DynamicGridOption.ExportData,
- DynamicGridOption.AddRows,
- DynamicGridOption.EditRows,
- DynamicGridOption.DeleteRows
- );
- Options.EndUpdate();
- ActionColumns.Add(new DynamicScheduleEditorColumn<Customer>());
- HiddenColumns.Add(x => x.ActiveSchedules);
- ;
- ActionColumns.Add(new DynamicMapColumn<Customer>(this, x => x.Delivery.Location));
- // HiddenColumns.Add(x => x.Delivery.Location.Timestamp);
- //HiddenColumns.Add(x => x.Delivery.Location.Latitude);
- //HiddenColumns.Add(x => x.Delivery.Location.Longitude);
- }
- public Customer[] Customers { get; private set; }
- //private bool HasLocation(int row)
- //{
- // if (row.Equals(-1))
- // return true;
- // DateTime dt = Data.Rows[row].Get<Customer, DateTime>(x => x.Delivery.Location.Timestamp);
- // return !dt.IsEmpty();
- //}
- //private BitmapImage MapImage(int row)
- //{
- // return HasLocation(row) ? PRSDesktop.Resources.milestone.AsBitmapImage() : null;
- //}
- //private bool MapClick(DataRow row)
- //{
- // int index = Data.Rows.IndexOf(row);
- // if (HasLocation(index))
- // {
- // MapForm form = new MapForm(row.Get<Customer, double>(x => x.Delivery.Location.Latitude), row.Get<Customer, double>(x => x.Delivery.Location.Longitude));
- // form.ShowDialog();
- // }
- // return false;
- //}
- }
- }
|