Esempio n. 1
0
 /// <summary>
 /// updates the specified RolePermissions
 /// </summary>
 /// <param name="obj">RolePermissions</param>
 /// <returns></returns>
 public void Update(RolePermissions obj)
 {
     SqlHelper.ExecuteNonQuery(Data.ConnectionString, CommandType.StoredProcedure, "sproc_RolePermissions_Update"
                               , Data.CreateParameter("RolePermissionID", obj.RolePermissionID)
                               , Data.CreateParameter("RoleName", obj.RoleName)
                               , Data.CreateParameter("PageName", obj.PageName)
                               , Data.CreateParameter("Accessable", obj.Accessable)
                               );
 }
Esempio n. 2
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        public RolePermissions Populate(IDataReader myReader)
        {
            RolePermissions obj = new RolePermissions();

            obj.RolePermissionID = (int)myReader["RolePermissionID"];
            obj.RoleName         = (string)myReader["RoleName"];
            obj.PageName         = (string)myReader["PageName"];
            obj.Accessable       = (bool)myReader["Accessable"];
            return(obj);
        }
Esempio n. 3
0
        /// <summary>
        /// Add a new RolePermissions within RolePermissions database table
        /// </summary>
        /// <param name="obj">RolePermissions</param>
        /// <returns>key of table</returns>
        public int Add(RolePermissions obj)
        {
            DbParameter parameterItemID = Data.CreateParameter("RolePermissionID", obj.RolePermissionID);

            parameterItemID.Direction = ParameterDirection.Output;
            SqlHelper.ExecuteNonQuery(Data.ConnectionString, CommandType.StoredProcedure, "sproc_RolePermissions_Add"
                                      , parameterItemID
                                      , Data.CreateParameter("RoleName", obj.RoleName)
                                      , Data.CreateParameter("PageName", obj.PageName)
                                      , Data.CreateParameter("Accessable", obj.Accessable)
                                      );
            return((int)parameterItemID.Value);
        }