示例#1
0
        private SiteConfigViewModel GetLogoInfo(int UR_TYPE_ID, string UR_ID)
        {
            var    result      = new SiteConfigViewModel();
            string userId      = string.Empty;
            var    userService = new AccountApp();

            if (UR_TYPE_ID == 3)
            {
                userId = userService.GetParentIDByUser(UR_ID);
            }
            else
            {//管理员
                userId = UR_ID;
            }

            SiteConfigEntity site = null;
            var sitConfigApp      = new SiteConfigApp();

            site = sitConfigApp.GetSiteConfigByUser(userId);

            result.Address = site.Address;
            var siteViewModel = GetSiteModel(site.Address);

            result.City             = siteViewModel.City;
            result.CountryName      = siteViewModel.CountryName;
            result.Default_Location = site.Default_Location;
            result.Id            = site.Id;
            result.Login_UR_ID   = site.Login_UR_ID;
            result.Organization  = siteViewModel.Organization;
            result.ProfileImgUrl = site.ProfileImgUrl;
            result.SiteName      = site.SiteName;
            result.State         = siteViewModel.State;
            result.TimeZone      = siteViewModel.TimeZone;
            return(result);
        }
示例#2
0
        public ActionResult Edit(SiteConfigEntity model, bool IsFinance, int isRegAct, int IsHideEditorInfoForAuthor, int IsHideEditorInfoForExpert, int IsStopNotLoginDownPDF, int ShowMoreFlowInfoForAuthor, int ShowHistoryFlowInfoForExpert, int isAutoHandle, int isStatByGroup, int isPersonal_Order, int isPersonal_OnlyMySearch)
        {
            ISiteConfigFacadeService service = ServiceContainer.Instance.Container.Resolve <ISiteConfigFacadeService>();

            if (model.SiteConfigID == 0)
            {
                model.InUserID = CurAuthor.AuthorID;
            }
            else
            {
                model.EditUserID = CurAuthor.AuthorID;
            }
            model.JournalID = CurAuthor.JournalID;
            ExecResult result = service.EditSiteConfig(model);

            if (result.result == EnumJsonResult.success.ToString())
            {
                //同步设置到全局配置文件
                SiteConfigInfo config = SiteConfig.GetSiteConfig();
                if (config != null)
                {
                    config.SiteName  = model.Title;
                    config.IsFinance = IsFinance ? 1 : 0;
                    SiteConfig.SaveConfig(config);

                    string globalSql = "update SiteGlobalSettings set IsEnableRegActivate='" + isRegAct + "',IsHideEditorInfoForAuthor='" + IsHideEditorInfoForAuthor + "',IsHideEditorInfoForExpert='" + IsHideEditorInfoForExpert + "',IsStopNotLoginDownPDF='" + IsStopNotLoginDownPDF + "',ShowMoreFlowInfoForAuthor='" + ShowMoreFlowInfoForAuthor + "',ShowHistoryFlowInfoForExpert='" + ShowHistoryFlowInfoForExpert + "',isAutoHandle='" + isAutoHandle + "',isStatByGroup='" + isStatByGroup + "' where SiteID='" + CurAuthor.JournalID + "'";
                    SQLiteHelper.ExeSql(globalSql);
                }
                //同步设置到个人配置文件
                string PersonalSql = "update SitePersonalSettings set Personal_Order='" + isPersonal_Order + "',Personal_OnlyMySearch='" + isPersonal_OnlyMySearch + "' where SiteID='" + CurAuthor.JournalID + "' and EditorID='" + CurAuthor.AuthorID + "'";
                SQLiteHelper.ExeSql(PersonalSql);
            }
            return(Json(new { result = result.result, msg = result.msg }));
        }
示例#3
0
        public ActionResult Index()
        {
            //获取配置信息
            DataTable GlobalSetDT   = GetSiteSetCfg.GetSiteGlobalSet(CurAuthor.JournalID.ToString());
            DataTable PersonalSetDT = GetSiteSetCfg.GetSitePersonalSet(CurAuthor.JournalID.ToString(), CurAuthor.AuthorID.ToString());
            //获取基本信息
            SiteConfigQuery query = new SiteConfigQuery();

            query.JournalID = CurAuthor.JournalID;
            ISiteConfigFacadeService service = ServiceContainer.Instance.Container.Resolve <ISiteConfigFacadeService>();
            SiteConfigEntity         model   = service.GetSiteConfigModel(query);

            if (model == null)
            {
                model = new SiteConfigEntity();
            }
            ViewBag.AuthorID                     = CurAuthor.AuthorID;
            ViewBag.IsShowPwdInput               = CurAuthor.LoginName == GlobalSetDT.Rows[0]["SysSuperAdmin"].ToString() ? 1 : 0;//是否显示password类型的输入框中的内容
            ViewBag.IsEnableRegActivate          = GlobalSetDT.Rows[0]["IsEnableRegActivate"].ToString();
            ViewBag.IsHideEditorInfoForAuthor    = GlobalSetDT.Rows[0]["IsHideEditorInfoForAuthor"].ToString();
            ViewBag.IsHideEditorInfoForExpert    = GlobalSetDT.Rows[0]["IsHideEditorInfoForExpert"].ToString();
            ViewBag.ShowNameForHide              = GlobalSetDT.Rows[0]["ShowNameForHide"].ToString();
            ViewBag.IsStopNotLoginDownPDF        = GlobalSetDT.Rows[0]["IsStopNotLoginDownPDF"].ToString();
            ViewBag.ShowMoreFlowInfoForAuthor    = GlobalSetDT.Rows[0]["ShowMoreFlowInfoForAuthor"].ToString();
            ViewBag.ShowHistoryFlowInfoForExpert = GlobalSetDT.Rows[0]["ShowHistoryFlowInfoForExpert"].ToString();
            ViewBag.isAutoHandle                 = GlobalSetDT.Rows[0]["isAutoHandle"].ToString();
            ViewBag.isStatByGroup                = GlobalSetDT.Rows[0]["isStatByGroup"].ToString();

            ViewBag.Personal_Order        = PersonalSetDT.Rows[0]["Personal_Order"].ToString();
            ViewBag.Personal_OnlyMySearch = PersonalSetDT.Rows[0]["Personal_OnlyMySearch"].ToString();

            return(View(model));
        }
