public Status GetAllCookHouseInfo() { this._logger.LogWarning("The Server execute GetAllCookHouseInfo Function --" + DateTime.Now.ToString()); using (SchoolCookHouseContext dbcontext = new SchoolCookHouseContext()) { var result = dbcontext.TCookHouseInfo.ToList(); if (result.Count > 0) { CookHouseInfoStatus userInfoStatus = new CookHouseInfoStatus { StatusCode = 200, Message = "获取成功", ReturnTime = DateTime.Now, CookHouseInfo = result }; return(userInfoStatus); } else { Status status = new Status { StatusCode = 0, Message = "获取失败", ReturnTime = DateTime.Now, }; return(status); } } }
public Status GetConditionCookHouseInfo(string cookhousename) { this._logger.LogWarning("The server execute GetConditionCookHouseInfo Fuction --" + DateTime.Now.ToString()); using (SchoolCookHouseContext dbcontext = new SchoolCookHouseContext()) { var result = dbcontext.TCookHouseInfo.Where(a => a.CookHouseName == cookhousename).ToList(); if (result.Count > 0) { CookHouseInfoStatus cookHouseInfoStatus = new CookHouseInfoStatus { StatusCode = 200, Message = "查询成功", ReturnTime = DateTime.Now, CookHouseInfo = result }; return(cookHouseInfoStatus); } else { Status status = new Status { StatusCode = 0, Message = "查询失败", ReturnTime = DateTime.Now, }; return(status); } } }