CY_ZZJY.Web/admin/role/add_edit.aspx.cs

(开头部分) 2KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using CY_ZZJY.Service.Sys;
using CY_ZZJY.Model.Sys;
using CY_ZZJY.EasyUI;

namespace CY_ZZJY.Web.admin.role
{
    public partial class add_edit : System.Web.UI.Page
    {
        public string role_id = string.Empty;
        private SYS_ROLE_Service _SYS_ROLE_Service = new SYS_ROLE_Service();
        private Mdl_SYS_ROLE _Mdl_SYS_ROLE = null;
        public string XZQHJB = string.Empty;
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Request["role_id"] != null && !string.IsNullOrEmpty(Request.QueryString["role_id"].ToString()))
                this.role_id = Request.QueryString["role_id"].ToString().Trim();
            if (!IsPostBack)
                this.InitControl();
        }
        /// <summary>
        /// 初始化窗体控件
        /// </summary>
        private void InitControl()
        {
            this._Mdl_SYS_ROLE = new Mdl_SYS_ROLE();
            if (!string.IsNullOrEmpty(this.role_id))
            {
                this._Mdl_SYS_ROLE = this._SYS_ROLE_Service.GetEntity(this.role_id);
                this.NAME.Text = this._Mdl_SYS_ROLE.NAME;
            }
        }
        /// <summary>
        /// 保存按钮事件
        /// </summary>
        protected void btn_save_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(this.role_id))
            {
                #region 新增
                this.role_id = Guid.NewGuid().ToString();
                this._Mdl_SYS_ROLE = new Mdl_SYS_ROLE()
                {
                    NAME = this.NAME.Text.Trim(),
                    ADDDATE = System.DateTime.Now,
                    ROLE_ID = this.role_id
                };
                if (this._SYS_ROLE_Service.AddOrEdit("add", this._Mdl_SYS_ROLE))
                    ShowMsgHelper.ShowScript("true");
                else
                    ShowMsgHelper.ShowScript("false");
                #endregion
            }
            else
            {
后面还有 15 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。