Example #1
0
        public static Commons.FileHeader Add(Commons.FileHeader model)
        {
            Commons.FileHeader result = new Commons.FileHeader();
            using (IndexEntities db = new IndexEntities())
            {
                spi_FileHeader_Result data = db.spi_FileHeader(model.IdCustomer, model.IdFileInfoConfig, model.IdDocument, model.AuthorizationDate,
                                                               model.ExpantionDate, model.ExpirationDate, model.ArrivalDate, model.DocumentDate, model.ExchangeRate, model.Insurance,
                                                               model.Cargo, model.IdCustom, model.IdCountry, model.IdWarranty, model.IdCellar, model.IdCurrency,
                                                               model.IdResolution, model.IdAccount, model.CifTotal, model.LinesTotal, model.Facturas, model.RegisterUser).FirstOrDefault();

                result = FileHeader.Tranform(data);
            }

            return(result);
        }
Example #2
0
        private static Commons.FileHeader Tranform(spi_FileHeader_Result data)
        {
            Commons.FileHeader result = new Commons.FileHeader()
            {
                AccounName        = data.AccountName,
                ArrivalDate       = data.ArrivalDate,
                AuthorizationDate = data.AuthorizationDate,
                Cargo             = data.Cargo,
                CellarName        = data.CellarName,
                CifTotal          = data.CIFTotal,
                CountryName       = data.CountryName,
                CreateDate        = data.CreateDate,
                CurrencyName      = data.CurrencyName,
                CustomName        = data.CustomName,
                DocumentDate      = data.DocumentDate,
                ExchangeRate      = data.ExchangeRate,
                ExpantionDate     = data.ExpantionDate,
                ExpirationDate    = data.ExpirationDate,
                Facturas          = data.Facturas,
                FileInfoName      = data.FileName,
                Id               = data.Id,
                IdAccount        = data.IdAccount,
                IdCellar         = data.IdCellar,
                IdCountry        = data.IdCountry,
                IdCurrency       = data.IdCurrency,
                IdCustom         = data.IdCustom,
                IdCustomer       = data.IdCustomer,
                IdDocument       = data.IdDocument,
                IdFileInfoConfig = data.IdFileInfoConfig,
                IdResolution     = data.IdResolution,
                IdState          = data.IdState,
                IdWarranty       = data.IdWarranty,
                Insurance        = data.Insurance,
                IsSubstract      = data.IsSubstract,
                LinesTotal       = data.LinesTotal,
                LoadRawMaterial  = data.LoadRawMaterial,
                Operation        = data.Operation,
                ResolutionName   = data.ResolutionName,
                Reviewed         = data.Reviewed,
                StateName        = data.StateName,
                UseAttached      = data.UseAttached,
                WarrantyName     = data.WarrantyName,
                UpdateDate       = data.UpdateDate
            };

            return(result);
        }