示例#4
0
        public SiteConfigEntity GetSiteConfigModel(SiteConfigQuery query)
        {
            SiteConfigEntity   model   = null;
            ISiteConfigService service = ServiceContainer.Instance.Container.Resolve <ISiteConfigService>();

            model = service.GetSiteConfig(query);
            return(model);
        }
示例#5
0
        public ActionResult UpdateLocalDataAjax(Int64 PKID)
        {
            //获取站点配置信息
            SiteConfigQuery sitequery = new SiteConfigQuery();

            sitequery.JournalID = CurAuthor.JournalID;
            ISiteConfigFacadeService siteservice = ServiceContainer.Instance.Container.Resolve <ISiteConfigFacadeService>();
            SiteConfigEntity         model       = siteservice.GetSiteConfigModel(sitequery);
            //获取DOI注册日志实体
            IIssueFacadeService service = ServiceContainer.Instance.Container.Resolve <IIssueFacadeService>();
            DoiRegLogQuery      query   = new DoiRegLogQuery();

            query.PKID      = PKID;
            query.JournalID = CurAuthor.JournalID;
            string DoiFileName = service.GetDoiRegLog(query).DoiFileName.Trim();

            //保存DOI注册结果
            DoiRegResultFilePath = System.DateTime.Now.ToString("yyyy-MM-dd-HH-mm-ss-fff") + ".xml";
            WKT.Common.Utils.DoiUtils.GetDoiRegResult(DoiFileName, model.DoiUserName, model.DoiUserPwd, Utils.GetMapPath(SiteConfig.RootPath + "/data/" + DoiRegResultFilePath));

            XElement root    = XElement.Load(Utils.GetMapPath(SiteConfig.RootPath + "/data/" + DoiRegResultFilePath), LoadOptions.SetLineInfo);
            XElement journal = root.Element("body").Element("journal");

            var Articles = from Article in journal.Elements("journal_article")
                           select Article;

            foreach (var Article in Articles)
            {
                string doi       = Article.Element("doi_data").Element("doi").Value;
                string resource  = Article.Element("doi_data").Element("resource").Value;
                Int64  ContentID = Convert.ToInt64(resource.Substring(resource.LastIndexOf('=') + 1, resource.Length - resource.LastIndexOf('=') - 4));

                IIssueFacadeService IssueService       = ServiceContainer.Instance.Container.Resolve <IIssueFacadeService>();
                IssueContentEntity  issueContentEntity = new IssueContentEntity();
                //获取期刊实体
                IssueContentQuery IssueQuery = new IssueContentQuery();
                IssueQuery.JournalID   = CurAuthor.JournalID;
                IssueQuery.contentID   = ContentID;
                IssueQuery.IsAuxiliary = true;
                issueContentEntity     = IssueService.GetIssueContentModel(IssueQuery);
                //更新期刊DOI数据
                issueContentEntity.DOI      = doi;
                issueContentEntity.isRegDoi = true;
                ExecResult result = IssueService.SaveIssueContent(issueContentEntity);
            }
            //更新DOI注册日志
            DoiRegLogEntity doiRegLogEntity = new DoiRegLogEntity();

            doiRegLogEntity.State    = "已更新";
            doiRegLogEntity.PKID     = PKID;
            doiRegLogEntity.isUpdate = true;
            service.SaveDoiRegLog(doiRegLogEntity);
            //删除临时文件
            System.IO.File.Delete(Utils.GetMapPath(SiteConfig.RootPath + "/data/" + DoiRegResultFilePath));
            return(Json(new { flag = 1 }));
        }
示例#6
0
        public List <SiteConfigEntity> MakeSiteConfigList(DataTable dt)
        {
            List <SiteConfigEntity> list = new List <SiteConfigEntity>();

            if (dt != null)
            {
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    SiteConfigEntity siteConfigEntity = MakeSiteConfig(dt.Rows[i]);
                    list.Add(siteConfigEntity);
                }
            }
            return(list);
        }
