Exemplo n.º 1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         if (Request.QueryString.Count > 0)
         {
             string name = Request.QueryString["name"].ToString().Trim();
             if (name.Equals("Edit"))
             {
                 if (Request.QueryString["RoleID"].ToString().Trim() != null)
                 {
                     string       roleGroupId = Request.QueryString["RoleID"].ToString().Trim();
                     RoleGroupTab roleGroup   = new RoleGroupTab();
                     roleGroup = roleGroupBLL.GetRoleGroupById(roleGroupId);
                     if (roleGroup != null)
                     {
                         this.txtRoleGroupID.Text     = roleGroup.MemberGradeID.ToString();
                         this.txtRoleGroupName.Text   = roleGroup.MemberGradeName.ToString();
                         this.txtGroupRemark.Text     = roleGroup.Remark.ToString();
                         this.txtRoleGroupID.ReadOnly = true;
                         this.Button1.Enabled         = false;
                     }
                 }
             }
         }
     }
 }
Exemplo n.º 2
0
    /// <summary>
    /// 添加角色组
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void Button1_Click(object sender, EventArgs e)
    {
        string       roleId    = Request.QueryString["RoleID"].ToString();
        RoleGroupTab roleGroup = new RoleGroupTab();

        if (this.txtRoleGroupName.Text.ToString().Trim() == null || this.txtRoleGroupName.Text.ToString().Trim() == "")
        {
            this.ClientScript.RegisterStartupScript(this.GetType(), "", "alert('请输入角色组名称!');location.href='AddRoleGrop.aspx'", true);
            return;
        }
        if (this.txtRoleGroupName.Text == "普通会员")
        {
            roleGroup.MemberGradeID = "1";
        }
        else if (this.txtRoleGroupName.Text == "银牌会员")
        {
            roleGroup.MemberGradeID = "2";
        }
        else if (this.txtRoleGroupName.Text == "金牌会员")
        {
            roleGroup.MemberGradeID = "3";
        }
        else if (this.txtRoleGroupName.Text == "钻石会员")
        {
            roleGroup.MemberGradeID = "4";
        }
        else
        {
            roleGroup.MemberGradeID = this.txtRoleGroupID.Text.ToString().Trim();
        }
        roleGroup.ManageTypeID    = roleId;
        roleGroup.MemberGradeName = this.txtRoleGroupName.Text.ToString().Trim();
        roleGroup.SDate           = DateTime.Now;
        roleGroup.SCheck          = 0;
        roleGroup.IsVip           = 0;
        roleGroup.Remark          = this.txtGroupRemark.Text.ToString().Trim();
        if (IsExist(roleGroup.MemberGradeID, roleGroup.MemberGradeName))
        {
            this.ClientScript.RegisterStartupScript(this.GetType(), "", "alert('角色组名称或角色组ID已存在!');location.href='AddRole.aspx'", true);
            return;
        }
        try
        {
            if (roleGroupBLL.AddRoleGroup(roleGroup))
            {
                this.ClientScript.RegisterStartupScript(this.GetType(), "", "alert('添加角色组成功!');location.href='ShowRoleList.aspx'", true);
                return;
            }
        }
        catch (Exception ex)
        {
            this.ClientScript.RegisterStartupScript(this.GetType(), "", "alert('添加角色组失败!');location.href='AddRoleGrop.aspx'", true);
            return;
        }
    }
Exemplo n.º 3
0
        /// <summary>
        /// 修改角色组信息
        /// </summary>
        /// <param name="roleTab"></param>
        /// <returns></returns>
        public bool UPdateRoleGroupInfo(RoleGroupTab roleTab)
        {
            bool flag = false;

            SqlParameter[] para = new SqlParameter[] { new SqlParameter("@MemberGradeID", SqlDbType.NVarChar, 20),
                                                       new SqlParameter("@SName", SqlDbType.NVarChar, 50),
                                                       new SqlParameter("@Remark", SqlDbType.NVarChar, 200) };
            para[0].Value = roleTab.MemberGradeID;
            para[1].Value = roleTab.MemberGradeName;
            para[2].Value = roleTab.Remark;
            flag          = DbHelperSQL.RunProcLob("Pro_UpdateRoleGroupInfo", para);
            return(flag);
        }
