Beispiel #1
0
        /// 查询某一个工单ID下的所有处理记录的附件信息
        /// <summary>
        /// 查询某一个工单ID下的所有处理记录的附件信息
        /// </summary>
        /// <param name="OrderID"></param>
        /// <returns></returns>
        public List <CommonAttachmentInfo> GetAttachmentProcessListByOrderID(string OrderID, int StoragePathType)
        {
            DataTable dt = Dal.CommonAttachment.Instance.GetAttachmentProcessListByOrderID(OrderID, StoragePathType);
            List <CommonAttachmentInfo> list = new List <CommonAttachmentInfo>();

            if (dt != null && dt.Rows.Count > 0)
            {
                foreach (DataRow dr in dt.Rows)
                {
                    CommonAttachmentInfo model = new CommonAttachmentInfo(dr);
                    //对FilePath进行完整化赋值
                    model.FilePath = "/upload/" + BLL.Util.GetUploadProject((BitAuto.ISDC.CC2012.BLL.Util.ProjectTypePath)model.BTypeID, "") + model.FilePath;
                    // 将缩略图文件路径存入model.SmallFilePath中
                    string[] smallFileAllPathArr = model.FilePath.Split('.');
                    model.SmallFilePath = smallFileAllPathArr[0] + "_small." + smallFileAllPathArr[1];
                    list.Add(model);
                }
            }
            return(list);
        }
 /// 保存附件
 /// <summary>
 /// 保存附件
 /// </summary>
 /// <param name="jsondata"></param>
 /// <param name="sysinfo"></param>
 public void SaveCommonAttachment(WOrderProcessJsonData jsondata, SysRightUserInfo sysinfo)
 {
     if (jsondata.imgData != null)
     {
         foreach (AttachmentJsonData item in jsondata.imgData)
         {
             CommonAttachmentInfo attach = new CommonAttachmentInfo();
             attach.BTypeID      = (int)BLL.Util.ProjectTypePath.WorkOrder;
             attach.RelatedID    = jsondata.ProcessID.ToString();
             attach.FileName     = item.FileRealName_Out;
             attach.FileType     = item.FileType_Out;
             attach.FileSize     = item.FileSize_Out;
             attach.FilePath     = item.FileAllPath_Out;
             attach.Status       = 0;
             attach.CreateUserID = sysinfo.UserID;
             attach.CreateTime   = DateTime.Now;
             CommonBll.Instance.InsertComAdoInfo(attach);
         }
     }
 }