public CommonText getRow(int id, string title) { try { ICustomsCMS server = XmlRpcInstance.getInstance(); ImageTextInfo imageTextInfo = server.findEmerPlanbytitle(title); CommonText commonText = new CommonText(imageTextInfo.id, imageTextInfo.title); commonText.Bytes = imageTextInfo.content; return(commonText); } catch (Exception ex) { throw new Exception("错误:" + ex.Message); } }
/// <summary> /// 根据id和标题查询符合条件的记录 /// </summary> /// <param name="id">id</param> /// <param name="title">标题</param> /// <returns></returns> public Boolean findRowByIdAndTitle(int id, string title) { try { ICustomsCMS server = XmlRpcInstance.getInstance(); ImageTextInfo imageTextInfo = server.findEmerPlanbytitle(title); //查询出结果,同时id不和本身相同 if (imageTextInfo.id != 0 && imageTextInfo.id != id) { return(true); } return(false); } catch (Exception ex) { throw new Exception("错误:" + ex.Message); } }