Esempio n. 1
0
        private WRPicture AssamblyPic(IDataReader reader)
        {
            WRPicture wrPic = new WRPicture();

            wrPic.ID = reader["id"].ToString();
            string content = reader["content"].ToString();

            if (!string.IsNullOrEmpty(content))
            {
                wrPic.Content = content.Replace("\n", "");
            }
            return(wrPic);
        }
Esempio n. 2
0
 internal void AddWorkReportPictures(List <WRPicture> pics, string wrid)
 {
     if (pics == null || pics.Count < 1)
     {
         return;
     }
     for (int i = 0; i < pics.Count; i++)
     {
         WRPicture pic = pics[i];
         if (string.IsNullOrWhiteSpace(pic.ID) || pic.ID.Length != 36)
         {
             pic.ID = Guid.NewGuid().ToString();
         }
         //新增一条数据
         var insertStr = $@"INSERT INTO wrpictures(id, wrid, content, tenantid) VALUES ('{pic.ID}', '{wrid}', decode('{pic.Content}','base64'), '{Utils.GetTenantId()}')";
         db.ExecSqlStatement(insertStr);
     }
 }