Esempio n. 1
0
        public MasterContract SaveMasterContract(MasterContract masterContract)
        {
            ContractDAO    contractDao = new ContractDAO(connectionString);
            MasterContract result;

            if (masterContract.Id == 0)
            {
                result = contractDao.InsertMasterContract(masterContract);
            }
            else
            {
                result = contractDao.UpdateMasterContract(masterContract);
            }

            if (result != null)
            {
                masterContract.Id     = result.Id;
                masterContract.Active = result.Active;
                SaveContractMasterItems(masterContract);
                SavePeriods(masterContract);
            }

            return(masterContract);
        }