示例#7
0
        public ActionResult IssueDoiRegQueryAjax(Int64[] ContentIDs)
        {
            //获取期刊详细数据
            IIssueFacadeService service = ServiceContainer.Instance.Container.Resolve <IIssueFacadeService>();
            IssueContentQuery   query   = new IssueContentQuery();

            query.JournalID   = CurAuthor.JournalID;
            query.contentIDs  = ContentIDs;
            query.CurrentPage = 1;
            query.PageSize    = 50;
            query.SortName    = " EditDate ";
            query.SortOrder   = " DESC ";
            IList <IssueContentEntity> list = service.GetIssueContentList(query);
            //获取站点配置信息
            SiteConfigQuery sitequery = new SiteConfigQuery();

            sitequery.JournalID = CurAuthor.JournalID;
            ISiteConfigFacadeService siteservice = ServiceContainer.Instance.Container.Resolve <ISiteConfigFacadeService>();
            SiteConfigEntity         model       = siteservice.GetSiteConfigModel(sitequery);

            //生成注册用XML文件
            CreateDoiRegFilePath = System.DateTime.Now.ToString("yyyy-MM-dd-HH-mm-ss-fff") + ".xml";
            WKT.Common.Utils.DoiUtils.CreateDoiRegisterFile(Utils.GetMapPath(SiteConfig.RootPath + "/data/DoiRegister.xml"), Utils.GetMapPath(SiteConfig.RootPath + "/data/" + CreateDoiRegFilePath), model.DoiJournalID, model.DoiPrefix, model.Title, model.EnTitle, model.ISSN, model.CN, list[0].Year, list[0].Volume, list[0].Issue, list, model.Home);
            //上传注册用XML文件到中文DOI网站
            string ReturnXMLFile = WKT.Common.Utils.DoiUtils.Upload(Utils.GetMapPath(SiteConfig.RootPath + "/data/" + CreateDoiRegFilePath), model.DoiUserName, model.DoiUserPwd, 3);
            //获取DOI注册结果
            string DoiRegResult = WKT.Common.Utils.DoiUtils.GetDoiRegResult(ReturnXMLFile, model.DoiUserName, model.DoiUserPwd);

            //保存DOI注册日志
            DoiRegLogEntity doiRegLogEntity = new DoiRegLogEntity();

            doiRegLogEntity.JournalID   = CurAuthor.JournalID;
            doiRegLogEntity.DoiFileName = ReturnXMLFile;
            doiRegLogEntity.State       = DoiRegResult;
            doiRegLogEntity.Year        = list[0].Year;;
            doiRegLogEntity.Issue       = list[0].Issue;;
            doiRegLogEntity.AdminID     = CurAuthor.AuthorID;
            if (service.SaveDoiRegLog(doiRegLogEntity).result == "success")
            {
                //删除生成的XML注册文件
                System.IO.File.Delete(Utils.GetMapPath(SiteConfig.RootPath + "/data/" + CreateDoiRegFilePath));
                return(Json(new { flag = 1 }));
            }

            else
            {
                return(Json(new { flag = 0 }));
            }
        }
示例#8
0
        //信封导出打印
        public ActionResult LetterPrint()
        {
            //获取站点配置信息
            SiteConfigQuery query = new SiteConfigQuery();

            query.JournalID = CurAuthor.JournalID;
            ISiteConfigFacadeService service = ServiceContainer.Instance.Container.Resolve <ISiteConfigFacadeService>();
            SiteConfigEntity         model   = service.GetSiteConfigModel(query);

            if (model == null)
            {
                model = new SiteConfigEntity();
            }
            return(View(model));
        }
示例#9
0
        public ActionResult Index()
        {
            SiteConfigQuery query = new SiteConfigQuery();

            query.JournalID = CurAuthor.JournalID;
            ISiteConfigFacadeService service = ServiceContainer.Instance.Container.Resolve <ISiteConfigFacadeService>();
            SiteConfigEntity         model   = service.GetSiteConfigModel(query);

            if (model == null)
            {
                model = new SiteConfigEntity();
            }
            ViewBag.AuthorID = CurAuthor.AuthorID;
            return(View(model));
        }
示例#10
0
        public List <SiteConfigEntity> MakeSiteConfigList(IDataReader dr)
        {
            List <SiteConfigEntity> list = new List <SiteConfigEntity>();

            while (dr.Read())
            {
                SiteConfigEntity siteConfigEntity = new SiteConfigEntity();
                siteConfigEntity.SiteConfigID = (Int64)dr["SiteConfigID"];
                siteConfigEntity.JournalID    = (Int64)dr["JournalID"];
                siteConfigEntity.Title        = (String)dr["Title"];
                siteConfigEntity.EnTitle      = (String)dr["EnTitle"];
                siteConfigEntity.CN           = (String)dr["CN"];
                siteConfigEntity.ISSN         = (String)dr["ISSN"];
                siteConfigEntity.Home         = (String)dr["Home"];
                siteConfigEntity.Keywords     = (String)dr["Keywords"];
                siteConfigEntity.Description  = (String)dr["Description"];
                siteConfigEntity.ICPCode      = (String)dr["ICPCode"];
                siteConfigEntity.ZipCode      = (String)dr["ZipCode"];
                siteConfigEntity.Address      = (String)dr["Address"];
                siteConfigEntity.SendMail     = (String)dr["SendMail"];
                siteConfigEntity.MailServer   = (String)dr["MailServer"];
                siteConfigEntity.MailPort     = (Int32)dr["MailPort"];
                siteConfigEntity.MailAccount  = (String)dr["MailAccount"];
                siteConfigEntity.MailPwd      = (String)dr["MailPwd"];
                siteConfigEntity.MailIsSSL    = (Boolean)dr["MailIsSSL"];
                //商讯·中国
                siteConfigEntity.SMSUserName = (String)dr["SMSUserName"];
                siteConfigEntity.SMSPwd      = (String)dr["SMSPwd"];
                //在线支付
                siteConfigEntity.EBankType     = (Byte)dr["EBankType"];
                siteConfigEntity.EBankAccount  = (String)dr["EBankAccount"];
                siteConfigEntity.EBankCode     = (String)dr["EBankCode"];
                siteConfigEntity.EBankEncryKey = (String)dr["EBankEncryKey"];
                //DOI
                siteConfigEntity.DoiUserName  = (String)dr["DoiUserName"];
                siteConfigEntity.DoiUserPwd   = (String)dr["DoiUserPwd"];
                siteConfigEntity.DoiJournalID = (String)dr["DoiJournalID"];
                siteConfigEntity.DoiPrefix    = (String)dr["DoiPrefix"];

                siteConfigEntity.InUserID   = (Int64)dr["InUserID"];
                siteConfigEntity.EditUserID = (Int64)dr["EditUserID"];
                siteConfigEntity.EditDate   = (DateTime)dr["EditDate"];
                siteConfigEntity.AddDate    = (DateTime)dr["AddDate"];
                list.Add(siteConfigEntity);
            }
            dr.Close();
            return(list);
        }
