Ejemplo n.º 1
0
        private void AddGroup()
        {
            if (Settings.Instance.SelectedServer != -1)
            {
                InputTextDialog inputTextDialog       = new InputTextDialog("Add Group", "New groupname:");
                DialogResult    inputTextDialogResult = inputTextDialog.ShowDialog(this);
                string          newGroupName;
                if (inputTextDialogResult == DialogResult.Cancel)
                {
                    return;
                }
                newGroupName = inputTextDialog.UserText;
                inputTextDialog.Dispose();

                ReportGroup newGroup = new ReportGroup();
                newGroup.GroupName = newGroupName;
                Settings.Instance.ServerSettings.Server[Settings.Instance.SelectedServer].Groups.Add(newGroup);

                Lb_ReportGroups.Items.Add(newGroupName);
            }
            else
            {
                MessageBox.Show("Please add an select an server!");
            }
            CheckButtons();
        }
Ejemplo n.º 2
0
        private void Btn_Ok_Click(object sender, EventArgs e)
        {
            if (Txb_ServerIp.Text == string.Empty)
            {
                MessageBox.Show("Please insert a server address!", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            if (Txb_Username.Text == string.Empty)
            {
                MessageBox.Show("Please insert a username!", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            if (Mtxb_password.Text == string.Empty)
            {
                MessageBox.Show("Please insert a password hash!", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }

            using (GetVersionAndHashDialog getHashDialog = new GetVersionAndHashDialog(Txb_ServerIp.Text, Convert.ToUInt32(Nud_port.Value), Cbox_UseSsl.Checked, Txb_Username.Text, Mtxb_password.Text, true, true))
            {
                DialogResult hashDialogResult = getHashDialog.ShowDialog();
                if (hashDialogResult == DialogResult.OK)
                {
                    if (!IsInEditMode)
                    {
                        ServerSettings server = new ServerSettings();
                        server.Address     = Txb_ServerIp.Text;
                        server.Port        = Cbox_UseSsl.Checked ? 443 : (uint)Nud_port.Value;
                        server.UseSsl      = Cbox_UseSsl.Checked;
                        server.Username    = Txb_Username.Text;
                        server.Password    = Mtxb_password.Text;
                        server.DisplayName = Txb_DisplayName.Text;

                        ReportGroup newGroup = new ReportGroup();
                        newGroup.GroupName = "My Group";

                        Settings.Instance.ServerSettings.Server.Add(server);
                        Settings.Instance.ServerSettings.Server[Settings.Instance.ServerSettings.Server.Count - 1].Groups.Add(newGroup);
                    }
                    else
                    {
                        ServerSettings server = Settings.Instance.ServerSettings.Server[EditId];
                        server.Address     = Txb_ServerIp.Text;
                        server.Port        = Cbox_UseSsl.Checked ? 443 : (uint)Nud_port.Value;
                        server.UseSsl      = Cbox_UseSsl.Checked;
                        server.Username    = Txb_Username.Text;
                        server.Password    = Mtxb_password.Text;
                        server.DisplayName = Txb_DisplayName.Text;
                    }
                    Settings.Instance.SaveSettings();
                    this.DialogResult = DialogResult.OK;
                }
            }
        }
Ejemplo n.º 3
0
        private void Btn_Ok_Click(object sender, EventArgs e)
        {
            if (Txb_ServerIp.Text == string.Empty)
            {
                MessageBox.Show("Please insert a server address!", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            if (Txb_Username.Text == string.Empty)
            {
                MessageBox.Show("Please insert a username!", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            if (Mtxb_password.Text == string.Empty)
            {
                MessageBox.Show("Please insert a password hash!", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }

            using (GetVersionAndHashDialog getHashDialog = new GetVersionAndHashDialog(Txb_ServerIp.Text, Convert.ToUInt32(Nud_port.Value), Cbox_UseSsl.Checked, Txb_Username.Text, Mtxb_password.Text, true, true))
            {
                DialogResult hashDialogResult = getHashDialog.ShowDialog();
                if (hashDialogResult == DialogResult.OK)
                {
                    if (!IsInEditMode)
                    {
                        ServerSettings server = new ServerSettings();
                        server.Address = Txb_ServerIp.Text;
                        server.Port = Cbox_UseSsl.Checked ? 443 : (uint)Nud_port.Value;
                        server.UseSsl = Cbox_UseSsl.Checked;
                        server.Username = Txb_Username.Text;
                        server.Password = Mtxb_password.Text;
                        server.DisplayName = Txb_DisplayName.Text;

                        ReportGroup newGroup = new ReportGroup();
                        newGroup.GroupName = "My Group";
                    
                        Settings.Instance.ServerSettings.Server.Add(server);
                        Settings.Instance.ServerSettings.Server[Settings.Instance.ServerSettings.Server.Count-1].Groups.Add(newGroup);
                    }
                    else
                    {
                        ServerSettings server = Settings.Instance.ServerSettings.Server[EditId];
                        server.Address = Txb_ServerIp.Text;
                        server.Port = Cbox_UseSsl.Checked ? 443 : (uint)Nud_port.Value;
                        server.UseSsl = Cbox_UseSsl.Checked;
                        server.Username = Txb_Username.Text;
                        server.Password = Mtxb_password.Text;
                        server.DisplayName = Txb_DisplayName.Text;
                    }
                    Settings.Instance.SaveSettings();
                    this.DialogResult = DialogResult.OK;
                }
            }
        }
Ejemplo n.º 4
0
        private void AddGroup()
        {
            if (Settings.Instance.SelectedServer != -1)
            {
                InputTextDialog inputTextDialog = new InputTextDialog("Add Group", "New groupname:");
                DialogResult inputTextDialogResult = inputTextDialog.ShowDialog(this);
                string newGroupName;
                if (inputTextDialogResult == DialogResult.Cancel)
                {
                    return;
                }
                newGroupName = inputTextDialog.UserText;
                inputTextDialog.Dispose();

                ReportGroup newGroup = new ReportGroup();
                newGroup.GroupName = newGroupName;
                Settings.Instance.ServerSettings.Server[Settings.Instance.SelectedServer].Groups.Add(newGroup);

                Lb_ReportGroups.Items.Add(newGroupName);
            }
            else
            {
                MessageBox.Show("Please add an select an server!");
            }
            CheckButtons();
        }