Exemplo n.º 4
0
    /// <summary>
    /// 修改角色信息
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void Button2_Click1(object sender, EventArgs e)
    {
        RoleGroupTab roleGroup = new RoleGroupTab();

        roleGroup.MemberGradeName = this.txtRoleGroupName.Text.ToString().Trim();
        roleGroup.Remark          = this.txtGroupRemark.Text.ToString().Trim();
        roleGroup.MemberGradeID   = this.txtRoleGroupID.Text.ToString().Trim();
        if (roleGroupBLL.UPdateRoleGroupInfo(roleGroup))
        {
            this.ClientScript.RegisterStartupScript(this.GetType(), "", "alert('角色组信息修改成功!');location.href='ShowRoleList.aspx'", true);
            return;
        }
        else
        {
            this.ClientScript.RegisterStartupScript(this.GetType(), "", "alert('角色组信息修改失败!');location.href='ShowRoleList.aspx'", true);
            return;
        }
    }
Exemplo n.º 5
0
        /// <summary>
        /// 根据角色组ID获取信息
        /// </summary>
        /// <param name="roleGroupId"></param>
        /// <returns></returns>
        public RoleGroupTab GetRoleGroupById(string roleGroupId)
        {
            RoleGroupTab roleGroup = null;

            SqlParameter[] para = new SqlParameter[] { new SqlParameter("@roleGroupId", roleGroupId) };
            para[0].Value = roleGroupId;
            SqlDataReader reader = DbHelperSQL.RunProcedure("Pro_GetRoleGroupByID", para);

            if (reader.Read())
            {
                roleGroup = new RoleGroupTab();
                roleGroup.MemberGradeID   = reader["MemberGradeID"].ToString();
                roleGroup.MemberGradeName = reader["MemberGradeName"].ToString().Trim();
                roleGroup.Remark          = reader["Remark"].ToString().Trim();
                roleGroup.SCheck          = Convert.ToInt32(reader["SCheck"].ToString().Trim());
            }
            reader.Close();
            reader.Dispose();
            return(roleGroup);
        }
Exemplo n.º 6
0
        /// <summary>
        /// 添加角色组
        /// </summary>
        /// <param name="RoleGroup"></param>
        /// <returns></returns>
        public bool AddRoleGroup(RoleGroupTab RoleGroup)
        {
            bool flag = false;

            SqlParameter[] para = { new SqlParameter("@RoleID", SqlDbType.Int,             4),
                                    new SqlParameter("@SName",  SqlDbType.NVarChar,      100),
                                    new SqlParameter("@SCheck", SqlDbType.Int,             4),
                                    new SqlParameter("@SDate",  SqlDbType.SmallDateTime,  50),
                                    new SqlParameter("@SysID",  SqlDbType.NVarChar,       50),
                                    new SqlParameter("@IsVIP",  SqlDbType.BigInt,          4),
                                    new SqlParameter("@Remark", SqlDbType.NVarChar,      500),
                                    new SqlParameter("@Pcode",  SqlDbType.NVarChar, 3000) };
            para[0].Value = RoleGroup.ManageTypeID;
            para[1].Value = RoleGroup.MemberGradeName;
            para[2].Value = RoleGroup.SCheck;
            para[3].Value = RoleGroup.SDate;
            para[4].Value = RoleGroup.MemberGradeID;
            para[5].Value = RoleGroup.IsVip;
            para[6].Value = RoleGroup.Remark;
            para[7].Value = "暂无";
            flag          = DbHelperSQL.RunProcLob("Pro_AddGroupRole", para);
            return(flag);
        }
Exemplo n.º 7
0
 /// <summary>
 /// 修改角色组信息
 /// </summary>
 /// <param name="roleTab"></param>
 /// <returns></returns>
 public bool UPdateRoleGroupInfo(RoleGroupTab roleTab)
 {
     return(RGDale.UPdateRoleGroupInfo(roleTab));
 }
Exemplo n.º 8
0
 /// <summary>
 /// 添加角色组
 /// </summary>
 /// <param name="RoleGroup"></param>
 /// <returns></returns>
 public bool AddRoleGroup(RoleGroupTab RoleGroup)
 {
     return(RGDale.AddRoleGroup(RoleGroup));
 }