コード例 #1
0
ファイル: LoginForm.cs プロジェクト: WereDouglas/Casepro
        private void button3_Click(object sender, EventArgs e)
        {
            //   string query = @"CREATE TABLE first (" + a.Columns[0] + " int(20) NOT NULL auto_increment, " + a.Columns[1].ToString() + " varchar(100) NOT NULL default, PRIMARY KEY (" + a.Columns[0] + ")";
            ////   string Query = "INSERT INTO users(userID, orgID, name, email, password, designation, status, contact, image, address, category, created, sync, charge, supervisor) VALUES ('" + userID + "','" + Helper.orgID + "','" + this.nameTxtBx.Text + "','" + this.emailTxtBx.Text + "','" + Helper.MD5Hash(this.passwordTxtBx.Text) + "','" + this.designationCbx.Text + "','" + this.statusCbx.Text + "','" + this.contactTxtBx.Text + "','" + userID.Trim() + ".jpg" + "','" + this.addressTxtBx.Text + "','staff','" + DateTime.Now.Date.ToString("yyyy-MM-dd") + "','f','" + this.chargeTxtBx.Text + "','" + supervisorCbx.Text + "');";
            //   Helper.Execute(query, DBConnect.conn);
            //   MessageBox.Show("Information saved");

            ServerForm frm = new ServerForm();

            frm.Show();
            this.Hide();
        }
コード例 #2
0
ファイル: MainForm.cs プロジェクト: WereDouglas/Casepro
 private void LoadSettings()
 {
     // MessageBox.Show(Helper.serverIP);
     if (TestServerConnection())
     {
         lblStatus.Text      = lblStatus.Text + (" You are connected to the local server ");
         lblStatus.ForeColor = Color.Green;
         StartForm frms = new StartForm();
         frms.MdiParent = this;
         frms.Dock      = DockStyle.Fill;
         frms.Show();
     }
     else
     {
         ServerForm frm = new ServerForm();
         frm.Show();
         lblStatus.Text      = lblStatus.Text + (" You are not able to connect to the local server");
         lblStatus.ForeColor = Color.Red;
     }
     if (Helper.IsInternetAvailable())
     {
         //    if (TestOnlineServerConnection())
         //    {
         //        onlineLbl.Text = ("You are connected to the online server ");
         //        onlineLbl.ForeColor = Color.Green;
         //        StartForm frms = new StartForm();
         //        frms.MdiParent = this;
         //        frms.Dock = DockStyle.Fill;
         //        frms.Show();
         //    }
         //    else
         //    {
         //        ServerForm frm = new ServerForm();
         //        frm.Show();
         //        onlineLbl.Text = onlineLbl.Text + (" You are not able to connect to the online server");
         //        onlineLbl.ForeColor = Color.Red;
         //    }
         onlineLbl.Text      = onlineLbl.Text + (" Internet connect active");
         onlineLbl.ForeColor = Color.Green;
     }
     else
     {
         onlineLbl.Text      = onlineLbl.Text + (" No internet connection");
         onlineLbl.ForeColor = Color.Red;
     }
 }
コード例 #3
0
ファイル: LoginForm.cs プロジェクト: WereDouglas/Casepro
        private void LoadSettings()
        {
            try
            {
                XDocument xmlDoc  = XDocument.Load("LocalXMLFile.xml");
                var       servers = from person in xmlDoc.Descendants("Server")
                                    select new
                {
                    Name       = person.Element("Name").Value,
                    Ip         = person.Element("Ip").Value,
                    Port       = person.Element("Port").Value,
                    db         = person.Element("db").Value,
                    dbusername = person.Element("username").Value,
                    dbpwd      = person.Element("password").Value,
                };

                foreach (var server in servers)
                {
                    Helper.serverName = server.Name;
                    if (IPAddressCheck(Helper.serverName) != "")
                    {
                        Helper.serverIP = IPAddressCheck(Helper.serverName);
                        lblStatus.Text  = lblStatus.Text + IPAddressCheck(Helper.serverName);
                        IP = IPAddressCheck(Helper.serverName);
                    }
                    else
                    {
                        MessageBox.Show("Please start the server");
                        //return;
                    }
                    Helper.port       = server.Port;
                    Helper.db         = server.db;
                    Helper.dbusername = server.dbusername;
                    Helper.dbpwd      = server.dbpwd;

                    Helper.fileUrl         = "http://" + Helper.serverIP + "/caseprofessionals/files/";
                    Helper.imageUrl        = "http://" + Helper.serverIP + "/caseprofessionals/uploads/";
                    Helper.uploadUrl       = "http://" + Helper.serverIP + "/caseprofessionals/uploads/uploads.php";
                    Helper.RemoteUploadUrl = "http://caseprofessional.org/uploads/uploads.php";
                    Helper.msgUrl          = "http://" + Helper.serverIP + "/caseprofessionals/index.php/message/event";
                }
                // MessageBox.Show(Helper.serverIP);
                if (TestServerConnection())
                {
                    lblStatus.Text      = lblStatus.Text + (" Server connected you can continue to login");
                    lblStatus.ForeColor = Color.Green;
                }
                else
                {
                    //ServerForm frm = new ServerForm();
                    //frm.Show();
                    //this.Hide();

                    lblStatus.Text      = ("You are not able to connect to the server contact the administrator for further assistance");
                    lblStatus.ForeColor = Color.Red;
                }
            }
            catch
            {
                ServerForm frm = new ServerForm();
                frm.Show();
                this.Hide();
            }
        }
コード例 #4
0
ファイル: MainForm.cs プロジェクト: WereDouglas/Casepro
        private void settingToolStripMenuItem_Click(object sender, EventArgs e)
        {
            ServerForm frm = new ServerForm();

            frm.Show();
        }