Exemple #1
0
        public ActionResult SaveConfigInfo(FormCollection form, string Vid)
        {
            var vmobject = new JsonReturnMessages();

            try
            {
                IList <ConfigInfo> list = new List <ConfigInfo>();
                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 = Constants.UpdaterCode;
                        list.Add(config);
                    }
                }
                //更新
                BoFactory.GetVersionTrackBo.UpdateUpdaterConfigInfos(list); //发布

                InsertConfigXml(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));
        }
Exemple #2
0
        public ActionResult Publishs(VersionTrack ver, string IsLoadFile)
        {
            var vmobject = new JsonReturnMessages();

            try
            {
                //1。写入XML
                InsertXml(ver.FilePath);
                Beyondbit.AutoUpdate.IPublisher pub = new Beyondbit.SmartBox.Publisher.SmartBoxPublisher();
                if (!string.IsNullOrEmpty(IsLoadFile))//若为单个上传文件发布
                {
                    //读去ver.FilePath发布单个文件
                    pub.UpdateFile(ver.FilePath + @"\" + Common.Entities.Constants.globalName, Constants.MianName, "./");
                    pub.UpdateFile(ver.FilePath + @"\" + Common.Entities.Constants.systemName, Constants.MianName, "./");
                }
                else
                {
                    //2。发布
                    SearchVersionTrack search = new SearchVersionTrack();
                    search.VID = ver.PreVersionId.ToString(); //获取上一个版本。
                    IList <VersionTrack> list = BoFactory.GetVersionTrackBo.GetVersionTrack(search);
                    if (list.Count > 0)                       //若不存在此记录说明是第一次发布
                    {
                        pub.UpdateApplication(ver.FilePath, Common.Entities.Constants.MianName);
                    }
                    else
                    {
                        pub.CreateApplication(ver.FilePath, Common.Entities.Constants.MianName);
                    }

                    //3。更新
                    ver.LastModTime   = DateTime.Now;
                    ver.LastModUid    = base.CurrentUser.UserUId;
                    ver.VersionStatus = 1;
                    BoFactory.GetVersionTrackBo.UpdatePlushVersionTrack(ver);
                }
                vmobject.IsSuccess = true;
                vmobject.Msg       = "操作成功!";
            }
            catch (Exception ex)
            {
                vmobject.IsSuccess = false;
                vmobject.Msg       = ex.Message;
            }
            return(Json(vmobject));
        }
Exemple #3
0
        public ActionResult Publishs(VersionTrack ver)
        {
            var vmobject = new JsonReturnMessages();

            try
            {
                InsertXml(ver);//1。写入XML

                ver.LastModTime   = DateTime.Now;
                ver.LastModUid    = base.CurrentUser.UserUId;
                ver.VersionStatus = 1;

                SearchVersionTrack search = new SearchVersionTrack();
                search.VID = ver.PreVersionId.ToString();
                IList <VersionTrack> list = BoFactory.GetVersionTrackBo.GetVersionTrack(search);               //获取上一个版本。

                string name = BoFactory.GetVersionTrackBo.GetPluginInfo(ver.PluginCode.ToString()).PluginCode; //获取插件code

                Beyondbit.AutoUpdate.IPublisher pub = new Beyondbit.SmartBox.Publisher.SmartBoxPublisher();
                if (list.Count > 0)//若不存在此记录说明是第一次发布
                {
                    pub.UpdateApplication(ver.FilePath, name);
                }
                else
                {
                    pub.CreateApplication(ver.FilePath, name);
                }

                BoFactory.GetVersionTrackBo.UpdatePlushVersionTrack(ver);//更新状态

                vmobject.IsSuccess = true;
                vmobject.Msg       = "操作成功!";
            }
            catch (Exception ex)
            {
                vmobject.IsSuccess = false;
                vmobject.Msg       = ex.Message;
            }
            return(Json(vmobject));
        }
Exemple #4
0
        public ActionResult SavePublishInfo(string Vid, FormCollection form)
        {
            var vmobject = new JsonReturnMessages();

            try
            {
                XmlConfigInfo      x      = InsertXml(Vid); //写入XML
                SearchVersionTrack search = new SearchVersionTrack();
                ArrayList          vids   = GetArray(Vid);  //获得相关联的VID
                search.VID = vids[0].ToString();
                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);
                }

                BoFactory.GetVersionTrackBo.UpdatePlushVersionTracks(x, Vid, base.CurrentUser.UserUId);//更新状态


                vmobject.IsSuccess = true;
                vmobject.Msg       = "操作成功";
            }
            catch (Exception ex)
            {
                vmobject.IsSuccess = false;
                vmobject.Msg       = ex.Message;
            }

            return(Json(vmobject));
        }
        public ActionResult SavePublishInfo(string Vid, FormCollection form)
        {
            var vmobject = new JsonReturnMessages();
            try
            {
                XmlMainConfigInfo x = InsertXml(Vid);//�XML
                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);

                BoFactory.GetVersionTrackBo.UpdateUpdaterPlushVersionTracks(x, Vid, base.CurrentUser.UserUId);//����״̬

                vmobject.IsSuccess = true;
                vmobject.Msg = "�����ɹ�";
            }
            catch (Exception ex)
            {
                vmobject.IsSuccess = false;
                vmobject.Msg = ex.Message;
            }

            return Json(vmobject);
        }
        public ActionResult SaveConfigInfo(FormCollection form, string Vid)
        {
            var vmobject = new JsonReturnMessages();
            try
            {
                IList<ConfigInfo> list = new List<ConfigInfo>();
                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 = Constants.UpdaterCode;
                        list.Add(config);
                    }
                }
                //����
                BoFactory.GetVersionTrackBo.UpdateUpdaterConfigInfos(list);//����

                InsertConfigXml(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);
        }
        public ActionResult Publishs(VersionTrack ver, string IsLoadFile)
        {
            var vmobject = new JsonReturnMessages();
            try
            {
                //1���XML
                InsertXml(ver.FilePath);
                Beyondbit.AutoUpdate.IPublisher pub = new Beyondbit.SmartBox.Publisher.SmartBoxPublisher();
                if (!string.IsNullOrEmpty(IsLoadFile))//��Ϊ�����ϴ��ļ�����
                {
                    //��ȥver.FilePath���������ļ�
                    pub.UpdateFile(ver.FilePath + @"\" + Common.Entities.Constants.globalName, Constants.MianName, "./");
                    pub.UpdateFile(ver.FilePath + @"\" + Common.Entities.Constants.systemName, Constants.MianName, "./");
                }
                else
                {
                    //2������
                    SearchVersionTrack search = new SearchVersionTrack();
                    search.VID = ver.PreVersionId.ToString();//��ȡ��һ���汾��
                    IList<VersionTrack> list = BoFactory.GetVersionTrackBo.GetVersionTrack(search);
                    if (list.Count > 0)//������ڴ˼�¼˵���ǵ�һ�η���
                        pub.UpdateApplication(ver.FilePath, Common.Entities.Constants.MianName);
                    else
                        pub.CreateApplication(ver.FilePath, Common.Entities.Constants.MianName);

                    //3������
                    ver.LastModTime = DateTime.Now;
                    ver.LastModUid = base.CurrentUser.UserUId;
                    ver.VersionStatus = 1;
                    BoFactory.GetVersionTrackBo.UpdatePlushVersionTrack(ver);
                }
                vmobject.IsSuccess = true;
                vmobject.Msg = "�����ɹ�!";
            }
            catch (Exception ex)
            {
                vmobject.IsSuccess = false;
                vmobject.Msg = ex.Message;
            }
            return Json(vmobject);
        }
        public ActionResult Publishs(VersionTrack ver)
        {
            var vmobject = new JsonReturnMessages();
            try
            {
                InsertXml(ver);//1���XML

                ver.LastModTime = DateTime.Now;
                ver.LastModUid = base.CurrentUser.UserUId;
                ver.VersionStatus = 1;

                SearchVersionTrack search = new SearchVersionTrack();
                search.VID = ver.PreVersionId.ToString();
                IList<VersionTrack> list = BoFactory.GetVersionTrackBo.GetVersionTrack(search);//��ȡ��һ���汾��

                string name = BoFactory.GetVersionTrackBo.GetPluginInfo(ver.PluginCode.ToString()).PluginCode;//��ȡ���code

                Beyondbit.AutoUpdate.IPublisher pub = new Beyondbit.SmartBox.Publisher.SmartBoxPublisher();
                if (list.Count > 0)//������ڴ˼�¼˵���ǵ�һ�η���
                    pub.UpdateApplication(ver.FilePath, name);
                else
                    pub.CreateApplication(ver.FilePath, name);

                BoFactory.GetVersionTrackBo.UpdatePlushVersionTrack(ver);//����״̬

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