Beispiel #1
0
        private bool SaveToDataBase(Guid annexCode, string thumbnailPath, string thumbnaName)
        {
            AnnexInfo singleAnnexInfo = this.annexAction.GetSingleAnnexInfo(annexCode);
            DataTable table           = publicDbOpClass.DataTableQuary("select a.projectcode,a.Remark from EPM_Book_ConstructTask a,Xpm_basic_AnnexList b where cast(a.noteid as nvarchar)=b.recordcode and b.recordcode='" + singleAnnexInfo.RecordCode + "'");
            string    str2            = "";

            if (table.Rows.Count > 0)
            {
                str2  = (table.Rows[0]["Remark"] as string) ?? string.Empty;
                table = publicDbOpClass.DataTableQuary("select prjName from PT_PrjInfo where prjguid='" + table.Rows[0]["projectcode"] + "'");
            }
            string str3 = "";

            if (table.Rows.Count > 0)
            {
                str3 = table.Rows[0]["prjName"].ToString();
            }
            Thumbnai thumbnai = new Thumbnai {
                ThumbnaiCode   = new Guid(annexCode.ToString()),
                ShowContent    = str3 + " " + DateTime.Now.ToString("yyyyMMdd"),
                ThumbnaImgPath = thumbnailPath + "thumbnail/",
                ThumbnaName    = thumbnaName,
                AddDate        = DateTime.Now,
                Remark         = str2,
                ImgPath        = singleAnnexInfo.FilePath + singleAnnexInfo.AnnexName
            };

            return(this.AddThumbnai(thumbnai));
        }
Beispiel #2
0
        private bool SavePhotoToDataBase(Guid annexCode, string thumbnailPath, string thumbnaName)
        {
            PrjInfoPhotoModel singlePhotoInfo = this.intendancePhotoListAction.GetSinglePhotoInfo(annexCode);
            Thumbnai          thumbnai        = new Thumbnai {
                ThumbnaiCode   = new Guid(annexCode.ToString()),
                ShowContent    = DateTime.Now.ToString("yyyyMMdd"),
                ThumbnaImgPath = thumbnailPath + "thumbnail/",
                ThumbnaName    = thumbnaName,
                AddDate        = DateTime.Now,
                Remark         = singlePhotoInfo.Remark,
                ImgPath        = singlePhotoInfo.PhotoPath + singlePhotoInfo.PhotoName
            };

            HttpContext.Current.Session["PrjInfo-thuPhoto-success"] = thumbnai;
            return(this.AddThumbnai(thumbnai));
        }
Beispiel #3
0
        public bool AddThumbnai(Thumbnai thumbnai)
        {
            StringBuilder builder = new StringBuilder();

            builder.Append("insert into XPM_Basic_Thumbnai (");
            builder.Append("ThumbnaiCode,ShowContent,ThumbnaImgPath,ThumbnaName,AddDate,ImgPath,Remark");
            builder.Append(") values('");
            builder.Append(thumbnai.ThumbnaiCode + "','");
            builder.Append(thumbnai.ShowContent + "','");
            builder.Append(thumbnai.ThumbnaImgPath + "','");
            builder.Append(thumbnai.ThumbnaName + "','");
            builder.Append(thumbnai.AddDate + "','");
            builder.Append(thumbnai.ImgPath + "','");
            builder.Append(thumbnai.Remark + "'");
            builder.Append(")");
            return(publicDbOpClass.ExecSqlString(builder.ToString()) == 1);
        }