/// <summary> /// Saves this instance. /// </summary> /// <returns></returns> public int Save() { var accountTranfer = new AccountTranferModel { AccountTranferId = View.AccountTranferId, AccountTranferCode = View.AccountTranferCode, SortOrder = View.SortOrder, AccountSourceCode = View.AccountSourceCode, AccountDestinationCode = View.AccountDestinationCode, ReferentAccount = View.ReferentAccount, BudgetSourceId = View.BudgetSourceId, SideOfTranfer = View.SideOfTranfer, Type = View.Type, Description = View.Description, IsActive = View.IsActive }; return(View.AccountTranferId == 0 ? Model.AddAccountTranfer(accountTranfer) : Model.UpdateAccountTranfer(accountTranfer)); }
internal static AccountTranferEntity ToDataTransferObject(AccountTranferModel model) { return(model == null ? null : AutoMapper.Mapper.Map <AccountTranferModel, AccountTranferEntity>(model)); }