//1. We move this unnecessary code to CommonRoutine class //public bool IsEmpty(string value) //{ // if (value.Length == 0) // { // return true; // } // return false; //} public void Insert() { CommonRoutine.count++; if (!CommonRoutine.IsEmpty(CustomerCode) && !CommonRoutine.IsEmpty(CustomerName)) { } }
public void Insert() { //Record country info into the db CommonRoutine.count++; if (!CommonRoutine.IsEmpty(CountryCode) && !CommonRoutine.IsEmpty(CountryName)) { } }