public bool UpdateBizDeskStatus(BizDesk desk) { bool result = false; try { _daoManager.OpenConnection(); result = _deskDao.UpdateBizDeskStatus(desk); } catch (Exception exception) { LogHelper.GetInstance().Error(string.Format("[UpdateBizDeskStatus]参数:desk_{0}", JsonConvert.SerializeObject(desk)), exception); } finally { _daoManager.CloseConnection(); } return result; }
public bool UpdateBizDeskStatus(BizDesk desk) { int result = ExecuteUpdate("UpdateDeskStatus", desk); return result > 0; }
public static byte[] UpdateBizDeskStatus(byte[] itemBuffer) { byte[] objRet = null; string deskName = Encoding.UTF8.GetString(itemBuffer, ParamFieldLength.PACKAGE_HEAD, ParamFieldLength.DESK_NAME).Trim('\0'); string deviceNo = Encoding.UTF8.GetString(itemBuffer, ParamFieldLength.PACKAGE_HEAD + ParamFieldLength.DESK_NAME, ParamFieldLength.DEVICE_NO).Trim('\0'); int status = BitConverter.ToInt32(itemBuffer, ParamFieldLength.PACKAGE_HEAD + ParamFieldLength.DESK_NAME + ParamFieldLength.DEVICE_NO); BizDesk desk = new BizDesk(); desk.DeskName = deskName; desk.Status = status; desk.DeviceNo = deviceNo; bool result = DeskService.GetInstance().UpdateBizDeskStatus(desk); if (result) { //更新桌况成功 objRet = new byte[ParamFieldLength.PACKAGE_HEAD]; Array.Copy(BitConverter.GetBytes((int)RET_VALUE.SUCCEEDED), 0, objRet, 0, BasicTypeLength.INT32); Array.Copy(BitConverter.GetBytes(ParamFieldLength.PACKAGE_HEAD), 0, objRet, BasicTypeLength.INT32, BasicTypeLength.INT32); } else { //数据库操作失败 objRet = new byte[ParamFieldLength.PACKAGE_HEAD]; Array.Copy(BitConverter.GetBytes((int)RET_VALUE.ERROR_DB), 0, objRet, 0, BasicTypeLength.INT32); Array.Copy(BitConverter.GetBytes(ParamFieldLength.PACKAGE_HEAD), 0, objRet, BasicTypeLength.INT32, BasicTypeLength.INT32); } return objRet; }