示例#11
0
        public ActionResult ReCheckDoiStateAjax(Int64 PKID)
        {
            //获取站点配置信息
            SiteConfigQuery sitequery = new SiteConfigQuery();

            sitequery.JournalID = CurAuthor.JournalID;
            ISiteConfigFacadeService siteservice = ServiceContainer.Instance.Container.Resolve <ISiteConfigFacadeService>();
            SiteConfigEntity         model       = siteservice.GetSiteConfigModel(sitequery);
            //获取DOI注册日志实体
            IIssueFacadeService service = ServiceContainer.Instance.Container.Resolve <IIssueFacadeService>();
            DoiRegLogQuery      query   = new DoiRegLogQuery();

            query.PKID      = PKID;
            query.JournalID = CurAuthor.JournalID;
            string DoiFileName = service.GetDoiRegLog(query).DoiFileName.Trim();
            //CreateDoiRegFilePath = Utils.GetMapPath(SiteConfig.RootPath + "/data/" + DoiFileName);
            string DoiRegResult = WKT.Common.Utils.DoiUtils.GetDoiRegResult(DoiFileName, model.DoiUserName, model.DoiUserPwd);

            if (DoiRegResult == "已完成")
            {
                DoiRegLogEntity doiRegLogEntity = new DoiRegLogEntity();
                doiRegLogEntity.State    = "已完成";
                doiRegLogEntity.PKID     = PKID;
                doiRegLogEntity.isUpdate = true;
                service.SaveDoiRegLog(doiRegLogEntity);

                return(Json(new { flag = 1 }));
            }
            if (DoiRegResult == "不合格")
            {
                DoiRegLogEntity doiRegLogEntity = new DoiRegLogEntity();
                doiRegLogEntity.State    = "不合格";
                doiRegLogEntity.PKID     = PKID;
                doiRegLogEntity.isUpdate = true;
                service.SaveDoiRegLog(doiRegLogEntity);

                return(Json(new { flag = 1 }));
            }
            if (DoiRegResult == "未审核")
            {
                return(Json(new { flag = -1 }));
            }
            else
            {
                return(Json(new { flag = 0 }));
            }
        }
示例#12
0
        public SiteConfigEntity MakeSiteConfig(DataRow dr)
        {
            SiteConfigEntity siteConfigEntity = null;

            if (dr != null)
            {
                siteConfigEntity = new SiteConfigEntity();
                siteConfigEntity.SiteConfigID = (Int64)dr["SiteConfigID"];
                siteConfigEntity.JournalID    = (Int64)dr["JournalID"];
                siteConfigEntity.Title        = (String)dr["Title"];
                siteConfigEntity.EnTitle      = (String)dr["EnTitle"];
                siteConfigEntity.CN           = (String)dr["CN"];
                siteConfigEntity.ISSN         = (String)dr["ISSN"];
                siteConfigEntity.Home         = (String)dr["Home"];
                siteConfigEntity.Keywords     = (String)dr["Keywords"];
                siteConfigEntity.Description  = (String)dr["Description"];
                siteConfigEntity.ICPCode      = (String)dr["ICPCode"];
                siteConfigEntity.ZipCode      = (String)dr["ZipCode"];
                siteConfigEntity.Address      = (String)dr["Address"];
                siteConfigEntity.SendMail     = (String)dr["SendMail"];
                siteConfigEntity.MailServer   = (String)dr["MailServer"];
                siteConfigEntity.MailPort     = (Int32)dr["MailPort"];
                siteConfigEntity.MailAccount  = (String)dr["MailAccount"];
                siteConfigEntity.MailPwd      = (String)dr["MailPwd"];
                siteConfigEntity.MailIsSSL    = (Boolean)dr["MailIsSSL"];
                //商讯·中国
                siteConfigEntity.SMSUserName = (String)dr["SMSUserName"];
                siteConfigEntity.SMSPwd      = (String)dr["SMSPwd"];
                //在线支付
                siteConfigEntity.EBankType     = (Byte)dr["EBankType"];
                siteConfigEntity.EBankAccount  = (String)dr["EBankAccount"];
                siteConfigEntity.EBankCode     = (String)dr["EBankCode"];
                siteConfigEntity.EBankEncryKey = (String)dr["EBankEncryKey"];
                //DOI
                siteConfigEntity.DoiUserName  = (String)dr["DoiUserName"];
                siteConfigEntity.DoiUserPwd   = (String)dr["DoiUserPwd"];
                siteConfigEntity.DoiJournalID = (String)dr["DoiJournalID"];
                siteConfigEntity.DoiPrefix    = (String)dr["DoiPrefix"];

                siteConfigEntity.InUserID   = (Int64)dr["InUserID"];
                siteConfigEntity.EditUserID = (Int64)dr["EditUserID"];
                siteConfigEntity.EditDate   = (DateTime)dr["EditDate"];
                siteConfigEntity.AddDate    = (DateTime)dr["AddDate"];
            }
            return(siteConfigEntity);
        }
