Example #1
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);
        }
Example #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 });
        }
Example #3
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);
 }
 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;
 }
Example #5
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 });
        }
        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;
        }
        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;
        }
        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;
        }
        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;
        }
 /// <summary>
 /// 修改站点配置
 /// </summary>
 /// <param name="model"></param>
 /// <returns></returns>
 public ExecResult EditSiteConfig(SiteConfigEntity model)
 {
     HttpClientHelper clientHelper = new HttpClientHelper();
     ExecResult result = clientHelper.PostAuth<ExecResult, SiteConfigEntity>(GetAPIUrl(APIConstant.UPDATESITECONFIGAJAX), model);
     return result;
 }
Example #11
0
 /// <summary>
 /// 将实体数据存入存储媒介(持久化一个对象)
 /// </summary>
 /// <param name="siteConfig">SiteConfigEntity实体对象</param>
 /// <returns>true:存储成功 false:存储失败</returns>
 public bool AddSiteConfig(SiteConfigEntity siteConfig)
 {
     return SiteConfigDataAccess.Instance.AddSiteConfig(siteConfig);
 }
Example #12
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);
 }
 /// <summary>
 /// 获取替换模版后的邮件短信内容
 /// </summary>
 /// <param name="dict"></param>
 /// <param name="config"></param>
 /// <param name="content"></param>
 /// <returns></returns>
 public string GetEmailOrSmsContent(IDictionary<string, string> dict, SiteConfigEntity config, string content)
 {
     if (dict == null)
         dict = new Dictionary<string, string>();
     dict["${系统日期}$"] = DateTime.Now.ToString("yyyy-MM-dd");
     dict["${系统时间}$"] = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
     if (config != null)
     {
         dict["${网站名称}$"] = config.Title;
         dict["${编辑部地址}$"] = config.Address;
         dict["${编辑部邮编}$"] = config.ZipCode;
     }
     foreach (var item in dict)
     {
         if(item.Key!="${金额}$")
         content = content.Replace(item.Key, item.Value);
     }
     return content;
 }
        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;
        }
Example #15
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);
 }
