コード例 #1
0
        public ActionResult SaveConfigInfo(FormCollection form,PluginInfo p,string vid)
        {
            var vmobject = new JsonReturnMessages();
            try
            {
                IList<ConfigInfo> list = new List<ConfigInfo>();
                IList<PluginInfo> listp = new List<PluginInfo>();
                string[] keys = form.AllKeys;
                for (int i = 0; i < keys.Length; i++)
                {
                    if (keys[i].EndsWith(".Key1"))
                    {
                        ConfigInfo config = new ConfigInfo();
                        string prefix = keys[i].Split('.')[0];
                        UpdateModel(config, prefix);  //��������ͬʱ���Ի������ʵ�����
                        config.PluginCode = prefix.Split('|')[0];
                        config.ConfigCategoryCode = Constants.configCategory;
                        list.Add(config);
                    }
                }
                //��ò��CODE
                for (int i = 0; i < keys.Length; i++)
                {
                    if (keys[i].EndsWith(".PluginCode"))
                    {
                        PluginInfo pi = new PluginInfo();
                        string prefix = keys[i].Split('.')[0];
                        UpdateModel(pi, prefix);  //��������ͬʱ���Ի������ʵ�����
                        pi.CompanyName = p.CompanyName;
                        pi.CompanyLinkman = p.CompanyLinkman;
                        pi.CompanyHomePage = p.CompanyHomePage;
                        pi.CompanyTel = p.CompanyTel;
                        listp.Add(pi);
                    }
                }
                //����
                BoFactory.GetVersionTrackBo.UpdateConfigInfos(list, listp);//����

                InsertXmlByConfig(vid);//����config

                SearchVersionTrack search = new SearchVersionTrack();
                search.VID = vid;
                VersionTrack v = BoFactory.GetVersionTrackBo.GetVersionTrack(search)[0];
                string[] codes = v.FilePath.Split(new string[] { "\\" }, StringSplitOptions.None);
                string name = codes[codes.Length - 2];//��ȡ���code

                Beyondbit.AutoUpdate.IPublisher pub = new Beyondbit.SmartBox.Publisher.SmartBoxPublisher();
                if (Directory.Exists(Path.Combine(AppConfig.pubFolder, name + AppConfig.subFix)))//������ڴ��ļ���
                    pub.UpdateApplication(v.FilePath, name);
                else
                    pub.CreateApplication(v.FilePath, name);

                vmobject.IsSuccess = true;
                vmobject.Msg = "�����ɹ�";

            }
            catch (Exception ex)
            {
                vmobject.IsSuccess = false;
                vmobject.Msg = ex.Message;
            }
            return Json(vmobject);
        }
コード例 #2
0
 private PluginInfoTemp TPluginInfo(PluginInfo plugin)
 {
     PluginInfoTemp p = new PluginInfoTemp();
     p.CompanyHomePage = plugin.CompanyHomePage;
     p.CompanyLinkman = plugin.CompanyLinkman;
     p.CompanyName = plugin.CompanyName;
     p.CompanyTel = plugin.CompanyTel;
     p.DirectoryName = plugin.DirectoryName;
     p.DisplayName = plugin.DisplayName;
     p.FileName = plugin.FileName;
     p.HashCode = plugin.HashCode;
     p.IsDefault = plugin.IsDefault;
     p.IsNeed = plugin.IsNeed;
     p.PluginCateCode = plugin.PluginCateCode;
     p.PluginUrl = plugin.PluginUrl;
     p.Sequence = plugin.Sequence;
     p.PluginSummary = plugin.Summary;
     p.TypeFullName = plugin.TypeFullName;
     p.Version = plugin.Version;
     p.PluginCode = plugin.PluginCode;
     p.IsNew = plugin.IsNew;
     p.IsUse = plugin.IsUse;
     p.IsIgnoreConfig = plugin.IsIgnoreConfig;
     p.configList = plugin.configList;
     p.ActionCode = plugin.ActionCode;
     p.ActionSummary = plugin.ActionSummary;
     p.VersionSummary = plugin.VersionSummary;
     return p;
 }
コード例 #3
0
        public ActionResult SavePluginInfo(FormCollection form, PluginInfo pluginInfo,ActionExtend actionExtend)
        {
            var vmobject = new JsonReturnMessages();
            try
            {
                actionExtend.Summary = form["ESummary"].ToString();//��չ��Ϣ����

                BoFactory.GetVersionTrackBo.UpdatePluginInfo(pluginInfo, actionExtend);

                vmobject.IsSuccess = true;
                vmobject.Msg = "�����ɹ�!";
            }
            catch (Exception ex)
            {
                vmobject.IsSuccess = false;
                vmobject.Msg = ex.Message;
            }
            return Json(vmobject);
        }
