/// <summary> /// /// </summary> /// <param name="modelSources"></param> void IImportData.CreateData(IList modelSources) { List <dynamic> models = modelSources as List <dynamic>; using BizCustomerRepository bizCustRepo = new BizCustomerRepository(DataAccess) { Message = Message }; using ReceiptBillRepository repo = new ReceiptBillRepository(DataAccess) { User = SystemOperator.SysOperator }; List <ChannelMapModel> channelMap = DataAccess.Set <ChannelMapModel>().ToList(); models.ForEach(model => { if (model is ReceiptInfoBillMarketModel) { repo.Create(BizReceiptInfo.GetReceiptBillSet(model, channelMap)); } else if (model is ReceiptInfoBillMarketSPIModel) { repo.Create(BizReceiptInfo.GetReceiptBillSet(model, channelMap)); } }); repo.CommitData(FuncAction.Create); }
/// <summary> /// /// </summary> /// <param name="modelSources"></param> void IImportData.CreateData(IList modelSources) { List <ReceiptInfoBillBankModel> models = modelSources as List <ReceiptInfoBillBankModel>; using ReceiptBillRepository billRepo = new ReceiptBillRepository(DataAccess) { Message = Message, User = SystemOperator.SysOperator }; models.ForEach(model => { ReceiptBillSet set = BizReceiptInfo.GetReceiptBillSet(model); billRepo.Create(set); }); billRepo.CommitData(FuncAction.Create); }
/// <summary> /// 新增資料 /// </summary> /// <param name="modelSources"></param> void IImportData.CreateData(IList modelSources) { List <ReceiptInfoBillPostModel> models = modelSources as List <ReceiptInfoBillPostModel>; using BizCustomerRepository bizCustRepo = new BizCustomerRepository(DataAccess) { Message = Message }; using ReceiptBillRepository repo = new ReceiptBillRepository(DataAccess) { Message = Message, User = SystemOperator.SysOperator }; List <ChannelMapModel> channelMap = DataAccess.Set <ChannelMapModel>().ToList(); foreach (ReceiptInfoBillPostModel model in models) { repo.Create(BizReceiptInfo.GetReceiptBillSet(model, channelMap)); } repo.CommitData(FuncAction.Create); }