예제 #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //about
            Johnny.CMS.BLL.SystemInfo.WebSettings bll   = new Johnny.CMS.BLL.SystemInfo.WebSettings();
            Johnny.CMS.OM.SystemInfo.WebSettings  model = bll.GetModel();

            if (model != null)
            {
                lblShortDescription.Text = model.ShortDescription;
            }

            //website
            Johnny.CMS.BLL.SeH.OpenSource        bllOpenSource  = new Johnny.CMS.BLL.SeH.OpenSource();
            IList <Johnny.CMS.OM.SeH.OpenSource> listOpenSource = bllOpenSource.GetList();

            StringBuilder sb = new StringBuilder();
            int           ix = 0;

            for (ix = 0; ix < listOpenSource.Count; ix++)
            {
                if (ix % 4 == 0)
                {
                    sb.Append("<ul>");
                }
                sb.Append(string.Format("<li><a href=\"{0}\" target=\"_blank\" title=\"{1}\">{2}</a></li>", listOpenSource[ix].URL, listOpenSource[ix].Description, listOpenSource[ix].OpenSourceName));
                if (ix != 0 && (ix == listOpenSource.Count - 1 || ix % 3 == 0))
                {
                    sb.Append("</ul>");
                }
            }

            lblWebsites.Text = sb.ToString();

            //best practice
            sb.Length = 0;
            Johnny.CMS.BLL.SeH.BestPractice        bllBestPractice  = new Johnny.CMS.BLL.SeH.BestPractice();
            IList <Johnny.CMS.OM.SeH.BestPractice> listBestPractice = bllBestPractice.GetList();

            foreach (Johnny.CMS.OM.SeH.BestPractice bestpractice in listBestPractice)
            {
                sb.Append(string.Format("	<h4><a href=\"bestpracticedetails.aspx?bestpracticeid={0}\">{1}</a></h4>", bestpractice.BestPracticeId, bestpractice.BestPracticeName));
            }

            lblBestPractice.Text = sb.ToString();
        }
예제 #2
0
        protected override void Page_Load(object sender, EventArgs e)
        {
            base.Page_Load(sender, e);

            if (!this.IsPostBack)
            {
                Johnny.CMS.BLL.SystemInfo.WebSettings bll   = new Johnny.CMS.BLL.SystemInfo.WebSettings();
                Johnny.CMS.OM.SystemInfo.WebSettings  model = new Johnny.CMS.OM.SystemInfo.WebSettings();
                model = bll.GetModel();

                txtWebsiteName.Text      = model.WebsiteName;
                txtWebsiteTitle.Text     = model.WebsiteTitle;
                txtShortDescription.Text = model.ShortDescription;
                txtTel.Text             = model.Tel;
                txtFax.Text             = model.Fax;
                txtEmail.Text           = model.Email;
                txtWebsiteAddress.Text  = model.WebsiteAddress;
                txtWebsitePath.Text     = model.WebsitePath;
                txtFileSize.Text        = DataConvert.GetString(model.FileSize);
                txtLogoPath.Text        = model.LogoPath;
                txtBannerPath.Text      = model.BannerPath;
                txtCopyright.Text       = model.Copyright;
                txtMetaKeywords.Text    = model.MetaKeywords;
                txtMetaDescription.Text = model.MetaDescription;
                if (model.IsClosed)
                {
                    rdbIsClosed1.Checked = true;
                }
                else
                {
                    rdbIsClosed0.Checked = true;
                }
                txtClosedInfo.Text    = model.ClosedInfo;
                txtUserAgreement.Text = model.UserAgreement;
                if (model.LoginType)
                {
                    rdbLoginType0.Checked = true;
                }
                else
                {
                    rdbLoginType1.Checked = true;
                }
                btnAdd.ButtonType = Johnny.Controls.Web.Button.Button.EnumButtonType.Save;
            }
        }