Example #16
0
        /// <summary>
        /// 审稿单
        /// </summary>
        /// <param name="ActionID">当前所做操作ID</param>
        /// <param name="StatusID">当前状态</param>
        /// <param name="CIDS">稿件ID,多个稿件ID用逗号分隔</param>
        /// <returns></returns>
        public ActionResult AuditBill(long ActionID, long StatusID, string CIDS)
        {
            //继续送交
            int IsContinueSubmit = 0;
            int ActionType = 0;//操作类型:标识继续送交/继续送专家复审
            if (ActionID == 0)
            {
                ActionType = 0;
                ISiteConfigFacadeService facadeService = ServiceContainer.Instance.Container.Resolve<ISiteConfigFacadeService>();
                DictEntity dicteEntity = facadeService.GetDictModelByKey(new DictQuery() { JournalID = CurAuthor.JournalID, DictKey = "MoreSubmit" });
                if (dicteEntity != null)
                {
                    IsContinueSubmit = 1;
                    ISiteConfigFacadeService currentService = ServiceContainer.Instance.Container.Resolve<ISiteConfigFacadeService>();
                    IList<DictValueEntity> list = currentService.GetDictValueList(new DictValueQuery() { JournalID = CurAuthor.JournalID, DictKey = dicteEntity.DictKey });
                    if (list != null && list.Count > 0)
                    {
                        DictValueEntity entity = list.Single<DictValueEntity>();
                        if (entity != null)
                        {
                            ActionID = entity.ValueID;
                        }
                    }
                }
                else
                {
                    IsContinueSubmit = -1;
                }
            }

            //继续送复审
            int IsContinueReSubmit = 0;
            if (ActionID == -1)
            {
                ActionType = -1;
                ISiteConfigFacadeService facadeService = ServiceContainer.Instance.Container.Resolve<ISiteConfigFacadeService>();
                DictEntity dicteEntity = facadeService.GetDictModelByKey(new DictQuery() { JournalID = CurAuthor.JournalID, DictKey = "MoreReSubmit" });
                if (dicteEntity != null)
                {
                    IsContinueReSubmit = 1;
                    ISiteConfigFacadeService currentService = ServiceContainer.Instance.Container.Resolve<ISiteConfigFacadeService>();
                    IList<DictValueEntity> list = currentService.GetDictValueList(new DictValueQuery() { JournalID = CurAuthor.JournalID, DictKey = dicteEntity.DictKey });
                    if (list != null && list.Count > 0)
                    {
                        DictValueEntity entity = list.Single<DictValueEntity>();
                        if (entity != null)
                        {
                            ActionID = entity.ValueID;
                        }
                    }
                }
                else
                {
                    IsContinueReSubmit = -1;
                }

            }

            //新加实体
            SiteConfigQuery SiteConfigQuery = new SiteConfigQuery();
            SiteConfigQuery.JournalID = CurAuthor.JournalID;
            ISiteConfigFacadeService SiteConfigService = ServiceContainer.Instance.Container.Resolve<ISiteConfigFacadeService>();
            SiteConfigEntity model = SiteConfigService.GetSiteConfigModel(SiteConfigQuery);
            if (model == null)
                model = new SiteConfigEntity();
            CirculationEntity cirEntity = new CirculationEntity();
            cirEntity.ActionID = ActionID;
            cirEntity.JournalID = JournalID;
            cirEntity.StatusID = StatusID;
            IDictionary<long, long> dictCIDMap = new Dictionary<long, long>();
            string[] CIDArray = CIDS.Split(',');
            long CID = 0;
            long FlowLogID = 0;
            foreach (string CIDLogID in CIDArray)
            {
                if (!string.IsNullOrEmpty(CIDLogID))
                {
                    string[] CIDANDLogID = CIDLogID.Split(':');
                    CID = TypeParse.ToLong(CIDANDLogID[0]);
                    FlowLogID = TypeParse.ToLong(CIDANDLogID[1]);
                    if (!dictCIDMap.ContainsKey(CID) && CID > 0)
                    {
                        dictCIDMap.Add(CID, FlowLogID);
                    }
                }
            }
            cirEntity.CIDS = string.Join(",", dictCIDMap.Keys);
            cirEntity.DictLogID = dictCIDMap;
            IFlowFacadeService flowService = ServiceContainer.Instance.Container.Resolve<IFlowFacadeService>();
            FlowStep flowStepInfo = flowService.GetNextFlowStep(cirEntity);

            # region 让当前用户排第一个

            if (flowStepInfo.FlowAuthorList != null)
            {
                WKT.Model.AuthorInfoEntity curEditor = null;
                foreach (WKT.Model.AuthorInfoEntity item in flowStepInfo.FlowAuthorList)
                {
                    if (item.AuthorID == CurAuthor.AuthorID)
                    {
                        curEditor = item;
                        break;
                    }
                }
                if (curEditor != null)
                {
                    flowStepInfo.FlowAuthorList.Remove(curEditor);
                    flowStepInfo.FlowAuthorList.Insert(0, curEditor);
                }
            }

            # endregion

            flowStepInfo.DictLogID = dictCIDMap;
            ISiteConfigFacadeService service = ServiceContainer.Instance.Container.Resolve<ISiteConfigFacadeService>();
            MessageTemplateQuery query = new MessageTemplateQuery();
            query.JournalID = CurAuthor.JournalID;
            query.TType = 1;
            if (flowStepInfo.FlowAction != null)
            {
                if (flowStepInfo.FlowAction.EmailTemplate > 0)
                {
                    query.TemplateID = flowStepInfo.FlowAction.EmailTemplate;
                    flowStepInfo.EmailTemplate = service.GetMessageTempModel(query);
                    if (CIDArray.Length == 1)//仅选择一篇稿件处理时,替换其中的稿件编号/标题变量为具体内容
                        flowStepInfo.EmailTemplate.TContent = ReplaceContent(CID,flowStepInfo.EmailTemplate.TContent);
                }
                if (flowStepInfo.FlowAction.SMSTemplate > 0)
                {
                    query.TType = 2;
                    query.TemplateID = flowStepInfo.FlowAction.SMSTemplate;
                    flowStepInfo.SMSTemplate = service.GetMessageTempModel(query);
                    if (CIDArray.Length == 1)
                        flowStepInfo.SMSTemplate.TContent = ReplaceContent(CID, flowStepInfo.SMSTemplate.TContent);
                }
            }
            else
            {
                flowStepInfo.FlowAction = new FlowActionEntity { ActionID = -1, ActionType = 1, ActionRoleID = 0 };
                flowStepInfo.FlowConfig = new FlowConfigEntity();
            }
            ViewBag.StatusID = StatusID;
            ViewBag.ActionType = ActionType;
            ViewBag.IsContinueSubmit = IsContinueSubmit;
            ViewBag.IsContinueReSubmit = IsContinueReSubmit;
            return View(flowStepInfo);
        }
Example #17
0
 /// <summary>
 /// 将实体数据存入存储媒介(持久化一个对象)
 /// </summary>
 /// <param name="siteConfig">SiteConfigEntity实体对象</param>
 /// <returns>true:存储成功 false:存储失败</returns>
 public bool AddSiteConfig(SiteConfigEntity siteConfig)
 {
     return SiteConfigBusProvider.AddSiteConfig(siteConfig);
 }
