using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace KstCMS.KstCMS_Manager.SystemSet.Users.role
{
    public partial class RoleCopy : KstCmsBase.WebPage.FrmControl
    {
        protected string RoleId = null;
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                RoleId = Request.QueryString.Get("RoleId");

                ROLE_NAME.Text = Server.UrlDecode(Request.QueryString.Get("RoleName")) + " 的复制";
                String[] ClsTitle = new String[1];
                ClsTitle[0] = "角色名称~!";
                base.Set_Control(ClsTitle, ROLE_NAME);

            }

        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            System.Threading.Thread.Sleep(1000);

            KstCmsBase.Entities.RoleEntity RoleInfo = KstCmsBase.DAL.Role.Get_RoleInfo(Convert.ToInt32(Request.Form.Get("ROLE_ID").ToString()));
            RoleInfo.RoleName = ROLE_NAME.Text.Trim();
            KstCmsBase.DAL.Role.Copy(RoleInfo);
            ScriptManager.RegisterStartupScript(UpdatePanel1, typeof(UpdatePanel), "SucceessMsg", "alert(\"复制成功\");parent.frames['leftFrame'].location.reload();", true);

        }
    }
}