示例#1
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            bool   IsRunning  = this.chkSysIsRun.Checked;
            bool   IsStatic   = this.rbtnIsStatic.SelectedValue == "0" ? true : false;
            string webName    = this.txtWebName.Text;
            string webAddress = this.txtWebAddress.Text;

            if (sys.IsStatic != IsStatic || sys.IsRunning != IsRunning) //状态转换以后执行的动作
            {
                sys.IsStatic  = IsStatic;                               //修改系统状态,使静态生成的页面是当前状态
                sys.IsRunning = IsRunning;

                //只重新生成所有专题的首页
                DataTable dt = bllspeciality.GetAllList().Tables[0];
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    if (sys.IsStatic)
                    {
                        sys.ToStaticDefault(Convert.ToInt32(dt.Rows[i]["id"]));
                    }
                    else
                    {
                        sys.deleteDefaultPage(Convert.ToInt32(dt.Rows[i]["id"]));
                    }
                }

                //生成首页
                if (sys.IsStatic)
                {
                    sys.ToStaticDefault("");
                }
                else
                {
                    sys.deleteDefaultPage(0);
                }
            }
            sys.webName                 = webName;
            sys.webAddress              = webAddress;
            sys.lianXiren               = txtLianXiRen.Text;
            sys.workPhone               = txtWorkPhone.Text;
            sys.workPlace               = txtWorkPlace.Text;
            sys.cellPhone               = txtCellPhone.Text;
            sys.flax                    = txtFlax.Text;
            sys.beiAnHao                = txtBeiAnHao.Text;
            modelcycms                  = bllcycms.GetModel(bllcycms.GetMaxId() - 1);
            modelcycms.dbo_IsRunning    = sys.IsRunning;
            modelcycms.dbo_IsStatic     = sys.IsStatic;
            modelcycms.dbo_WebAddress   = sys.webAddress;
            modelcycms.dbo_WebName      = sys.webName;
            modelcycms.dbo_LianXiRen    = sys.lianXiren;
            modelcycms.dbo_WorkPohne    = sys.workPhone;
            modelcycms.dbo_WorkPlace    = sys.workPlace;
            modelcycms.dbo_CellPhone    = sys.cellPhone;
            modelcycms.dbo_Flax         = sys.flax;
            modelcycms.dbo_VisitedTimes = Convert.ToInt32(sys.VisitedTimes);
            modelcycms.dbo_BeiAnHao     = sys.beiAnHao;
            bllcycms.Update(modelcycms);
            Page.ClientScript.RegisterStartupScript(Page.GetType(), "alertMessage", "alert('状态修改成功!')", true);
        }
示例#2
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            sys.mailAddress = this.txtmailAddress.Text;
            sys.smtpServer  = this.txtsmtpServer.Text;
            sys.mailName    = this.txtmailName.Text;
            sys.mailPwd     = this.txtmailPwd.Text;

            modelcycms = bllcycms.GetModel(bllcycms.GetMaxId() - 1);
            modelcycms.dbo_SmtpServer  = sys.smtpServer;
            modelcycms.dbo_MailAddress = sys.mailAddress;
            modelcycms.dbo_MailName    = sys.mailName;
            modelcycms.dbo_MailPwd     = sys.mailPwd;
            bllcycms.Update(modelcycms);
            sys.alert("保存成功!");
        }