Example #18
0
 public ActionResult Welcome()
 {
     string qq = SiteConfig.QQ;
     ViewBag.qq = qq;
     ViewBag.Group = CurAuthor.GroupID;
     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);
 }
Example #19
0
 /// <summary>
 /// 从存储媒介删除实体数据
 /// </summary>
 /// <param name="siteConfig">SiteConfigEntity实体对象</param>
 /// <returns>true:删除成功 false:删除失败</returns>
 public bool DeleteSiteConfig(SiteConfigEntity siteConfig)
 {
     return SiteConfigBusProvider.DeleteSiteConfig(siteConfig);
 }
Example #20
0
 /// <summary>
 /// 从存储媒介删除实体数据
 /// </summary>
 /// <param name="siteConfig">SiteConfigEntity实体对象</param>
 /// <returns>true:删除成功 false:删除失败</returns>
 public bool DeleteSiteConfig(SiteConfigEntity siteConfig)
 {
     return SiteConfigDataAccess.Instance.DeleteSiteConfig(siteConfig);
 }
        /// <summary>
        /// 发送邮件短信
        /// </summary>
        /// <param name="list"></param>
        /// <param name="isEmail">true:邮件 false:短信</param>
        /// <param name="isMass">true:群发(没有使用模版) false:一条一条发</param>
        /// <param name="sendMailName">邮件发件人称呼</param>
        /// <returns></returns>
        private bool SendEmailOrSms(IList<MessageRecodeEntity> list, bool isEmail, bool isMass, MessageRecodeEntity entity, ref string errorMsg, SiteConfigEntity config = null, bool IsRecode = true)
        {
            try
            {
                if (config == null)
                    config = GetSiteConfig(list[0].JournalID);
                List<Int32> errorList = new List<Int32>();
                if (isEmail)   //发送邮件
                {
                    if (string.IsNullOrWhiteSpace(config.MailServer)
                        || string.IsNullOrWhiteSpace(config.MailAccount)
                        || string.IsNullOrWhiteSpace(config.MailPwd))
                    {
                        errorMsg = "请配置邮件发送相关信息!";
                        return false;
                    }
                    if (entity != null)
                    {
                        if (!string.IsNullOrWhiteSpace(entity.sendMailName))
                            config.SendMail = entity.sendMailName;
                    }
                    if (isMass)  //群发
                    {
                        if (!EmailUtils.SendMailEx(config.MailServer, config.MailPort, config.MailAccount, config.MailPwd, config.SendMail
                            , string.Join(",", list.Select(p => p.ReciveAddress)), string.Empty, string.Empty, list[0].MsgTitle, list[0].MsgContent
                            , list[0].FilePath, 2, true, "UTF-8", true, config.MailIsSSL))
                            errorList.AddRange(list.Select(p => p.Index));
                    }
                    else  //一条一条的发
                    {
                        foreach (var model in list)
                        {
                            if (!EmailUtils.SendMailEx(config.MailServer, config.MailPort, config.MailAccount, config.MailPwd, config.SendMail
                            , model.ReciveAddress, string.Empty, string.Empty, model.MsgTitle, model.MsgContent
                            , model.FilePath, 2, true, "UTF-8", true, config.MailIsSSL))
                                errorList.Add(model.Index);
                        }
                    }
                }
                else //发送短信
                {
                    if (string.IsNullOrWhiteSpace(config.SMSUserName))
                    {
                        errorMsg = "请配置短信发送相关信息!";
                        return false;
                    }
                    if (isMass)
                    {
                        if (entity != null)
                        {
                            if (!SmsHelper.SendSmsSHP(string.Join(",", list.Select(p => p.ReciveAddress)), list[0].MsgContent, config.SMSUserName, config.SMSPwd))
                                errorList.AddRange(list.Select(p => p.Index));

                        }

                    }
                    else
                    {
                        if (entity != null)
                        {
                            foreach (var model in list)
                            {
                                if (!SmsHelper.SendSmsSHP(model.ReciveAddress, model.MsgContent, config.SMSUserName, config.SMSPwd))
                                    errorList.Add(model.Index);
                            }

                        }

                    }
                }

                var listResult = list.Where(p => !errorList.Contains(p.Index)).ToList();

                if (listResult == null || listResult.Count == 0)
                    return false;

                if (IsRecode)
                {
                    SaveSendRecode(listResult);
                }

                return true;
            }
            catch (Exception ex)
            {
                LogProvider.Instance.Error("发送邮件短信异常:" + ex.Message);
                errorMsg = ex.Message;
                return false;
            }
        }