private DMCompany InputValidation(DMCompany company) { company.IsValid = false; var isCodeNumeric = ValidationHelper.AlphaNum(company.Code); if (!isCodeNumeric || company.Code.Length != 2) { company.Reason += "Invalid Code"; return(company); } if (company.Name.Length > 255) { company.Reason += "Name must not exceed more than 255 character"; company.ImportStatus = ImportStatus.Fail.ToString(); return(company); } company.IsValid = true; return(company); }