示例#13
0
        public ActionResult GoPay(PayNoticeEntity model, string productTable = "ContributionInfo")
        {
            SiteConfigEntity config = GetSiteConfig();

            if (config == null || config.EBankType != 3)
            {
                return(Json(new { result = EnumJsonResult.failure.ToString(), msg = "本网暂未开通网银支付!请通过邮局汇款方式邮寄给我们,汇款地址请查看交费通知单,谢谢!" }));
            }

            //商户扩展信息包含4项信息用英文逗号分隔如:交费类型,产品表名,产品表主键字段值,产品描述
            string strKzInfo = model.PayType.ToString() + "," + productTable + "," + model.CNumber + ",用户:" + CurAuthor.LoginName + ",支付编号" + model.CNumber + model.PayTypeName + "," + model.NoticeID;

            string url = new YeepayHelper(config.EBankCode, config.EBankEncryKey)
                         .CreateBuyUrl(model.Amount.ToString(), model.CNumber, model.PayTypeName, model.CTitle, "http://" + Request.Url.Authority.ToString() + "/AuthorFinance/YeepayCallback/", strKzInfo);

            return(Json(new { result = EnumJsonResult.success.ToString(), url = url }));
        }
示例#14
0
        public SiteConfigEntity GetSiteConfig(Int64 siteConfigID)
        {
            SiteConfigEntity siteConfigEntity = null;
            StringBuilder    sqlCommandText   = new StringBuilder();

            sqlCommandText.Append("SELECT TOP 1 * FROM dbo.SiteConfig WITH(NOLOCK)");
            sqlCommandText.Append(" WHERE  SiteConfigID=@SiteConfigID");

            DbCommand cmd = db.GetSqlStringCommand(sqlCommandText.ToString());

            db.AddInParameter(cmd, "@SiteConfigID", DbType.Int64, siteConfigID);

            using (IDataReader dr = db.ExecuteReader(cmd))
            {
                siteConfigEntity = MakeSiteConfig(dr);
            }
            return(siteConfigEntity);
        }
示例#15
0
        public ExecResult UpdateSiteConfig(SiteConfigEntity model)
        {
            ExecResult         execResult = new ExecResult();
            ISiteConfigService service    = ServiceContainer.Instance.Container.Resolve <ISiteConfigService>();
            bool result = service.UpdateSiteConfig(model);

            if (result)
            {
                execResult.result = EnumJsonResult.success.ToString();
                execResult.msg    = "修改站点信息成功!";
            }
            else
            {
                execResult.result = EnumJsonResult.failure.ToString();
                execResult.msg    = "修改站点信息失败!";
            }
            return(execResult);
        }
示例#16
0
        public ActionResult Edit(SiteConfigEntity model, bool IsFinance, bool isRegAct, bool isLoginVerify, bool isViewMoreFlow, bool isViewHistoryFlow, bool isAutoHandle, bool isStatByGroup, bool isPersonal_Order, bool isPersonal_OnlyMySearch)
        {
            ISiteConfigFacadeService service = ServiceContainer.Instance.Container.Resolve <ISiteConfigFacadeService>();

            if (model.SiteConfigID == 0)
            {
                model.InUserID = CurAuthor.AuthorID;
            }
            else
            {
                model.EditUserID = CurAuthor.AuthorID;
            }
            model.JournalID = CurAuthor.JournalID;
            ExecResult result = service.EditSiteConfig(model);

            if (result.result == EnumJsonResult.success.ToString())
            {
                //同步设置到全局配置文件
                SiteConfigInfo config = SiteConfig.GetSiteConfig();
                if (config != null)
                {
                    config.SiteName          = model.Title;
                    config.IsFinance         = IsFinance ? 1 : 0;
                    config.isRegAct          = isRegAct ? 1 : 0;
                    config.isLoginVerify     = isLoginVerify ? 1 : 0;
                    config.isViewMoreFlow    = isViewMoreFlow ? 1 : 0;
                    config.isViewHistoryFlow = isViewHistoryFlow ? 1 : 0;
                    config.isAutoHandle      = isAutoHandle ? 1 : 0;
                    config.isStatByGroup     = isStatByGroup ? 1 : 0;
                    SiteConfig.SaveConfig(config);
                }
                //同步设置到个人配置文件
                PersonalConfig     personalConfig     = new PersonalConfig(CurAuthor.AuthorID);
                PersonalConfigInfo personalConfigInfo = personalConfig.GetPersonalConfig();
                if (personalConfig != null)
                {
                    personalConfigInfo.isPersonal_Order        = isPersonal_Order ? 1 : 0;
                    personalConfigInfo.isPersonal_OnlyMySearch = isPersonal_OnlyMySearch ? 1 : 0;
                    personalConfig.SaveConfig(personalConfigInfo);
                }
            }
            return(Json(new { result = result.result, msg = result.msg }));
        }
