コード例 #1
0
ファイル: FormLogin.cs プロジェクト: m12k/Files
        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;
            }
        }
コード例 #2
0
ファイル: UserControlListing.cs プロジェクト: m12k/Files
 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;
     }
 }
コード例 #3
0
ファイル: FormUsers.cs プロジェクト: m12k/Files
   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;
            }
        }
コード例 #4
0
ファイル: UserControlUsers.cs プロジェクト: m12k/Files
 private void Initialize()
 {
     try
     {              
         classUser = new ClassUsers(Global.ConnectionString);
         Validation = new Validation();
         Validation.Validate(this);
     }
     catch (Exception)
     {
         throw;
     }        
 }
コード例 #5
0
ファイル: UserControlButtonsMain.cs プロジェクト: m12k/Files
        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;
            }
        }
コード例 #6
0
ファイル: FormMain.cs プロジェクト: m12k/Files
    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;
        }
    }
コード例 #7
0
ファイル: FormMain.cs プロジェクト: m12k/Files
    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;
        }
    }