예제 #3
0
        public SysParameter()
        {
            int intCache = 30;//缓存时间
            string cc_WebSettings = "WebSettings";

            object objWebSetting = Johnny.Library.Helper.CacheHelper.GetCache(cc_WebSettings);
            Johnny.CMS.OM.SystemInfo.WebSettings wsmodel = new Johnny.CMS.OM.SystemInfo.WebSettings();
            if (objWebSetting != null)
            {
                wsmodel = (Johnny.CMS.OM.SystemInfo.WebSettings)objWebSetting;
            }
            else
            {
                Johnny.CMS.BLL.SystemInfo.WebSettings wsbll = new Johnny.CMS.BLL.SystemInfo.WebSettings();
                wsmodel = wsbll.GetModel();
                Johnny.Library.Helper.CacheHelper.SetCache(cc_WebSettings, wsmodel, DateTime.Now.AddMinutes(intCache), TimeSpan.Zero);
            }
            _websettings = wsmodel;
        }
예제 #4
0
        public SysParameter()
        {
            int    intCache       = 30;//缓存时间
            string cc_WebSettings = "WebSettings";

            object objWebSetting = Johnny.Library.Helper.CacheHelper.GetCache(cc_WebSettings);

            Johnny.CMS.OM.SystemInfo.WebSettings wsmodel = new Johnny.CMS.OM.SystemInfo.WebSettings();
            if (objWebSetting != null)
            {
                wsmodel = (Johnny.CMS.OM.SystemInfo.WebSettings)objWebSetting;
            }
            else
            {
                Johnny.CMS.BLL.SystemInfo.WebSettings wsbll = new Johnny.CMS.BLL.SystemInfo.WebSettings();
                wsmodel = wsbll.GetModel();
                Johnny.Library.Helper.CacheHelper.SetCache(cc_WebSettings, wsmodel, DateTime.Now.AddMinutes(intCache), TimeSpan.Zero);
            }
            _websettings = wsmodel;
        }
예제 #5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //about
            Johnny.CMS.BLL.SystemInfo.WebSettings bll = new Johnny.CMS.BLL.SystemInfo.WebSettings();
            Johnny.CMS.OM.SystemInfo.WebSettings model = bll.GetModel();

            if (model != null)
            {
                lblShortDescription.Text = model.ShortDescription;
            }

            //website
            Johnny.CMS.BLL.SeH.OpenSource bllOpenSource = new Johnny.CMS.BLL.SeH.OpenSource();
            IList<Johnny.CMS.OM.SeH.OpenSource> listOpenSource = bllOpenSource.GetList();

            StringBuilder sb = new StringBuilder();
            int ix = 0;
            for (ix = 0; ix < listOpenSource.Count; ix++)
            {
                if (ix % 4 == 0)
                    sb.Append("<ul>");
                sb.Append(string.Format("<li><a href=\"{0}\" target=\"_blank\" title=\"{1}\">{2}</a></li>", listOpenSource[ix].URL, listOpenSource[ix].Description, listOpenSource[ix].OpenSourceName));
                if (ix != 0 && (ix == listOpenSource.Count - 1 || ix % 3 == 0))
                    sb.Append("</ul>");
            }

            lblWebsites.Text = sb.ToString();

            //best practice
            sb.Length = 0;
            Johnny.CMS.BLL.SeH.BestPractice bllBestPractice = new Johnny.CMS.BLL.SeH.BestPractice();
            IList<Johnny.CMS.OM.SeH.BestPractice> listBestPractice = bllBestPractice.GetList();

            foreach (Johnny.CMS.OM.SeH.BestPractice bestpractice in listBestPractice)
            {
                sb.Append(string.Format("	<h4><a href=\"bestpracticedetails.aspx?bestpracticeid={0}\">{1}</a></h4>", bestpractice.BestPracticeId, bestpractice.BestPracticeName));
            }

            lblBestPractice.Text = sb.ToString();
        }
