public virtual SelectPagnationExDictionary GetUnImportedAppPackages(string name, string displayName, string clientType, string lost_time_start, string lost_time_end, string type, string orderby, int pageSize, int pageIndex) { Package4AIDao dao = new Package4AIDao(AppConfig.mainDbKey); SelectPagnationExDictionary result = dao.GetUnImportedAppPackages(name, displayName, clientType, lost_time_start, lost_time_end, type, orderby, pageSize, pageIndex); return(result); }
public virtual DataSet GetLightAppAreaPackageList(string unitCode) { DataSet ds = packageDao.GetLightAppAreaPackageList(unitCode); return ds; DataColumn clmn = ds.Tables[0].Columns.Add("id", typeof(int)); clmn = ds.Tables[0].Columns.Add("name"); clmn.DataType = typeof(string); clmn = ds.Tables[0].Columns.Add("displayname"); clmn.DataType = typeof(string); clmn = ds.Tables[0].Columns.Add("description"); clmn.DataType = typeof(string); clmn = ds.Tables[0].Columns.Add("version"); clmn.DataType = typeof(string); clmn = ds.Tables[0].Columns.Add("buildver"); clmn.DataType = typeof(string); clmn = ds.Tables[0].Columns.Add("downloaduri"); clmn.DataType = typeof(string); foreach (DataRow dr in ds.Tables[0].Rows) { string tablename = dr["tablename"].ToString().ToLower(); int tableid = Convert.ToInt32(dr["tableid"]); switch (tablename) { case "package4ai": Package4AIDao padao = new Package4AIDao(AppConfig.mainDbKey); Package4AI entity = padao.Get(tableid); dr["id"] = tableid; dr["name"] = entity.Name; dr["displayname"] = entity.DisplayName; dr["description"] = entity.Description; dr["version"] = entity.Version; dr["buildver"] = entity.BuildVer; dr["downloaduri"] = entity.DownloadUri; break; case "webapplication": WebApplicationDao wad = new WebApplicationDao(AppConfig.mainDbKey); WebApplication application = wad.Get(tableid); dr["id"] = tableid; dr["name"] = application.ShortName; dr["displayname"] = application.ShortName; dr["description"] = ""; dr["version"] = ""; dr["buildver"] = ""; dr["downloaduri"] = application.Uri; break; case "smc_package4out": SMC_Package4OutDao poDao = new SMC_Package4OutDao(AppConfig.statisticDBKey); SMC_Package4Out outEntity = poDao.Get(tableid); dr["id"] = tableid; dr["name"] = outEntity.Name; dr["displayname"] = outEntity.DisplayName; dr["description"] = outEntity.Description; dr["version"] = outEntity.Version; dr["buildver"] = outEntity.BuildVer; dr["downloaduri"] = outEntity.DownloadUri; break; } } return ds; }
public virtual JsonFlexiGridData QueryNeedImportedPackageList(PageView view) { try { Package4AIDao dao = new Package4AIDao(AppConfig.statisticDBKey); return dao.QueryNeedImportedPackageList(view); } catch (DalException ex) { throw new BOException("查询包的同步信息出错", ex); } }
/// <summary> /// 复制安装包到更新文件目录 /// </summary> /// <param name="ext"></param> private void _CopyExtFileToUpdateFilesFolder(SMC_PackageExt ext) { string pathSource = HttpContext.Current.Server.MapPath(ext.pe_FileUrl); //string[] files = Directory.GetFiles(pathSource); Dao.Package4AIDao daoPackage4AI = new Package4AIDao(AppConfig.mainDbKey); IList <KeyValuePair <string, object> > pars = new List <KeyValuePair <string, object> >(); pars.Add(new KeyValuePair <string, object>("id", ext.TableID)); Package4AI package4AI = daoPackage4AI.Get(pars); //string sourceFileName = Path.GetFileName(ext.pe_FileUrl); //foreach (string file in files) { string sFileName = Path.GetFileName(pathSource); if (sFileName.EndsWith(".ipa") || sFileName.EndsWith(".apk")) { string destFileName = Path.GetFileName(ext.pe_DownloadUri); string destFolder = AppConfig.PackUploadFolder; if (destFolder.EndsWith(@"\") == false) { destFolder += @"\"; } destFolder += destFileName; try { File.Copy(pathSource, destFolder, true); } catch (Exception ex) { Log4NetHelper.Error(ex); } } string savefilePath = AppConfig.PublishConfig.GetValue(ext.pe_ClientType).Path; //saveFileName = savefilePath; string saveFilePathOut = ""; if (savefilePath.IndexOf("$") != -1) { string[] savefilePaths = savefilePath.Split("$".ToCharArray()); savefilePath = savefilePaths[0]; saveFilePathOut = savefilePaths[1]; } //内网本地存储固定名称的主程序 try { System.IO.File.Copy(pathSource, savefilePath, true); } catch (Exception ex) { Log4NetHelper.Error(ex); } Service.ApplicationCenterWS.WebService acws = new Service.ApplicationCenterWS.WebService(); //StreamReader sr = new StreamReader(); FileStream fs = new FileStream(pathSource, FileMode.Open); byte[] content = new byte[fs.Length]; fs.Read(content, 0, (int)fs.Length - 1); fs.Close(); fs.Dispose(); //发布到外网存储固定名称的主程序 if (package4AI != null && package4AI.Type.ToLower() == "main") { acws.RemotePublish(content, saveFilePathOut); } } }
/// <summary> /// 复制安装包到更新文件目录 /// </summary> /// <param name="ext"></param> private void _CopyExtFileToUpdateFilesFolder(SMC_PackageExt ext) { string pathSource = HttpContext.Current.Server.MapPath(ext.pe_FileUrl); //string[] files = Directory.GetFiles(pathSource); Dao.Package4AIDao daoPackage4AI = new Package4AIDao(AppConfig.mainDbKey); IList<KeyValuePair<string, object>> pars = new List<KeyValuePair<string, object>>(); pars.Add(new KeyValuePair<string, object>("id", ext.TableID)); Package4AI package4AI = daoPackage4AI.Get(pars); //string sourceFileName = Path.GetFileName(ext.pe_FileUrl); //foreach (string file in files) { string sFileName = Path.GetFileName(pathSource); if (sFileName.EndsWith(".ipa") || sFileName.EndsWith(".apk")) { string destFileName = Path.GetFileName(ext.pe_DownloadUri); string destFolder = AppConfig.PackUploadFolder; if (destFolder.EndsWith(@"\") == false) { destFolder += @"\"; } destFolder += destFileName; try { File.Copy(pathSource, destFolder, true); } catch (Exception ex) { Log4NetHelper.Error(ex); } } string savefilePath = AppConfig.PublishConfig.GetValue(ext.pe_ClientType).Path; //saveFileName = savefilePath; string saveFilePathOut = ""; if (savefilePath.IndexOf("$") != -1) { string[] savefilePaths = savefilePath.Split("$".ToCharArray()); savefilePath = savefilePaths[0]; saveFilePathOut = savefilePaths[1]; } //内网本地存储固定名称的主程序 try { System.IO.File.Copy(pathSource, savefilePath, true); } catch (Exception ex) { Log4NetHelper.Error(ex); } Service.ApplicationCenterWS.WebService acws = new Service.ApplicationCenterWS.WebService(); //StreamReader sr = new StreamReader(); FileStream fs = new FileStream(pathSource, FileMode.Open); byte[] content = new byte[fs.Length]; fs.Read(content, 0, (int)fs.Length - 1); fs.Close(); fs.Dispose(); //发布到外网存储固定名称的主程序 if (package4AI != null && package4AI.Type.ToLower() == "main") acws.RemotePublish(content, saveFilePathOut); } }
public virtual SelectPagnationExDictionary GetUnImportedAppPackages(string name, string displayName, string clientType, string lost_time_start, string lost_time_end, string type, string orderby, int pageSize, int pageIndex) { Package4AIDao dao = new Package4AIDao(AppConfig.mainDbKey); SelectPagnationExDictionary result = dao.GetUnImportedAppPackages(name, displayName, clientType, lost_time_start, lost_time_end, type, orderby, pageSize, pageIndex); return result; }