コード例 #4
0
 public ActionResult EditConfigs(FormCollection form, ConfigInfo cog,PluginInfo plu)
 {
     var vmobject = new JsonReturnMessages();
     try
     {
         cog.Key1 = form["[key]"];
         if (string.IsNullOrEmpty(cog.ConfigId))
         {
             IList<ConfigInfo> list = new List<ConfigInfo>();
             list.Add(cog);
             //BoFactory.GetVersionTrackBo.InserConfigInfo(list, cog.PluginCode);
         }
         else
         {
             BoFactory.GetVersionTrackBo.UpdateConfigInfo(cog);
         }
         vmobject.IsSuccess = true;
         vmobject.Msg = "�����ɹ�!";
     }
     catch (Exception ex)
     {
         vmobject.IsSuccess = false;
         vmobject.Msg = ex.Message;
     }
     return Json(vmobject);
 }
コード例 #5
0
 public void UpdatePluginInfo(PluginInfo pInfo)
 {
     try
     {
         pluginDao.Update(pInfo);
     }
     catch (DalException ex)
     {
         throw new BOException("新增插件信息出错", ex);
     }
 }
コード例 #6
0
        public virtual string UpdateWebPluginInfo(PluginInfo pInfo, ActionExtend action, VersionTrack version, string isAdd, string uid)
        {
            try
            {
                string verfilepath = "";
                string oldfilepath = "";
                if (isAdd.Equals("0"))//若为修改
                {
                    SearchVersionTrack search = new SearchVersionTrack();
                    search.VID = version.VersionId.ToString();
                    VersionTrack ver = GetVersionTrack(search)[0];
                    oldfilepath = ver.FilePath;
                    ver.VersionName = version.VersionName;//修改的版本号
                    ver.FilePath = Path.Combine(AppConfig.filePath + pInfo.PluginCode, version.VersionName);
                    ver.LastModTime = DateTime.Now;
                    ver.LastModUid = uid;

                    verfilepath = ver.FilePath;

                    UpdateVersionTrack(ver);//更新版本表
                }
                else//若为升级
                {
                    verfilepath = version.FilePath;
                    InsertVersionTrack(version);
                }

                UpdatePluginInfo(pInfo, action);//更新插件表和扩展信息表

                SearchConfig searchcof = new SearchConfig();
                searchcof.PluginCode = pInfo.PluginCode.ToString();
                BoFactory.GetVersionTrackBo.DeleteConfigInfo(searchcof);//先删除原由配置信息,若存在

                if (Directory.Exists(oldfilepath)) //5.修改需要删除原由文件
                    Directory.Delete(oldfilepath, true);

                return verfilepath;
            }
            catch (DalException ex)
            {
                throw new BOException("更新web插件相关所有信息出错", ex);
            }
        }
コード例 #7
0
        public virtual void UpdatePluginInfo(PluginInfo pInfo, ActionExtend action)
        {
            try
            {
                SearchConfig searchconfig = new SearchConfig();
                searchconfig.PluginCode = pInfo.PluginCode.ToString();
                IList<ActionExtend> listAction = BoFactory.GetVersionTrackBo.QueryActionExtend(searchconfig);

                if (!string.IsNullOrEmpty(action.ActionCode))//判断是否输入标识
                {
                    if (listAction.Count > 0)//若存在记录,即更新
                        UpdateActionExtend(action);
                    else
                        InsertActionExtend(action);
                }
                else
                    DelActionExtend(action);

                UpdatePluginInfo(pInfo);//更新
            }
            catch (DalException ex)
            {
                throw new BOException("更新插件相关所有信息出错", ex);
            }
        }
コード例 #8
0
        public virtual int InsertWebPluginInfo(PluginInfo pInfo, ActionExtend action, VersionTrack version, string uid)
        {
            try
            {
                //int pid = InsertPluginInfo(pInfo, uid);
                //action.PluginCode = pid.ToString();
                //version.PluginCode = pid;
                if (!string.IsNullOrEmpty(action.ActionCode))//若有填写扩展信息code的话
                    InsertActionExtend(action);

                return InsertVersionTrack(version);
            }
            catch (DalException ex)
            {
                throw new BOException("新增web插件相关所有信息出错", ex);
            }
        }
