123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225 |
- using System;
- using System.IO;
- using System.Transactions;
- using Comal.Classes;
- using InABox.Mobile;
- using Xamarin.Forms;
- namespace PRS.Mobile
- {
- public class StockMovementShell : Shell<StockMovementModel, StockMovement>
- {
- protected override void ConfigureColumns(ShellColumns<StockMovementModel, StockMovement> columns)
- {
- columns
- .Map(nameof(ProductID), x => x.Product.ID)
- .Map(nameof(ProductCode), x => x.Product.Code)
- .Map(nameof(ProductName), x => x.Product.Name)
- .Map(nameof(JobID), x => x.Job.ID)
- .Map(nameof(JobNumber), x => x.Job.JobNumber)
- .Map(nameof(JobName), x => x.Job.Name)
- .Map(nameof(LocationID), x => x.Location.ID)
- .Map(nameof(LocationCode), x => x.Location.Code)
- .Map(nameof(LocationDescription), x => x.Location.Description)
- .Map(nameof(LocationAreaID), x => x.Location.Area.ID)
- .Map(nameof(LocationAreaCode), x => x.Location.Area.Code)
- .Map(nameof(LocationAreaDescription), x => x.Location.Area.Description)
- .Map(nameof(StyleID), x => x.Style.ID)
- .Map(nameof(StyleCode), x => x.Style.Code)
- .Map(nameof(StyleDescription), x => x.Style.Description)
- .Map(nameof(RequisitionItemID), x=>x.JobRequisitionItem.ID)
- .Map(nameof(Received), x => x.Received)
- .Map(nameof(Issued), x => x.Issued)
- .Map(nameof(Date), x => x.Date)
- .Map(nameof(TransactionID), x => x.Transaction)
- .Map(nameof(BatchID), x=>x.Batch.ID)
- .Map(nameof(EmployeeID), x=>x.Employee.ID)
- .Map(nameof(Type), x=>x.Type)
- .Map(nameof(Notes), x=>x.Notes)
-
-
- .Map(nameof(DimensionsUnitID), x => x.Dimensions.Unit.ID)
- .Map(nameof(DimensionsQuantity), x => x.Dimensions.Quantity)
- .Map(nameof(DimensionsLength), x => x.Dimensions.Length)
- .Map(nameof(DimensionsHeight), x => x.Dimensions.Height)
- .Map(nameof(DimensionsWeight), x => x.Dimensions.Weight)
- .Map(nameof(DimensionsWidth), x => x.Dimensions.Width)
- .Map(nameof(DimensionsValue), x => x.Dimensions.Value)
- .Map(nameof(DimensionsUnitSize), x => x.Dimensions.UnitSize)
-
- .Map(nameof(Cost), x => x.Cost)
- .Map(nameof(Balance), x => x.Balance)
- ;
- }
- public Guid ProductID
- {
- get => Get<Guid>();
- set => Set(value);
- }
-
- public String ProductCode => Get<String>();
- public String ProductName => Get<String>();
-
- public Guid JobID
- {
- get => Get<Guid>();
- set => Set(value);
- }
-
- public String JobNumber => Get<String>();
- public String JobName => Get<String>();
- public Guid LocationID
- {
- get => Get<Guid>();
- set => Set(value);
- }
- public String LocationCode => Get<String>();
- public String LocationDescription => Get<String>();
- public Guid LocationAreaID => Get<Guid>();
- public String LocationAreaCode => Get<String>();
- public String LocationAreaDescription => Get<String>();
- public Guid StyleID
- {
- get => Get<Guid>();
- set => Set(value);
- }
- public String StyleCode => Get<String>();
- public String StyleDescription => Get<String>();
-
- public Guid RequisitionItemID
- {
- get => Get<Guid>();
- set => Set(value);
- }
-
- public Guid DimensionsUnitID
- {
- get => Get<Guid>();
- set => Set(value);
- }
-
- public double DimensionsQuantity
- {
- get => Get<double>();
- set => Set(value);
- }
-
- public double DimensionsLength
- {
- get => Get<double>();
- set => Set(value);
- }
-
-
- public double DimensionsWidth
- {
- get => Get<double>();
- set => Set(value);
- }
-
-
- public double DimensionsHeight
- {
- get => Get<double>();
- set => Set(value);
- }
-
-
- public double DimensionsWeight
- {
- get => Get<double>();
- set => Set(value);
- }
-
- public double DimensionsValue
- {
- get => Get<double>();
- set => Set(value);
- }
-
- public string DimensionsUnitSize
- {
- get => Get<string>();
- set => Set(value);
- }
-
- public Guid TransactionID
- {
- get => Get<Guid>();
- set => Set(value);
- }
-
- public Guid BatchID
- {
- get => Get<Guid>();
- set => Set(value);
- }
-
- public ImageSource Image => Type switch
- {
- StockMovementType.StockTake => ImageSource.FromFile("stock_stocktake"), // tick
- StockMovementType.Issue => ImageSource.FromFile("stock_issue"), //minus
- StockMovementType.Receive => ImageSource.FromFile("stock_receive"), //plus
- _ => ImageSource.FromFile("stock_relocate"), // transfer in/out
- };
-
- public Guid EmployeeID
- {
- get => Get<Guid>();
- set => Set(value);
- }
-
- public StockMovementType Type
- {
- get => Get<StockMovementType>();
- set => Set(value);
- }
-
- public DateTime Date
- {
- get => Get<DateTime>();
- set => Set(value);
- }
-
- public double Received
- {
- get => Get<double>();
- set => Set(value);
- }
-
- public double Issued
- {
- get => Get<double>();
- set => Set(value);
- }
- public double Units => Received - Issued;
- public double Qty => Units * DimensionsValue;
-
- public double Cost
- {
- get => Get<double>();
- set => Set(value);
- }
-
- public double Balance
- {
- get => Get<double>();
- set => Set(value);
- }
-
- public string Notes
- {
- get => Get<string>();
- set => Set(value);
- }
- }
- }
|