static OutsideWS.SMC_PackagePicture CopyPackagePicture(SMC_PackagePicture pic)
 {
     OutsideWS.SMC_PackagePicture entity = new OutsideWS.SMC_PackagePicture();
     entity.pe_id = pic.pe_id;
     entity.pp_CreatedDate = pic.pp_CreatedDate;
     entity.pp_desc = pic.pp_desc;
     entity.pp_id = pic.pp_id;
     entity.pp_path = pic.pp_path;
     entity.pp_title = pic.pp_title;
     return entity;
 }
 public bool PackagePictuerSync(SMC_PackagePicture entity)
 {
     try
     {
         return bo.PackagePictuerSyncInsideToOutside(entity);
     }
     catch (Exception e)
     {
         Log4NetHelper.Error(e);
         return false;
     }
 }
        public virtual bool PackagePictuerSyncInsideToOutside(SMC_PackagePicture entity)
        {
            SMC_PackagePicture ext = pictureDao.Get(entity.pp_id);
            if (ext == null)
            {
                int maxid = pictureDao.GetMaxId();
                pictureDao.Insert(entity);

            }
            else
            {
                pictureDao.Update(entity);
            }
            return true;
        }
 public Service.ApplicationCenterWS.SMC_PackagePicture CopyPackagePicture(SMC_PackagePicture pic)
 {
     Service.ApplicationCenterWS.SMC_PackagePicture entity = new Service.ApplicationCenterWS.SMC_PackagePicture();
     entity.pe_id = pic.pe_id;
     entity.pp_CreatedDate = pic.pp_CreatedDate;
     entity.pp_desc = pic.pp_desc;
     entity.pp_id = pic.pp_id;
     entity.pp_path = pic.pp_path;
     entity.pp_title = pic.pp_title;
     return entity;
 }
 public virtual void InsertPackagePicture(SMC_PackagePicture packagePic)
 {
     packagePictureDao.Insert(packagePic);
 }
        public JsonResult CreatePackagePicture(FormCollection form)
        {
            JsonReturnMessages data = new JsonReturnMessages() { IsSuccess = true, Msg = "操作成功" };
            int i = Request.Files.Count;
            HttpPostedFileBase file = null;
            string filePath = "";
            string packageFileName = "";

            string packageId = form[0];
            string conSolePath = HttpRuntime.AppDomainAppPath;//服务器路径
            string pDir = SAVEOUTPATH + @"\" + packageId.ToString();//相对路径 用安装包ID做文件夹名
            string saveDir = conSolePath + pDir;

            try
            {
                if (i > 0)
                {
                    file = Request.Files[0];
                    filePath = file.FileName;
                    packageFileName = "截图-" + Path.GetFileName(filePath);
                    string savePath = System.IO.Path.Combine(saveDir, packageFileName);

                    if (!System.IO.Directory.Exists(saveDir))
                    {
                        System.IO.Directory.CreateDirectory(saveDir);
                    }
                    if (System.IO.File.Exists(savePath))
                    {
                        System.IO.File.Delete(savePath);
                    }

                    file.SaveAs(savePath);

                    //插入数据
                    SMC_PackagePicture spp = new SMC_PackagePicture();
                    spp.pp_id = BoFactory.GetVersionTrackBo.GetMaxPackagePicId() + 1;
                    spp.pe_id = Convert.ToInt32(packageId);
                    spp.pp_path = "~/" + SAVEOUTPATH + packageId.ToString() + @"\" + packageFileName;
                    spp.pp_path = spp.pp_path.Replace(@"\", "/");
                    spp.pp_title = form[1];
                    spp.pp_desc = form[2];
                    spp.pp_CreatedDate = DateTime.Now;

                    BoFactory.GetVersionTrackBo.InsertPackagePicture(spp);
                }
            }
            catch (Exception e)
            {
                Log4NetHelper.Error(e);
                data.IsSuccess = false;
                data.Msg = e.Message;
            }

            return Json(data, "text/html");
        }