Click here to Skip to main content
15,917,793 members
Home / Discussions / C#
   

C#

 
GeneralRe: Struct vs Class? Pin
BillWoodruff17-Feb-14 1:41
professionalBillWoodruff17-Feb-14 1:41 
AnswerStruct vs Class? (Off Topic) Pin
OriginalGriff17-Feb-14 0:41
mveOriginalGriff17-Feb-14 0:41 
GeneralRe: Struct vs Class? (Off Topic) Pin
David C# Hobbyist.17-Feb-14 11:12
professionalDavid C# Hobbyist.17-Feb-14 11:12 
GeneralRe: Struct vs Class? (Off Topic) Pin
OriginalGriff17-Feb-14 11:24
mveOriginalGriff17-Feb-14 11:24 
GeneralRe: Struct vs Class? (Off Topic) Pin
OriginalGriff23-Feb-14 0:29
mveOriginalGriff23-Feb-14 0:29 
GeneralRe: Struct vs Class? (Off Topic) Pin
David C# Hobbyist.23-Feb-14 4:42
professionalDavid C# Hobbyist.23-Feb-14 4:42 
GeneralRe: Struct vs Class? (Off Topic) Pin
OriginalGriff23-Feb-14 4:57
mveOriginalGriff23-Feb-14 4:57 
QuestionInterface for Authorization Custom Inteface c# Winforms .net 4.0 Pin
Member 1050351416-Feb-14 12:10
Member 1050351416-Feb-14 12:10 
I have the following task to design an interface not the classes for an authorization class it should account for the following conditions can people recommend changes to the class or how could i better it according to the following rules


Administrative users of the application manage users and permissions. Managers can view and edit information about employees reporting to them. Employees can view their information but do not have access to other employees' information. Employees in the Human Resources department have access to information about all employees, but don't have access to the information of others in HR.

C#
////////////////////////////////////////////////////////////////////////////////////////////////////
// file:	IAuthorisation.cs
//
// summary:	Declares the IAuthorisation interface
////////////////////////////////////////////////////////////////////////////////////////////////////

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace NaviNetHrContext.Context
{
    public interface IAuthorisation
    {
        ////////////////////////////////////////////////////////////////////////////////////////////////////
        /// <summary>   Gets the sallary record by identifiers in this collection. </summary>
        ///
        /// <param name="employeeId">   Identifier for the employee. </param>
        ///
        /// <returns>
        /// An enumerator that allows foreach to be used to process the sallary record by identifiers in
        /// this collection.
        /// </returns>
        ////////////////////////////////////////////////////////////////////////////////////////////////////

        IEnumerable<Sallary> GetSallaryRecordById(int employeeId);

        ////////////////////////////////////////////////////////////////////////////////////////////////////
        /// <summary>  Gets the employees by manager identifiers in this collection. </summary>
        ///
        /// <param name="empNo">   The emp no. </param>
        ///
        /// <returns>
        /// An enumerator that allows foreach to be used to process the employees by manager identifiers
        /// in this collection.
        /// </returns>
        ////////////////////////////////////////////////////////////////////////////////////////////////////

        IEnumerable<Vacation> GetVacationRecordsById(int employeeId);


        ////////////////////////////////////////////////////////////////////////////////////////////////////
        /// <summary>  Gets the employees by manager identifiers in this collection. </summary>
        ///
        /// <param name="empNo">   The emp no. </param>
        ///
        /// <returns>
        /// An enumerator that allows foreach to be used to process the employees by manager identifiers
        /// in this collection.
        /// </returns>
        ////////////////////////////////////////////////////////////////////////////////////////////////////

        IEnumerable<Employee> GetEmployeesByManagerId(int employeeId);

        ////////////////////////////////////////////////////////////////////////////////////////////////////
        /// <summary>  Gets the employees in this collection. </summary>
        ///
        /// <param name="empNo">   The emp no. </param>
        ///
        /// <returns>
        /// An enumerator that allows foreach to be used to process the employees in this collection.
        /// </returns>
        ////////////////////////////////////////////////////////////////////////////////////////////////////

        IEnumerable<Employee> GetEmployees(int employeeId);

        ////////////////////////////////////////////////////////////////////////////////////////////////////
        /// <summary>   Query if 'employeeId' is in role. </summary>
        ///
        /// <param name="employeeId">   Identifier for the employee. </param>
        /// <param name="groupRole">    The group role. </param>
        ///
        /// <returns>   true if in role, false if not. </returns>
        ////////////////////////////////////////////////////////////////////////////////////////////////////

        Boolean IsInRole(string employeeId, int groupRole);

        ////////////////////////////////////////////////////////////////////////////////////////////////////
        /// <summary>   Deletes the role. Of A Given Employee </summary>
        ///
        /// <param name="employeeId">   Identifier for the employee. </param>
        /// <param name="role">         The role. </param>
        ///
        /// <returns>   true if it succeeds, false if it fails. </returns>
        ////////////////////////////////////////////////////////////////////////////////////////////////////

        Boolean DeleteRole(string employeeId);

        ////////////////////////////////////////////////////////////////////////////////////////////////////
        /// <summary>   Edit role. </summary>
        ///
        /// <param name="employeeId">   Identifier for the employee. </param>
        /// <param name="deleteRights"> true to delete the rights. </param>
        /// <param name="editRights">   true to edit rights. </param>
        /// <param name="viewRights">   true to view rights. </param>
        /// <param name="groupRole">    The group role. </param>
        ///
        /// <returns>   true if it succeeds, false if it fails. </returns>
        ////////////////////////////////////////////////////////////////////////////////////////////////////

        Boolean EditRole(string employeeId, Boolean deleteRights, Boolean editRights, Boolean viewRights, int groupRole);

        ////////////////////////////////////////////////////////////////////////////////////////////////////
        /// <summary>   Creates user in role. </summary>
        ///
        /// <param name="employeeId">   Identifier for the employee. </param>
        /// <param name="deleteRights"> true to delete the rights. </param>
        /// <param name="editRights">   true to edit rights. </param>
        /// <param name="viewRights">   true to view rights. </param>
        /// <param name="groupRole">    The group role. </param>
        ///
        /// <returns>   The new user in role. </returns>
        ////////////////////////////////////////////////////////////////////////////////////////////////////

        string CreateUserInRole(string employeeId, Boolean deleteRights, Boolean editRights, Boolean viewRights, int groupRole);

        ////////////////////////////////////////////////////////////////////////////////////////////////////
        /// <summary>   Creates a role. </summary>
        ///
        /// <param name="deleteRights"> true to delete the rights. </param>
        /// <param name="editRights">   true to edit rights. </param>
        /// <param name="viewRights">   true to view rights. </param>
        /// <param name="groupRole">    The group role. </param>
        ///
        /// <returns>   The new role. </returns>
        ////////////////////////////////////////////////////////////////////////////////////////////////////

        string CreateRole(Boolean deleteRights, Boolean editRights, Boolean viewRights, int groupRole);
    }
}

