示例#1
0
        /// <summary>
        /// Generates the PO Number and creates the cadence data in
        /// MOL database to avoid dump in ZSDI3003_CONTRACT_CREATE.
        /// </summary>
        /// <param name="contract">The contract generated from Master Contract Items.</param>
        public NormalContract GenerateAndSaveNormalContractAndItems(NormalContract normalContract)
        {
            ContractDAO    contractDAO         = new ContractDAO(connectionString);
            NormalContract savedNormalContract = contractDAO.GenerateNormalContract(normalContract);

            foreach (NormalContractItem normalContractItem in normalContract.NormalContractItems)
            {
                normalContractItem.ContractId = savedNormalContract.Id;
                NormalContractItem savedNormalContractItem = contractDAO.InsertNormalContractItem(normalContractItem, normalContract.StartDate.Value, normalContract.CreationUser);
                savedNormalContractItem.Incoterms = normalContractItem.Incoterms;
                savedNormalContractItem.Region    = normalContractItem.Region;
                savedNormalContract.NormalContractItems.Add(savedNormalContractItem);
            }

            return(savedNormalContract);
        }