Exemplo n.º 1
0
 public static UserDA getInstance()
 {
     if (instance == null)
     {
         instance = new UserDA();
     }
     return(instance);
 }
Exemplo n.º 2
0
        public bool create()
        {
            bool userSuccess = UserDA.getInstance().addToDatabase(this);

            Security.Secure userSensitive = new Security.Secure();
            userSensitive.Username = this.userName;
            userSensitive.Password = Security.Cryptography.Encrypt("1234");
            bool secureSuccess = Security.SecureDA.getInstance().addToDatabase(userSensitive);

            return(userSuccess && secureSuccess);
        }
Exemplo n.º 3
0
        public void viewUserData(string userName)
        {
            modelUser = UserDA.getInstance().readFromDatabase(userName);

            if (modelUser != null)
            {
                viewUser.UserName.Text = modelUser.UserName;
                viewUser.RealName.Text = modelUser.Name;
                viewUser.UserPermissions.SelectedIndex = modelUser.Permissions;
                viewUser.UserRating.Text         = modelUser.UserRating;
                viewUser.UserPredecessor.Text    = modelUser.Predecessor;
                viewUser.UserMonthlyRevenue.Text = modelUser.MonthlyRevnue.ToString();
                viewUser.UserNotes.Text          = modelUser.Notes;
            }
            else
            {
                //MessageBox.Show("No User with ID " + this.selectedUserName);
                //this.Close();
            }
        }
Exemplo n.º 4
0
        //Chamil

        public string[] getSuccesors()
        {
            return(UserDA.getInstance().getSuccesors((Security.Permissions) this.permissions, this.userName));
        }
Exemplo n.º 5
0
 //Chamil
 public List <String> getPredecessorList()
 {
     return(UserDA.getInstance().getPredecessorList(permissions));
 }
Exemplo n.º 6
0
 public bool update()
 {
     return(UserDA.getInstance().updateToDatabase(this));
 }
Exemplo n.º 7
0
 //chamil
 public List <string> getPredecessors()
 {
     return(UserDA.getInstance().getPredecessorList(viewUser.UserPermissions.SelectedIndex));
 }