Exemple #1
0
        public virtual async Task <IHttpActionResult> UpsertFleetData(FleetDataContract data)
        {
            data.UserName = User.Identity.Name;
            var service = Bootstrapper.Container.Resolve <IFleetService>();
            var result  = await Task.Run(() => service.UpsertDataEntry(data));

            return(Ok(result));
        }
        private static void FleetPetrolThirdParty(FileHandlerBase <GenericDataContract> handler, GenericDataContract obj)
        {
            var data = new FleetDataContract
            {
                CostCode  = obj.CostCode,
                EndDate   = obj.EndDate,
                Money     = obj.Money,
                RowNo     = obj.RowNo,
                SourceId  = obj.SourceId,
                StartDate = obj.StartDate,
                Units     = obj.Units,
                FuelType  = FuelType.Petrol,
                Scope     = FleetScope.ThirdParty
            };

            handler.CallService <IFleetService>(service => service.UpsertDataEntry(data));
        }