Example #1
0
        public Boolean addRow(CommonText commonText)
        {
            ////以下删掉
            ////实例化一个文件流--->与写入文件相关联
            //FileStream fo = new FileStream("D:/tmp/tmp.rtf", FileMode.Create);
            ////实例化BinaryWriter
            //BinaryWriter bw = new BinaryWriter(fo);
            //bw.Write(commonText.Bytes);
            ////清空缓冲区
            //bw.Flush();
            ////关闭流
            //bw.Close();
            //fo.Close();

            try
            {
                ICustomsCMS   server        = XmlRpcInstance.getInstance();
                ImageTextInfo imageTextInfo = new ImageTextInfo();
                imageTextInfo.title   = commonText.Title;
                imageTextInfo.content = commonText.Bytes;
                imageTextInfo.authod  = SystemManageService.currentUser.UserName;
                DBRPCResponse dBRPCResponse = server.putWorkRule(imageTextInfo);
                return(true);
            }
            catch (Exception ex)
            {
                throw new Exception("错误:" + ex.Message);
            }
        }
 public CommonText getRow(int id, string title)
 {
     try
     {
         ICustomsCMS   server        = XmlRpcInstance.getInstance();
         ImageTextInfo imageTextInfo = server.findEpideInfobytitle(title);
         CommonText    commonText    = new CommonText(imageTextInfo.id, imageTextInfo.title);
         commonText.Bytes = imageTextInfo.content;
         return(commonText);
     }
     catch (Exception ex)
     {
         throw new Exception("错误:" + ex.Message);
     }
 }
 public Boolean addRow(CommonText commonText)
 {
     try
     {
         ICustomsCMS   server        = XmlRpcInstance.getInstance();
         ImageTextInfo imageTextInfo = new ImageTextInfo();
         imageTextInfo.title   = commonText.Title;
         imageTextInfo.content = commonText.Bytes;
         imageTextInfo.authod  = SystemManageService.currentUser.UserName;
         DBRPCResponse dBRPCResponse = server.putEpideInfo(imageTextInfo);
         return(true);
     }
     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.findEpideInfobytitle(title);
         //查询出结果,同时id不和本身相同
         if (imageTextInfo.id != 0 && imageTextInfo.id != id)
         {
             return(true);
         }
         return(false);
     }
     catch (Exception ex)
     {
         throw new Exception("错误:" + ex.Message);
     }
 }