Esempio n. 1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void DeleteButtonClick(object sender, CommandEventArgs e)
        {
            if (_roleId.HasValue)
            {
                Caisis.BOL.Role biz = new Caisis.BOL.Role();
                biz.Delete(_roleId.Value);

                Response.Redirect("Role_List.aspx");
            }
        }
Esempio n. 2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void UpdateButtonClick(object sender, CommandEventArgs e)
        {
            Caisis.BOL.Role biz = new Caisis.BOL.Role();
            biz.Get(_roleId);
            biz[Caisis.BOL.Role.Role_Field]      = Role.Value;
            biz[Caisis.BOL.Role.RoleDescription] = RoleDesc.Value;
            biz[Caisis.BOL.Role.DeactivatedTime] = null;
            biz.Save();

            InsertPermissions();
        }
Esempio n. 3
0
        /// <summary>
        /// Adds a new Role to the database
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void AddButtonClick(object sender, CommandEventArgs e)
        {
            Caisis.BOL.Role biz = new Caisis.BOL.Role();
            biz[Caisis.BOL.Role.Role_Field]      = Role.Value;
            biz[Caisis.BOL.Role.RoleDescription] = RoleDesc.Value;
            biz.Save();

            // After save, verify record inseted and insert permissions
            string newPriKey = biz[biz.PrimaryKeyName].ToString();

            if (!string.IsNullOrEmpty(newPriKey))
            {
                _roleId = int.Parse(newPriKey);
                InsertPermissions();
            }
            Response.Redirect("AdminRolePermissions.aspx?roleid=" + _roleId);
        }