C# Check Condition With Duplicated ID and Different Name -
i confirm coding correct due run seems doesn't checking on ic_no unique number , different name. point want set if statement if ic_no duplicate , different name out error.
if (!ic_no.equals(var_name)) { var_return = false; lfc.writetxtfile(var_logfilepath, var_errorlogfilename + "_" + var_minvalue + "-" + var_maxvalue + ".log", "error - ic_no duplicated different name (policy no: " + policyno + ", actual age: " + actualage + ", ic_no: " + ic_no + ", name: " + name + ", dob: " + var_day + "/" + var_month + "/" + var_year + ")", true, true, false); }
looking @ names of variables used in writetxtfile
method, can gather you're missing part of if statement... , collection policies.
you need keep track of ic_no , names in collection , check if given ic_no there's existing name already, this:
if (collectionofpolicies.firstordefault(x => x.ic_no == this.ic_no && x.name == this.name) != null) { // ... }
Comments
Post a Comment