Subversion Repositories Code-Repo

Rev

Rev 53 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 53 Rev 63
Line 7... Line 7...
7
using System.Text;
7
using System.Text;
8
using System.Windows.Forms;
8
using System.Windows.Forms;
9
 
9
 
10
namespace SWAT_Office_App
10
namespace SWAT_Office_App
11
{
11
{
12
    public partial class AddUserAccount_Form : Form
12
    public partial class Add_User_Account_Form : Form
13
    {
13
    {
14
        private static AddUserAccount_Form AddUserAccount_Instance = null;
14
        private static Add_User_Account_Form _Add_User_Account_Instance = null;
15
        // Modified singleton instance
15
        // Modified singleton instance
16
        public static AddUserAccount_Form Add_User_Account_Instance
16
        public static Add_User_Account_Form Add_User_Account_Instance
17
        {
17
        {
18
            get
18
            get
19
            {
19
            {
20
                AddUserAccount_Instance = new AddUserAccount_Form();
20
                _Add_User_Account_Instance = new Add_User_Account_Form();
21
                return AddUserAccount_Instance;
21
                return _Add_User_Account_Instance;
22
            }
22
            }
23
        }
23
        }
24
        public AddUserAccount_Form()
24
        public Add_User_Account_Form()
25
        {
25
        {
26
            InitializeComponent();
26
            InitializeComponent();
27
 
27
 
28
            resetForm();
28
            resetForm();
29
 
29
 
Line 64... Line 64...
64
        {
64
        {
65
            this.Close();
65
            this.Close();
66
        }
66
        }
67
        private void btn_Add_Click(object sender, EventArgs e)
67
        private void btn_Add_Click(object sender, EventArgs e)
68
        {
68
        {
69
            if (ManageUserAccounts.AddUser(txt_Username.Text, txt_Password.Text))
69
            if (Manage_User_Accounts.AddUser(txt_Username.Text, txt_Password.Text))
70
            {
70
            {
71
                if (this.chk_Share.Checked == true)
71
                if (this.chk_Share.Checked == true)
72
                    if (!ManageUserAccounts.CreateShareFolder(txt_Username.Text))
72
                    if (!Manage_User_Accounts.CreateShareFolder(txt_Username.Text))
73
                    {
73
                    {
74
                        DebugText.appendText("Error occured while creating shared folder");
74
                        Debug.appendText("Error occured while creating shared folder");
75
                        MessageBox.Show("Error occured when creating shared folder", "Error");
75
                        MessageBox.Show("Error occured when creating shared folder", "Error");
76
                    }
76
                    }
77
                this.Close();
77
                this.Close();
78
            }
78
            }
79
            else
79
            else
80
            {
80
            {
81
                DebugText.appendText("Error occured while creating new user account");
81
                Debug.appendText("Error occured while creating new user account");
82
                MessageBox.Show("Error occured when creating new user account","Error");
82
                MessageBox.Show("Error occured when creating new user account","Error");
83
                resetForm();
83
                resetForm();
84
            }
84
            }
85
        }
85
        }
86
    }
86
    }