private string validateModel(ContractModificationViewModel contractModificationViewModel)
 {
     if (_contractModificationService.IsExistModificationNumber(contractModificationViewModel.ContractGuid, contractModificationViewModel.ContractModificationGuid, contractModificationViewModel.ModificationNumber))
     {
         string errormessage = "Found Duplicate Modification Number !!";
         return(errormessage);
     }
     if (_contractModificationService.IsExistModificationTitle(contractModificationViewModel.ContractGuid, contractModificationViewModel.ContractModificationGuid, contractModificationViewModel.ModificationTitle))
     {
         string errormessage = "Found Duplicate Modification Title !!";
         return(errormessage);
     }
     return(YesNoStatus.Yes.ToString());
 }
Пример #2
0
        private DMMods CheckDuplicateMods(DMMods mods)
        {
            mods.IsValid = true;
            var isModNumberExist = _contractModificationService.IsExistModificationNumber(mods.ContractGuid, mods.ContractModificationGuid, mods.ModNumber);

            if (isModNumberExist)
            {
                mods.Reason       = "Duplicate Mod Number";
                mods.IsValid      = false;
                mods.ImportStatus = ImportStatus.Fail.ToString();
            }

            var isModTitleExist = _contractModificationService.IsExistModificationTitle(mods.ContractGuid, mods.ContractModificationGuid, mods.ModTitle);

            if (isModTitleExist)
            {
                mods.Reason       = "Duplicate Mod Title";
                mods.IsValid      = false;
                mods.ImportStatus = ImportStatus.Fail.ToString();
            }
            return(mods);
        }