/// <summary> /// Saves this instance. /// </summary> /// <returns></returns> public int Save(int replication) { var fixedAsset = new FixedAssetModel { FixedAssetId = View.FixedAssetId, FixedAssetCode = View.FixedAssetCode, FixedAssetName = View.FixedAssetName, FixedAssetForeignName = View.FixedAssetForeignName, FixedAssetCategoryId = View.FixedAssetCategoryId, State = View.State, Description = View.Description, ProductionYear = View.ProductionYear, MadeIn = View.MadeIn, PurchasedDate = View.PurchasedDate, UsedDate = View.UsedDate, DepreciationDate = View.DepreciationDate, IncrementDate = View.IncrementDate, DisposedDate = View.DisposedDate, Unit = View.Unit, SerialNumber = View.SerialNumber, Accessories = View.Accessories, Quantity = View.Quantity, UnitPrice = View.UnitPrice, OrgPrice = View.OrgPrice, AccumDepreciationAmount = View.AccumDepreciationAmount, RemainingAmount = View.RemainingAmount, CurrencyCode = View.CurrencyCode, ExchangeRate = View.ExchangeRate, UnitPriceUSD = View.UnitPriceUSD, OrgPriceUSD = View.OrgPriceUSD, AccumDepreciationAmountUSD = View.AccumDepreciationAmountUSD, RemainingAmountUSD = View.RemainingAmountUSD, AnnualDepreciationAmountUSD = View.AnnualDepreciationAmountUSD, AnnualDepreciationAmount = View.AnnualDepreciationAmount, LifeTime = View.LifeTime, DepreciationRate = View.DepreciationRate, OrgPriceAccountCode = View.OrgPriceAccountCode, DepreciationAccountCode = View.DepreciationAccountCode, CapitalAccountCode = View.CapitalAccountCode, DepartmentId = View.DepartmentId, EmployeeId = View.EmployeeId, IsActive = View.IsActive, FixedAssetCurrencies = View.FixedAssetCurrencies, NumberOfFloor = View.NumberOfFloor, AreaOfBuilding = View.AreaOfBuilding, AreaOfFloor = View.AreaOfFloor, AdministrationArea = View.AdministrationArea, WorkingArea = View.WorkingArea, HousingArea = View.HousingArea, VacancyArea = View.VacancyArea, OccupiedArea = View.OccupiedArea, LeasingArea = View.LeasingArea, GuestHouseArea = View.GuestHouseArea, OtherArea = View.OtherArea, NumberOfSeat = View.NumberOfSeat, ControlPlate = View.ControlPlate, IsStateManagement = View.IsStateManagement, IsBussiness = View.IsBussiness, Address = View.Address, BudgetSourceCode = View.BudgetSourceCode, ManagementCar = View.ManagementCar, Brand = View.Brand, IsEstimateEmployee = View.IsEstimateEmployee, ArmortizationAccount = View.ArmortizationAccount, BudgetItemCode = View.BudgetItemCode, FixedAssetAccessarys = View.FixedAssetAccessarys, DateSuspension = View.DateSuspension, ReasonSuspension = View.ReasonSuspension }; if (View.FixedAssetId == 0) { return(Model.AddFixedAssetReplication(fixedAsset, replication)); } return(Model.UpdateFixedAssetReplication(fixedAsset, replication)); }
internal static FixedAssetEntity ToDataTransferObject(FixedAssetModel model) { return(model == null ? null : AutoMapper.Mapper.Map <FixedAssetModel, FixedAssetEntity>(model)); }
/// <summary> /// Saves this instance. /// </summary> /// <returns></returns> public string save(DateTime systemDate) { var fixedasset = new FixedAssetModel(); fixedasset.FixedAssetId = View.FixedAssetId; fixedasset.FixedAssetCategoryId = View.FixedAssetCategoryId; fixedasset.DepartmentId = View.DepartmentId; fixedasset.FixedAssetCode = View.FixedAssetCode; fixedasset.FixedAssetName = View.FixedAssetName; fixedasset.Quantity = View.Quantity; fixedasset.Description = View.Description; fixedasset.ProductionYear = View.ProductionYear; fixedasset.MadeIn = View.MadeIn; fixedasset.SerialNumber = View.SerialNumber; fixedasset.Accessories = View.Accessories; fixedasset.VendorId = View.VendorId; fixedasset.GuaranteeDuration = View.GuaranteeDuration; fixedasset.IsSecondHand = View.IsSecondHand; fixedasset.LastState = View.LastState; fixedasset.DisposedDate = View.DisposedDate; fixedasset.DisposedAmount = View.DisposedAmount; fixedasset.DisposedReason = View.DisposedReason; fixedasset.PurchasedDate = View.PurchasedDate; fixedasset.UsedDate = View.UsedDate; fixedasset.DepreciationDate = View.DepreciationDate; fixedasset.IncrementDate = View.IncrementDate; fixedasset.OrgPrice = View.OrgPrice; fixedasset.DepreciationValueCaculated = View.DepreciationValueCaculated; fixedasset.AccumDepreciationAmount = View.AccumDepreciationAmount; fixedasset.LifeTime = View.LifeTime; fixedasset.DepreciationRate = View.DepreciationRate; fixedasset.PeriodDepreciationAmount = View.PeriodDepreciationAmount; fixedasset.RemainingAmount = View.RemainingAmount; fixedasset.RemainingLifeTime = View.RemainingLifeTime; fixedasset.EndYear = View.EndYear; fixedasset.OrgPriceAccount = View.OrgPriceAccount; fixedasset.CapitalAccount = View.CapitalAccount; fixedasset.CreditDepreciationAccount = View.CreditDepreciationAccount; fixedasset.DebitDepreciationAccount = View.DebitDepreciationAccount; fixedasset.IsFixedAssetTransfer = View.IsFixedAssetTransfer; fixedasset.DepreciationTimeCaculated = View.DepreciationTimeCaculated; fixedasset.Unit = View.Unit; fixedasset.Source = View.Source; fixedasset.RevenueAccount = View.RevenueAccount; fixedasset.IsActive = View.IsActive; fixedasset.UsingRatio = View.UsingRatio; fixedasset.DevaluationDate = View.DevaluationDate; fixedasset.DevaluationLifeTime = View.DevaluationLifeTime; fixedasset.DevaluationPeriod = View.DevaluationPeriod; fixedasset.DevaluationRate = View.DevaluationRate; fixedasset.BudgetChapterCode = View.BudgetChapterCode; fixedasset.BudgetSubKindItemCode = View.BudgetSubKindItemCode; fixedasset.BudgetKindItemCode = View.BudgetKindItemCode; fixedasset.BudgetSubItemCode = View.BudgetSubItemCode; fixedasset.BudgetItemCode = View.BudgetItemCode; fixedasset.DevaluationDebitAccount = View.DevaluationDebitAccount; fixedasset.DevaluationCreditAccount = View.DevaluationCreditAccount; fixedasset.AccumDevaluationAmount = View.AccumDevaluationAmount; fixedasset.FixedAssetDetailAccessories = View.FixedAssetDetailAccessories; fixedasset.FixedAssetVoucherAttachs = View.FixedAssetVoucherAttachs; fixedasset.EndDevaluationDate = View.EndDevaluationDate; fixedasset.PeriodDevaluationAmount = View.PeriodDevaluationAmount; fixedasset.DevaluationAmount = View.DevaluationAmount; fixedasset.FundStructureId = View.FundStructureId; if (View.FixedAssetId == null) { return(Model.AddFixedAsset(fixedasset)); } return(Model.UpdateFixedAsset(fixedasset, systemDate)); }