예제 #1
0
        /// <summary>
        /// 提交事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            ADT.XingZhi.Models.X.PageRole p = new Models.X.PageRole();
            p._PageCode = this.txtPageCode.Text;
            p._CodeName = this.txtCodeName.Text;
            p._Flag     = this.chkFlag.Checked.ToString();
            int flag = 0;
            int id   = RequestHelper.GetRequestInt("id", 0);

            if (id > 0)
            {
                flag = operate.UpdatePageRole(p, id);
            }
            else
            {
                flag = operate.InsertPageRole(p);
            }
            if (flag == 1)
            {
                PageContext.RegisterStartupScript(ActiveWindow.GetHideRefreshReference());
                Alert.ShowInParent("保存成功");
            }
            else if (flag == 100)
            {
                Alert.ShowInParent("页面代码已被占用,请重新输入");
            }
            else
            {
                Alert.ShowInParent("保存失败");
            }
        }