예제 #6
0
        protected override void Page_Load(object sender, EventArgs e)
        {
            base.Page_Load(sender, e);

            if (!this.IsPostBack)
            {
                Johnny.CMS.BLL.SystemInfo.WebSettings bll = new Johnny.CMS.BLL.SystemInfo.WebSettings();
                Johnny.CMS.OM.SystemInfo.WebSettings model = new Johnny.CMS.OM.SystemInfo.WebSettings();
                model = bll.GetModel();

                txtWebsiteName.Text = model.WebsiteName;
                txtWebsiteTitle.Text = model.WebsiteTitle;
                txtShortDescription.Text = model.ShortDescription;
                txtTel.Text = model.Tel;
                txtFax.Text = model.Fax;
                txtEmail.Text = model.Email;
                txtWebsiteAddress.Text = model.WebsiteAddress;
                txtWebsitePath.Text = model.WebsitePath;
                txtFileSize.Text = DataConvert.GetString(model.FileSize);
                txtLogoPath.Text = model.LogoPath;
                txtBannerPath.Text = model.BannerPath;
                txtCopyright.Text = model.Copyright;
                txtMetaKeywords.Text = model.MetaKeywords;
                txtMetaDescription.Text = model.MetaDescription;
                if (model.IsClosed)
                    rdbIsClosed1.Checked = true;
                else
                    rdbIsClosed0.Checked = true;
                txtClosedInfo.Text = model.ClosedInfo;
                txtUserAgreement.Text = model.UserAgreement;
                if (model.LoginType)
                    rdbLoginType0.Checked = true;
                else
                    rdbLoginType1.Checked = true;
                btnAdd.ButtonType = Johnny.Controls.Web.Button.Button.EnumButtonType.Save;
            }
        }       
예제 #7
0
        protected void btnAdd_Click(object sender, System.EventArgs e)
        {
            SetMessage("");

            //validation
            if (!CheckInputEmptyAndLength(txtWebsiteName, "E00101", "E00102", false))
                return;
            if (!CheckInputEmptyAndLength(txtWebsiteTitle, "E00101", "E00102", false))
                return;
            if (!CheckInputLength(txtTel, "E00104"))
                return;
            if (!CheckInputLength(txtFax, "E00106"))
                return;
            if (!CheckInputLength(txtEmail, "E00106"))
                return;
            if (!CheckInputEmptyAndLength(txtWebsiteAddress, "E00101", "E00102"))
                return;
            if (!CheckInputEmptyAndLength(txtWebsitePath, "E00101", "E00102"))
                return;
            if (!CheckInputEmptyAndLength(txtFileSize, "E00101", "E00102"))
                return;
            if (!DataValidation.IsNaturalNumberRange(txtFileSize.Text, 0, 5120))
                return;
            if (!CheckInputEmptyAndLength(txtLogoPath, "E00101", "E00102"))
                return;
            if (!CheckInputEmptyAndLength(txtBannerPath, "E00101", "E00102"))
                return;
            if (!CheckInputLength(txtCopyright, "E00106"))
                return;
            if (!CheckInputLength(txtMetaKeywords, "E00106"))
                return;
            if (!CheckInputLength(txtMetaDescription, "E00106"))
                return;
            if (!CheckInputLength(txtClosedInfo, "E00106"))
                return;

            Johnny.CMS.BLL.SystemInfo.WebSettings bll = new Johnny.CMS.BLL.SystemInfo.WebSettings();
            Johnny.CMS.OM.SystemInfo.WebSettings model = new Johnny.CMS.OM.SystemInfo.WebSettings();

            model.WebsiteName = txtWebsiteName.Text;
            model.WebsiteTitle = txtWebsiteTitle.Text;
            model.ShortDescription = txtShortDescription.Text;
            model.Tel = txtTel.Text;
            model.Fax = txtFax.Text;
            model.Email = txtEmail.Text;
            model.WebsiteAddress = txtWebsiteAddress.Text;
            model.WebsitePath = txtWebsitePath.Text;
            model.FileSize = DataConvert.GetInt32(txtFileSize.Text);
            model.LogoPath = txtLogoPath.Text;
            model.BannerPath = txtBannerPath.Text;
            model.Copyright = txtCopyright.Text;
            model.MetaKeywords = txtMetaKeywords.Text;
            model.MetaDescription = txtMetaDescription.Text;
            model.IsClosed = rdbIsClosed1.Checked;
            model.ClosedInfo = txtClosedInfo.Text;
            model.UserAgreement = txtUserAgreement.Text;
            model.LoginType = rdbLoginType0.Checked;

            bll.AddOrUpdate(model);
            SetMessage(GetMessage("C00003"));
        }