AnswerRe: Interface for Authorization Custom Inteface c# Winforms .net 4.0 Pin
Eddy Vluggen17-Feb-14 0:29
professionalEddy Vluggen17-Feb-14 0:29 
QuestionStrange bug when converting from binary to decimal.. Pin
Alex Reed16-Feb-14 9:54
Alex Reed16-Feb-14 9:54 
AnswerRe: Strange bug when converting from binary to decimal.. Pin
Richard Andrew x6416-Feb-14 11:25
professionalRichard Andrew x6416-Feb-14 11:25 
GeneralRe: Strange bug when converting from binary to decimal.. Pin
Alex Reed17-Feb-14 14:01
Alex Reed17-Feb-14 14:01 
AnswerRe: Strange bug when converting from binary to decimal.. Pin
Richard MacCutchan16-Feb-14 22:40
mveRichard MacCutchan16-Feb-14 22:40 
GeneralRe: Strange bug when converting from binary to decimal.. Pin
Richard Deeming17-Feb-14 1:54
mveRichard Deeming17-Feb-14 1:54 
GeneralRe: Strange bug when converting from binary to decimal.. Pin
Richard MacCutchan17-Feb-14 3:01
mveRichard MacCutchan17-Feb-14 3:01 
GeneralRe: Strange bug when converting from binary to decimal.. Pin
Alex Reed17-Feb-14 14:00
Alex Reed17-Feb-14 14:00 
GeneralRe: Strange bug when converting from binary to decimal.. Pin
Richard MacCutchan17-Feb-14 21:12
mveRichard MacCutchan17-Feb-14 21:12 
Questiontabcontrol OwnerDrawFixed right to left in c# Pin
Member 1059114816-Feb-14 1:39
Member 1059114816-Feb-14 1:39 
QuestionHow to Open form inside existing Tab Page Pin
Member 1059114816-Feb-14 1:36
Member 1059114816-Feb-14 1:36 
AnswerRe: How to Open form inside existing Tab Page Pin
Member 1059114816-Feb-14 8:33
Member 1059114816-Feb-14 8:33 
QuestionRe: How to Open form inside existing Tab Page Pin
Ravi Bhavnani17-Feb-14 7:54
professionalRavi Bhavnani17-Feb-14 7:54 
Questionhello sir... for com port setting for sms application in c# Pin
aawajaarughat15-Feb-14 23:18
professionalaawajaarughat15-Feb-14 23:18 
AnswerRe: hello sir... for com port setting for sms application in c# Pin
Kornfeld Eliyahu Peter15-Feb-14 23:31
professionalKornfeld Eliyahu Peter15-Feb-14 23:31 
AnswerRe: hello sir... for com port setting for sms application in c# Pin
OriginalGriff15-Feb-14 23:32
mveOriginalGriff15-Feb-14 23:32 
QuestionTrying to make a converter Pin
daddy35615-Feb-14 14:01
daddy35615-Feb-14 14:01 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.