Example #1
0
        private void Initialize()
        {
            try
            {
                classUser = new ClassUsers(Global.ConnectionString);
                 
                string value;
                value = System.Configuration.ConfigurationManager.AppSettings["RememberMe"];


                if (value != null)
                {
                    checkBoxRememberMe.Checked = Convert.ToBoolean(value);
                    textBoxUserName.Text = System.Configuration.ConfigurationManager.AppSettings["UserName"];
                    textBoxPassword.Focus();
                }
            }
            catch (Exception)
            {
                throw;
            }
        }
Example #2
0
 private void SetAccessRights()
 {
     try
     { 
          
         using (var classUser = new ClassUsers(Global.ConnectionString))
         {
             var result = classUser.GetAccessRights(Global.UserId, _Module);
          
             CanEdit = result.CanEdit.Value; 
         }  
     }
     catch (Exception)
     {
         throw;
     }
 }
Example #3
0
   private void Initialize()
        {
            try
            {
                classUser = new ClassUsers(Global.ConnectionString);
                Validation = new Validation();
                Validation.Validate(this);

                if (Operation == Global.Operation.UPDATE || Operation == Global.Operation.VIEW)
                {
                    GetUserDetailsResult result = classUser.GetUserDetails(UserId);

                    textBoxID.Text = UserId;
                    textBoxLastName.Text = result.LastName;
                    textBoxFirstName.Text = result.FirstName;
                    textBoxMI.Text = result.MiddleName;
                    textBoxUserName.Text = result.UserName;
                    textBoxUserName.Tag = result.UserName;
                    textBoxPassword.Text = result.Password;
                    textBoxRetypePassword.Text = result.Password;

                    LoadProjects();
                    LoadGroups();


                    if (Operation == Global.Operation.VIEW)
                    {
                        userControlButtonsSave.Visible = false;
                        Lock();
                    }
                }

                textBoxLastName.Focus();

            }
            catch (Exception)
            {
                throw;
            }
        }
Example #4
0
 private void Initialize()
 {
     try
     {              
         classUser = new ClassUsers(Global.ConnectionString);
         Validation = new Validation();
         Validation.Validate(this);
     }
     catch (Exception)
     {
         throw;
     }        
 }
Example #5
0
        private void SetAccessRights()
        {
            try
            {
                classUser = new ClassUsers(Global.ConnectionString);

                var result = classUser.GetAccessRights(Global.UserId, _Module);

                canView = result.CanView.Value;
                canAdd = result.CanAdd.Value;
                canEdit = result.CanEdit.Value;
                canDelete = result.CanDelete.Value;

            }
            catch (Exception)
            {
                throw;
            }
        }
Example #6
0
    private void LoadProject()
    {
        try
        {
            ClassUsers classUser = new ClassUsers(Global.ConnectionString);

            var result = from s in classUser.GetUserProjects(Global.UserId)
                         orderby s.Name
                         select s;


            comboBoxProject.DataSource = result.ToList();
            comboBoxProject.DisplayMember = "Name";
            comboBoxProject.ValueMember = "Id";
            if (comboBoxProject.Items.Count > 0) comboBoxProject.SelectedIndex = 0;
            else buttonConnect.Enabled = false;

        }
        catch (Exception)
        {
            throw;
        }
    }
Example #7
0
    private void Initialize()
    {
        try
        {
            classUser = new ClassUsers(Global.ConnectionString);
            Validation = new Validation();
            timerConnected = new Timer();
            timerConnected.Tick += new EventHandler(TimerConnected_Ticks);
            
            Validation.Validate(this);
            toolStripStatusLabelUserName.Text = "User: "******"Refresh Database List");
            toolTipMain.SetToolTip(buttonConnect, "Connect to Database");

            SetAccessRights();

            StringBuilder sb = new StringBuilder();
            Text = sb.Append(Text).Append(" ").Append(Application.ProductVersion).ToString();          
        }
        catch (Exception)
        {
            throw;
        }
    }