예제 #8
0
        protected void btnAdd_Click(object sender, System.EventArgs e)
        {
            SetMessage("");

            //validation
            if (!CheckInputEmptyAndLength(txtWebsiteName, "E00101", "E00102", false))
            {
                return;
            }
            if (!CheckInputEmptyAndLength(txtWebsiteTitle, "E00101", "E00102", false))
            {
                return;
            }
            if (!CheckInputLength(txtTel, "E00104"))
            {
                return;
            }
            if (!CheckInputLength(txtFax, "E00106"))
            {
                return;
            }
            if (!CheckInputLength(txtEmail, "E00106"))
            {
                return;
            }
            if (!CheckInputEmptyAndLength(txtWebsiteAddress, "E00101", "E00102"))
            {
                return;
            }
            if (!CheckInputEmptyAndLength(txtWebsitePath, "E00101", "E00102"))
            {
                return;
            }
            if (!CheckInputEmptyAndLength(txtFileSize, "E00101", "E00102"))
            {
                return;
            }
            if (!DataValidation.IsNaturalNumberRange(txtFileSize.Text, 0, 5120))
            {
                return;
            }
            if (!CheckInputEmptyAndLength(txtLogoPath, "E00101", "E00102"))
            {
                return;
            }
            if (!CheckInputEmptyAndLength(txtBannerPath, "E00101", "E00102"))
            {
                return;
            }
            if (!CheckInputLength(txtCopyright, "E00106"))
            {
                return;
            }
            if (!CheckInputLength(txtMetaKeywords, "E00106"))
            {
                return;
            }
            if (!CheckInputLength(txtMetaDescription, "E00106"))
            {
                return;
            }
            if (!CheckInputLength(txtClosedInfo, "E00106"))
            {
                return;
            }

            Johnny.CMS.BLL.SystemInfo.WebSettings bll   = new Johnny.CMS.BLL.SystemInfo.WebSettings();
            Johnny.CMS.OM.SystemInfo.WebSettings  model = new Johnny.CMS.OM.SystemInfo.WebSettings();

            model.WebsiteName      = txtWebsiteName.Text;
            model.WebsiteTitle     = txtWebsiteTitle.Text;
            model.ShortDescription = txtShortDescription.Text;
            model.Tel             = txtTel.Text;
            model.Fax             = txtFax.Text;
            model.Email           = txtEmail.Text;
            model.WebsiteAddress  = txtWebsiteAddress.Text;
            model.WebsitePath     = txtWebsitePath.Text;
            model.FileSize        = DataConvert.GetInt32(txtFileSize.Text);
            model.LogoPath        = txtLogoPath.Text;
            model.BannerPath      = txtBannerPath.Text;
            model.Copyright       = txtCopyright.Text;
            model.MetaKeywords    = txtMetaKeywords.Text;
            model.MetaDescription = txtMetaDescription.Text;
            model.IsClosed        = rdbIsClosed1.Checked;
            model.ClosedInfo      = txtClosedInfo.Text;
            model.UserAgreement   = txtUserAgreement.Text;
            model.LoginType       = rdbLoginType0.Checked;

            bll.AddOrUpdate(model);
            SetMessage(GetMessage("C00003"));
        }