public List <Unit> GetALLUnit() { UnitCreateDAO aDao = new UnitCreateDAO(); List <Unit> aList = new List <Unit>(); aList = aDao.GetALLUnit(); aList = aList.OrderBy(alist => alist.UnitName).ToList(); return(aList); }
public bool CheckExit(string sr) { UnitCreateDAO aDao = new UnitCreateDAO(); List <Unit> aList = new List <Unit>(); aList = aDao.GetALLUnit(); bool flag = false; foreach (Unit unit in aList) { if (unit.UnitName.ToUpper() == sr.ToUpper()) { flag = true; } } if (flag) { return(true); } return(false); }