示例#17
0
        public ActionResult Save(SiteConfigViewModel siteConfigViewModel)
        {
            var result = new ResultEntity()
            {
                errorCode = 500, errorStr = ""
            };

            try
            {
                var configEntity = new SiteConfigEntity()
                {
                    Id               = siteConfigViewModel.Id,
                    SiteName         = siteConfigViewModel.SiteName,
                    Default_Location = siteConfigViewModel.Default_Location,
                    ProfileImgUrl    = siteConfigViewModel.ProfileImgUrl
                };

                var userId = LoginHelper.UserID;

                configEntity.Login_UR_ID = userId;
                var sitconfigApp = new SiteConfigApp();
                int i            = sitconfigApp.GetIsExistSiteConfigByUser(configEntity.Login_UR_ID);

                configEntity.Address = GetJsonString(siteConfigViewModel);
                if (i > 0)
                {
                    sitconfigApp.SaveSiteConfig(configEntity);
                }
                else
                {
                    sitconfigApp.AddSiteConfig(configEntity);
                }
                result.errorCode = 200;
            }
            catch (Exception e)
            {
                result.errorCode = 400;
                result.errorStr  = e.Message;
            }
            return(Json(result));
        }
示例#18
0
 /// <summary>
 /// 更新存储媒介中的实体数据
 /// </summary>
 /// <param name="siteConfig">SiteConfigEntity实体对象</param>
 /// <returns>true:更新成功 false:更新失败</returns>
 public bool UpdateSiteConfig(SiteConfigEntity siteConfig)
 {
     siteConfig.Title         = siteConfig.Title.TextFilter();
     siteConfig.Keywords      = siteConfig.Keywords.TextFilter();
     siteConfig.Description   = siteConfig.Description.TextFilter();
     siteConfig.ICPCode       = siteConfig.ICPCode.TextFilter();
     siteConfig.Address       = siteConfig.Address.TextFilter();
     siteConfig.ZipCode       = siteConfig.ZipCode.TextFilter();
     siteConfig.SendMail      = siteConfig.SendMail.TextFilter();
     siteConfig.MailServer    = siteConfig.MailServer.TextFilter();
     siteConfig.MailAccount   = siteConfig.MailAccount.TextFilter();
     siteConfig.SMSUserName   = siteConfig.SMSUserName.TextFilter();
     siteConfig.EBankAccount  = siteConfig.EBankAccount.TextFilter();
     siteConfig.EBankCode     = siteConfig.EBankCode.TextFilter();
     siteConfig.EBankEncryKey = siteConfig.EBankEncryKey.TextFilter();
     if (siteConfig.SiteConfigID == 0)
     {
         return(SiteConfigBusProvider.AddSiteConfig(siteConfig));
     }
     return(SiteConfigBusProvider.UpdateSiteConfig(siteConfig));
 }
示例#19
0
        public bool DeleteSiteConfig(SiteConfigEntity siteConfigEntity)
        {
            bool          flag           = false;
            StringBuilder sqlCommandText = new StringBuilder();

            sqlCommandText.Append("DELETE FROM dbo.SiteConfig");
            sqlCommandText.Append(" WHERE  SiteConfigID=@SiteConfigID");

            DbCommand cmd = db.GetSqlStringCommand(sqlCommandText.ToString());

            db.AddInParameter(cmd, "@SiteConfigID", DbType.Int64, siteConfigEntity.SiteConfigID);

            try
            {
                db.ExecuteNonQuery(cmd);
                flag = true;
            }
            catch (SqlException sqlEx)
            {
                throw sqlEx;
            }
            return(flag);
        }
示例#20
0
 /// <summary>
 /// 将实体数据存入存储媒介(持久化一个对象)
 /// </summary>
 /// <param name="siteConfig">SiteConfigEntity实体对象</param>
 /// <returns>true:存储成功 false:存储失败</returns>
 public bool AddSiteConfig(SiteConfigEntity siteConfig)
 {
     return(SiteConfigBusProvider.AddSiteConfig(siteConfig));
 }
