日期:2014-05-18 浏览次数:20912 次
public bool Login(PersonInfo personInfo) { bool result = false; try { this.Execute(() => { this.DataContext.DeferredLoadingEnabled = false; var temp = from pi in this.DataContext.PersonInfos where pi.PersonName == personInfo.PersonName && pi.Password == personInfo.Password select pi; var person = temp.SingleOrDefault(); if (person == null) { return false; } else { return true; } }); } catch (Exception ex) { SetErrorInfo(ex.Message, ex); } return result; }