private void OnMakeInstructionAttachToDeal() { // Fill class with data stockDealInfo = new StockDealInfo(); stockDealInfo.DealRegDate = DealRegDate; stockDealInfo.LotCode = LotCode; stockDealInfo.MemberName = MemberCode.name; stockDealInfo.MemberCode = MemberCode.code; stockDealInfo.SupplierName = SupplierName; stockDealInfo.SupplierCode = SupplierCode; stockDealInfo.Employe = Trader.fullName; stockDealInfo.ComDateIn = ComDateIn; stockDealInfo.ComDateOut = ComDateOut; // Path to copy new documents var wherePath = Service.GetDirectory(); if (wherePath != null) { var instructionAttachToDealService = new InstructionAttachToDealService(wherePath.FullName, stockDealInfo); // Copy template documents instructionAttachToDealService.CopyTemplates(); // Get info for attach to stock deal from sources and paste instructionAttachToDealService.GetInfoForAttachDocument(); // Get info for commission to deal from sources and paste instructionAttachToDealService.GetInfoForCommissionDocument(); // Open folder with new documents Process.Start("explorer", wherePath.FullName); } }
public InstructionAttachToDealService(string path, StockDealInfo stockDealInfo) { this.path = path; this.stockDealInfo = stockDealInfo; }