示例#21
0
        public bool AddSiteConfig(SiteConfigEntity siteConfigEntity)
        {
            bool          flag           = false;
            StringBuilder sqlCommandText = new StringBuilder();

            sqlCommandText.Append("@JournalID");
            sqlCommandText.Append(", @Title");
            sqlCommandText.Append(", @EnTitle");
            sqlCommandText.Append(", @CN");
            sqlCommandText.Append(", @ISSN");
            sqlCommandText.Append(", @Home");
            sqlCommandText.Append(", @Keywords");
            sqlCommandText.Append(", @Description");
            sqlCommandText.Append(", @ICPCode");
            sqlCommandText.Append(", @ZipCode");
            sqlCommandText.Append(", @Address");
            sqlCommandText.Append(", @SendMail");
            sqlCommandText.Append(", @MailServer");
            sqlCommandText.Append(", @MailPort");
            sqlCommandText.Append(", @MailAccount");
            sqlCommandText.Append(", @MailPwd");
            sqlCommandText.Append(", @MailIsSSL");
            //商讯·中国
            sqlCommandText.Append(", @SMSUserName");
            sqlCommandText.Append(", @SMSPwd");
            //在线支付
            sqlCommandText.Append(", @EBankType");
            sqlCommandText.Append(", @EBankAccount");
            sqlCommandText.Append(", @EBankCode");
            sqlCommandText.Append(", @EBankEncryKey");
            //DOI
            sqlCommandText.Append(", @DoiUserName");
            sqlCommandText.Append(", @DoiUserPwd");
            sqlCommandText.Append(", @DoiJournalID");
            sqlCommandText.Append(", @DoiPrefix");
            sqlCommandText.Append(", @InUserID");

            DbCommand cmd = db.GetSqlStringCommand(String.Format("INSERT INTO dbo.SiteConfig ({0}) VALUES ({1})", sqlCommandText.ToString().Replace("@", ""), sqlCommandText.ToString()));

            db.AddInParameter(cmd, "@JournalID", DbType.Int64, siteConfigEntity.JournalID);
            db.AddInParameter(cmd, "@Title", DbType.AnsiString, siteConfigEntity.Title);
            db.AddInParameter(cmd, "@EnTitle", DbType.AnsiString, siteConfigEntity.EnTitle);
            db.AddInParameter(cmd, "@CN", DbType.AnsiString, siteConfigEntity.CN);
            db.AddInParameter(cmd, "@ISSN", DbType.AnsiString, siteConfigEntity.ISSN);
            db.AddInParameter(cmd, "@Home", DbType.AnsiString, siteConfigEntity.Home);
            db.AddInParameter(cmd, "@Keywords", DbType.AnsiString, siteConfigEntity.Keywords);
            db.AddInParameter(cmd, "@Description", DbType.AnsiString, siteConfigEntity.Description);
            db.AddInParameter(cmd, "@ICPCode", DbType.AnsiString, siteConfigEntity.ICPCode);
            db.AddInParameter(cmd, "@ZipCode", DbType.AnsiString, siteConfigEntity.ZipCode);
            db.AddInParameter(cmd, "@Address", DbType.AnsiString, siteConfigEntity.Address);
            db.AddInParameter(cmd, "@SendMail", DbType.AnsiString, siteConfigEntity.SendMail);
            db.AddInParameter(cmd, "@MailServer", DbType.AnsiString, siteConfigEntity.MailServer);
            db.AddInParameter(cmd, "@MailPort", DbType.Int32, siteConfigEntity.MailPort);
            db.AddInParameter(cmd, "@MailAccount", DbType.AnsiString, siteConfigEntity.MailAccount);
            db.AddInParameter(cmd, "@MailPwd", DbType.AnsiString, siteConfigEntity.MailPwd);
            db.AddInParameter(cmd, "@MailIsSSL", DbType.Boolean, siteConfigEntity.MailIsSSL);
            //商讯·中国
            db.AddInParameter(cmd, "@SMSUserName", DbType.AnsiString, siteConfigEntity.SMSUserName);
            db.AddInParameter(cmd, "@SMSPwd", DbType.AnsiString, siteConfigEntity.SMSPwd);
            //在线支付
            db.AddInParameter(cmd, "@EBankType", DbType.Byte, siteConfigEntity.EBankType);
            db.AddInParameter(cmd, "@EBankAccount", DbType.AnsiString, siteConfigEntity.EBankAccount);
            db.AddInParameter(cmd, "@EBankCode", DbType.AnsiString, siteConfigEntity.EBankCode);
            db.AddInParameter(cmd, "@EBankEncryKey", DbType.AnsiString, siteConfigEntity.EBankEncryKey);
            //DOI
            db.AddInParameter(cmd, "@DoiUserName", DbType.AnsiString, siteConfigEntity.DoiUserName);
            db.AddInParameter(cmd, "@DoiUserPwd", DbType.AnsiString, siteConfigEntity.DoiUserPwd);
            db.AddInParameter(cmd, "@DoiJournalID", DbType.AnsiString, siteConfigEntity.DoiJournalID);
            db.AddInParameter(cmd, "@DoiPrefix", DbType.AnsiString, siteConfigEntity.DoiPrefix);

            db.AddInParameter(cmd, "@InUserID", DbType.Int64, siteConfigEntity.InUserID);

            try
            {
                db.ExecuteNonQuery(cmd);
                flag = true;
            }
            catch (SqlException sqlEx)
            {
                throw sqlEx;
            }
            return(flag);
        }