コード例 #9
0
 public string InsertPluginInfo(PluginInfo pInfo, string uid)
 {
     try
     {
         SearchPlugin search = new SearchPlugin();
         search.Pcode = pInfo.PluginCode;
         IList<PluginInfo> list = pluginDao.GetPluginInfoList(search);
         if (list != null)
         {
             if (list.Count > 0)
             {
                 throw new BOException("该插件标识已经存在,或者上传xml信息格式不正确");
             }
         }
         pInfo.CreateTime = DateTime.Now;
         pInfo.CreateUid = uid;
         pInfo.LastModTime = DateTime.Now;
         pInfo.LastModUid = uid;
         pluginDao.Insert(pInfo);
         return pInfo.PluginCode;
     }
     catch (DalException ex)
     {
         throw new BOException("新增插件信息出错", ex);
     }
 }
コード例 #10
0
        public ActionResult UpdatePluginInfo(string verid, string isAdd)
        {
            PluginInfo pinfo = null;
            ViewData["vername"] = "";
            ViewData["actionCode"] = "";
            ViewData["summary"] = "";
            ViewData["versionId"] = "";
            ViewData["isAdd"] = "";//�Ƿ�����

            IResourceData[] datas = new IResourceData[1];
            datas[0] = ResourceDataFactory.GetResourceDataInstance();
            datas[0].Code = "WebPlugin";
            datas[0].Name = "Webҳ����";
            ViewData["list"] = datas;

            if (string.IsNullOrEmpty(verid))//������
                pinfo = new PluginInfo();
            else
            {
                SearchVersionTrack search = new SearchVersionTrack();
                search.VID = verid;
                VersionTrack vsion = BoFactory.GetVersionTrackBo.GetVersionTrack(search)[0];//��ȡ�汾��Ϣ

                pinfo = BoFactory.GetVersionTrackBo.GetPluginInfo(vsion.PluginCode.ToString());//��ȡ�����Ϣ

                if (isAdd.Equals("0"))//��Ϊ�޸ģ����޸İ汾��Ϣ,��չ��Ϣ�������Ϣ��
                {
                    ViewData["vername"] = vsion.VersionName;//��ȡ�汾��Ϣ

                    SearchConfig searchconfig = new SearchConfig();
                    searchconfig.PluginCode = vsion.PluginCode.ToString();
                    IList<ActionExtend> listAction = BoFactory.GetVersionTrackBo.QueryActionExtend(searchconfig);//��ȡ��չ��Ϣ
                    if (listAction.Count > 0)
                    {
                        ViewData["actionCode"] = listAction[0].ActionCode;
                        ViewData["summary"] = listAction[0].Summary;
                    }
                }
                else//��ֻ���޸IJ����Ϣ��
                { }
                ViewData["versionId"] = verid;
            }
            if (!string.IsNullOrEmpty(isAdd))
                ViewData["isAdd"] = isAdd;

            return View(pinfo);
        }
コード例 #11
0
        public ActionResult SavePluginInfo(FormCollection form, PluginInfo pluginInfo, ActionExtend actionExtend, VersionTrack version1, string isAdd)
        {
            var vmobject = new JsonReturnMessages();
            try
            {
                actionExtend.Summary = form["ESummary"].ToString();//��չ��Ϣ����
                //��ȡͨ�õİ汾��Ϣ���޸ģ�������������
                version1.VersionStatus = 0;
                version1.FilePath = AppConfig.filePath + pluginInfo.PluginCode + @"\" + version1.VersionName;
                version1.CreateUid = base.CurrentUser.UserUId;
                version1.LastModUid = base.CurrentUser.UserUId;
                string filepaht = version1.FilePath;

                if (version1.VersionId == 0)//������
                {
                    int vid = BoFactory.GetVersionTrackBo.InsertWebPluginInfo(pluginInfo, actionExtend, version1, base.CurrentUser.UserUId);
                    vmobject.Msg = vid.ToString();
                }
                else
                {
                    filepaht = BoFactory.GetVersionTrackBo.UpdateWebPluginInfo(pluginInfo, actionExtend, version1, isAdd, base.CurrentUser.UserUId);
                    vmobject.Msg = version1.VersionId.ToString();
                }

                //�����ļ���
                while (!Directory.Exists(filepaht))
                {
                    Directory.CreateDirectory(filepaht);
                }

                vmobject.IsSuccess = true;
            }
            catch (Exception ex)
            {
                vmobject.IsSuccess = false;
                vmobject.Msg = ex.Message;
            }
            return Json(vmobject);
        }