public AccountObject CheckLogin(AccountObject obj) { var db = new eTrainingScheduleEntities(); var list = db.sp_Account_CheckLogin(obj.Username, obj.PassWord); foreach (var item in list) { AccountObject ob = new AccountObject(); ob.UserId = item.UserId; ob.FullName = item.FullName; ob.PassWord = item.PassWord; ob.Username = item.Username; ob.Email = item.Email; ob.Phone = item.Phone; ob.Description = item.Description; ob.Isdeleted = item.Isdeleted; ob.RoleId = item.RoleId; return(ob); } return(null); }