示例#22
0
        public bool UpdateSiteConfig(SiteConfigEntity siteConfigEntity)
        {
            bool          flag             = false;
            StringBuilder whereCommandText = new StringBuilder();

            whereCommandText.Append("  SiteConfigID=@SiteConfigID");
            StringBuilder sqlCommandText = new StringBuilder();

            sqlCommandText.Append(" Title=@Title");
            sqlCommandText.Append(", EnTitle=@EnTitle");
            sqlCommandText.Append(", CN=@CN");
            sqlCommandText.Append(", ISSN=@ISSN");
            sqlCommandText.Append(", Home=@Home");
            sqlCommandText.Append(", Keywords=@Keywords");
            sqlCommandText.Append(", Description=@Description");
            sqlCommandText.Append(", ICPCode=@ICPCode");
            sqlCommandText.Append(", ZipCode=@ZipCode");
            sqlCommandText.Append(", Address=@Address");
            sqlCommandText.Append(", SendMail=@SendMail");
            sqlCommandText.Append(", MailServer=@MailServer");
            sqlCommandText.Append(", MailPort=@MailPort");
            sqlCommandText.Append(", MailAccount=@MailAccount");
            sqlCommandText.Append(", MailPwd=@MailPwd");
            sqlCommandText.Append(", MailIsSSL=@MailIsSSL");
            //商讯·中国
            sqlCommandText.Append(", SMSUserName=@SMSUserName");
            sqlCommandText.Append(", SMSPwd=@SMSPwd");
            //在线支付
            sqlCommandText.Append(", EBankType=@EBankType");
            sqlCommandText.Append(", EBankAccount=@EBankAccount");
            sqlCommandText.Append(", EBankCode=@EBankCode");
            sqlCommandText.Append(", EBankEncryKey=@EBankEncryKey");
            //DOI
            sqlCommandText.Append(", DoiUserName=@DoiUserName");
            sqlCommandText.Append(", DoiUserPwd=@DoiUserPwd");
            sqlCommandText.Append(", DoiJournalID=@DoiJournalID");
            sqlCommandText.Append(", DoiPrefix=@DoiPrefix");

            sqlCommandText.Append(", EditUserID=@EditUserID");
            sqlCommandText.Append(", EditDate=getdate()");

            DbCommand cmd = db.GetSqlStringCommand(String.Format("UPDATE dbo.SiteConfig SET {0} WHERE  {1}", sqlCommandText.ToString(), whereCommandText.ToString()));

            db.AddInParameter(cmd, "@SiteConfigID", DbType.Int64, siteConfigEntity.SiteConfigID);
            db.AddInParameter(cmd, "@Title", DbType.AnsiString, siteConfigEntity.Title);
            db.AddInParameter(cmd, "@EnTitle", DbType.AnsiString, siteConfigEntity.EnTitle);
            db.AddInParameter(cmd, "@CN", DbType.AnsiString, siteConfigEntity.CN);
            db.AddInParameter(cmd, "@ISSN", DbType.AnsiString, siteConfigEntity.ISSN);
            db.AddInParameter(cmd, "@Home", DbType.AnsiString, siteConfigEntity.Home);
            db.AddInParameter(cmd, "@Keywords", DbType.AnsiString, siteConfigEntity.Keywords);
            db.AddInParameter(cmd, "@Description", DbType.AnsiString, siteConfigEntity.Description);
            db.AddInParameter(cmd, "@ICPCode", DbType.AnsiString, siteConfigEntity.ICPCode);
            db.AddInParameter(cmd, "@ZipCode", DbType.AnsiString, siteConfigEntity.ZipCode);
            db.AddInParameter(cmd, "@Address", DbType.AnsiString, siteConfigEntity.Address);
            db.AddInParameter(cmd, "@SendMail", DbType.AnsiString, siteConfigEntity.SendMail);
            db.AddInParameter(cmd, "@MailServer", DbType.AnsiString, siteConfigEntity.MailServer);
            db.AddInParameter(cmd, "@MailPort", DbType.Int32, siteConfigEntity.MailPort);
            db.AddInParameter(cmd, "@MailAccount", DbType.AnsiString, siteConfigEntity.MailAccount);
            db.AddInParameter(cmd, "@MailPwd", DbType.AnsiString, siteConfigEntity.MailPwd);
            db.AddInParameter(cmd, "@MailIsSSL", DbType.Boolean, siteConfigEntity.MailIsSSL);
            //商讯·中国
            db.AddInParameter(cmd, "@SMSUserName", DbType.AnsiString, siteConfigEntity.SMSUserName);
            db.AddInParameter(cmd, "@SMSPwd", DbType.AnsiString, siteConfigEntity.SMSPwd);
            //在线支付
            db.AddInParameter(cmd, "@EBankType", DbType.Byte, siteConfigEntity.EBankType);
            db.AddInParameter(cmd, "@EBankAccount", DbType.AnsiString, siteConfigEntity.EBankAccount);
            db.AddInParameter(cmd, "@EBankCode", DbType.AnsiString, siteConfigEntity.EBankCode);
            db.AddInParameter(cmd, "@EBankEncryKey", DbType.AnsiString, siteConfigEntity.EBankEncryKey);
            //DOI
            db.AddInParameter(cmd, "@DoiUserName", DbType.AnsiString, siteConfigEntity.DoiUserName);
            db.AddInParameter(cmd, "@DoiUserPwd", DbType.AnsiString, siteConfigEntity.DoiUserPwd);
            db.AddInParameter(cmd, "@DoiJournalID", DbType.AnsiString, siteConfigEntity.DoiJournalID);
            db.AddInParameter(cmd, "@DoiPrefix", DbType.AnsiString, siteConfigEntity.DoiPrefix);

            db.AddInParameter(cmd, "@EditUserID", DbType.Int64, siteConfigEntity.EditUserID);

            try
            {
                db.ExecuteNonQuery(cmd);
                flag = true;
            }
            catch (SqlException sqlEx)
            {
                throw sqlEx;
            }
            return(flag);
        }
示例#23
0
 public void SaveSiteConfig(SiteConfigEntity entity)
 {
     _repository.Update(entity);
 }
示例#24
0
 /// <summary>
 /// 从存储媒介删除实体数据
 /// </summary>
 /// <param name="siteConfig">SiteConfigEntity实体对象</param>
 /// <returns>true:删除成功 false:删除失败</returns>
 public bool DeleteSiteConfig(SiteConfigEntity siteConfig)
 {
     return(SiteConfigBusProvider.DeleteSiteConfig(siteConfig));
 }
示例#25
0
 /// <summary>
 /// 从存储媒介删除实体数据
 /// </summary>
 /// <param name="siteConfig">SiteConfigEntity实体对象</param>
 /// <returns>true:删除成功 false:删除失败</returns>
 public bool DeleteSiteConfig(SiteConfigEntity siteConfig)
 {
     return(SiteConfigDataAccess.Instance.DeleteSiteConfig(siteConfig));
 }
示例#26
0
 public void AddSiteConfig(SiteConfigEntity entity)
 {
     _repository.Insert(entity);
 }
示例#27
0
 /// <summary>
 /// 将实体数据存入存储媒介(持久化一个对象)
 /// </summary>
 /// <param name="siteConfig">SiteConfigEntity实体对象</param>
 /// <returns>true:存储成功 false:存储失败</returns>
 public bool AddSiteConfig(SiteConfigEntity siteConfig)
 {
     return(SiteConfigDataAccess.Instance.AddSiteConfig(siteConfig));
 }