public List<Location> GetLocation(string BarCodeAndRFID) { List<Location> locList = new List<Location>(); try { CycleCount objCycleCount = new CycleCount(); objCycleCount.BarCodeAndRFID = BarCodeAndRFID; DataTable dtLoc = objCycleCount.GetLocation(); foreach (DataRow drLoc in dtLoc.Rows) { Location objloc = new Location(); objloc.LocationID = Convert.ToInt32(drLoc["LocID"]); objloc.DisplayName = drLoc["Locationname"].ToString(); locList.Add(objloc); } } catch (Exception ex) { _log.Error("Error:GetLocation:: " + ex.Message + Environment.NewLine + ex.StackTrace); ThrowFaultError(ex.Message, 200); } return locList; }