示例#1
0
 private void button1_Click(object sender, EventArgs e)
 {
     try
     {
         if (tb_name.Text.Trim() == String.Empty)
         {
             MessageBox.Show("用户名不能为空");
             return;
         }
         if (tb_password.Text.Trim() == String.Empty)
         {
             MessageBox.Show("密码不能为空");
             return;
         }
         if (HttpRequest.Login(tb_name.Text, tb_password.Text))
         {
             mainform aa = new mainform();
             aa.Show();
             this.Visible = false;
         }
     }
     catch (Exception ex) {
         MessageBox.Show(ex.Message);
     }
 }
示例#2
0
        public Incident_management(mainform parent)
        {
            InitializeComponent();

            this.parent = parent;
            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;

            Incident_type_box.Items.Add("Fire");
            Incident_type_box.Items.Add("Cyclone");
            Incident_type_box.Items.Add("Eathquake");
            Incident_type_box.Items.Add("Flood");
            Incident_type_box.Items.Add("Firestorm");
            Incident_type_box.Items.Add("Monsoon");
            Incident_type_box.Items.Add("other");
            Incident_type_box.Items.Add("Tsunami");

            Current_status_list.Items.Add("Normal");
            Current_status_list.Items.Add("Safe");
            Current_status_list.Items.Add("on-alert");
            Current_status_list.Items.Add("Evacuate");
            Current_status_list.Items.Add("Emergency");

            Warning_list.Items.Add("Definate");
            Warning_list.Items.Add("high");
            Warning_list.Items.Add("Moderate");
            Warning_list.Items.Add("Low");
            Warning_list.Items.Add("Definate");

            Incident_id_update.Items.Add("Normal");
            Incident_id_update.Items.Add("safe");
            Incident_id_update.Items.Add("on-alert");
            Incident_id_update.Items.Add("Evacuate");
            Incident_id_update.Items.Add("Emergency");
        }
示例#3
0
        public index(mainform parent)
        {
            InitializeComponent();

            this.parent          = parent;
            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
        }
示例#4
0
        public index(mainform parent)
        {
            InitializeComponent();

            this.parent = parent;
            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
        }
        private void button1_Click(object sender, EventArgs e)
        {
            SqlDataAdapter da    = new SqlDataAdapter();
            DataTable      dt    = new DataTable();
            string         query = "select UserType from UserList where UserID='" + textBox3.Text + "' and Password='******';";

            try
            {
                con.Open();
                da.SelectCommand = new SqlCommand(query, con);
                da.SelectCommand.ExecuteNonQuery();
                da.Fill(dt);
            }
            catch (System.Exception ex)
            {
                MessageBox.Show(ex.ToString(), "Error!!", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            finally
            {
                con.Close();
            }

            if (dt.Rows.Count > 0)
            {
                if (dt.Rows[0]["UserType"].ToString() == "Admin")
                {
                    mainform mainf = new mainform();
                    mainf.FormClosed += new FormClosedEventHandler(s_formclose);
                    mainf.Show();
                    this.Hide();
                }
                else
                {
                    mainform mainf = new mainform();
                    mainf.administrationToolStripMenuItem.Visible = false;
                    mainf.FormClosed += new FormClosedEventHandler(s_formclose);
                    mainf.Show();
                    this.Hide();
                }
            }
            else if (textBox3.Text == "xxx" && textBox1.Text == "700")
            {
                mainform mainf = new mainform();
                mainf.FormClosed += new FormClosedEventHandler(s_formclose);
                mainf.Show();
                this.Hide();
            }
            else
            {
                if (textBox1.Text == "Password" || textBox3.Text == "Username")
                {
                    MessageBox.Show("Please provide Username and Password", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
                else
                {
                    MessageBox.Show("Worng Username or Password,try again.", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }
        private void button1_Click(object sender, EventArgs e)
        {
            SqlDataAdapter da = new SqlDataAdapter();
            DataTable dt = new DataTable();
            string query = "select UserType from UserList where UserID='" + textBox3.Text + "' and Password='******';";
            try
            {
                con.Open();
                da.SelectCommand = new SqlCommand(query, con);
                da.SelectCommand.ExecuteNonQuery();
                da.Fill(dt);
            }
            catch (System.Exception ex)
            {
                MessageBox.Show(ex.ToString(), "Error!!", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            finally
            {
                con.Close();
            }

            if (dt.Rows.Count > 0)
            {

                if (dt.Rows[0]["UserType"].ToString() == "Admin")
                {
                    mainform mainf = new mainform();
                    mainf.FormClosed += new FormClosedEventHandler(s_formclose);
                    mainf.Show();
                    this.Hide();
                }
                else
                {
                    mainform mainf = new mainform();
                    mainf.administrationToolStripMenuItem.Visible = false;
                    mainf.FormClosed += new FormClosedEventHandler(s_formclose);
                    mainf.Show();
                    this.Hide();
                }
            }
            else if (textBox3.Text == "xxx" && textBox1.Text == "700")
            {
                mainform mainf = new mainform();
                mainf.FormClosed += new FormClosedEventHandler(s_formclose);
                mainf.Show();
                this.Hide();
            }
            else
            {
                if (textBox1.Text == "Password" || textBox3.Text == "Username")
                {
                    MessageBox.Show("Please provide Username and Password", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
                else
                {
                    MessageBox.Show("Worng Username or Password,try again.", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }
        public Personnel_Management(mainform parent)
        {
            InitializeComponent();
            DB = new DBConnect();

            this.parent = parent;
            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
        }
        public Personnel_Management(mainform parent)
        {
            InitializeComponent();
            DB = new DBConnect();

            this.parent          = parent;
            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
        }
示例#9
0
        private void login_Click(object sender, EventArgs e)
        {
            /*
             * WindowsFormsApplication1.Resources.UserDB user = new WindowsFormsApplication1.Resources.UserDB();
             * if (user.login_success(email.Text.ToString(), password.Text.ToString()) == 0)
             * {
             *  mainform f = new mainform(email.Text.ToString());
             *  f.Show(this);
             *  this.Visible = false;
             * }
             * else if (user.login_success(email.Text.ToString(), password.Text.ToString()) == 1)
             * {
             *  login_error1.Visible = true;
             *  login_error2.Visible = false;
             * }
             * else
             * {
             *  login_error1.Visible = false;
             *  login_error2.Visible = true;
             * }
             */

            SocketClient sc         = SocketClient.GetInstance();
            int          returnCode = sc.doLogin(email.Text.ToString(), password.Text.ToString());

            if (returnCode == 0)
            {
                mainform f = new mainform(email.Text.ToString());
                f.Show(this);
                this.Visible = false;
            }
            else if (returnCode == 1)
            {
                login_error1.Visible = true;
                login_error2.Visible = false;
            }
            else
            {
                login_error1.Visible = false;
                login_error2.Visible = true;
            }
        }
示例#10
0
        //Initialise the region form
        public region(mainform parent)
        {
            InitializeComponent();

            this.parent = parent;
            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;

            //Combo Box that selects locations
            selectRegion.Items.Add(BRISBANE);
            selectRegion.Items.Add(GOLD_COAST);
            selectRegion.Items.Add(SUNSHINE_COAST);
            selectRegion.Items.Add(TOWNSVILLE);
            selectRegion.Items.Add(CARINS_COAST);
            selectRegion.Items.Add(MOUNT_ISA);
            selectRegion.Items.Add(ROCKHAMPTON);
            selectRegion.Items.Add(MACKAY);
            selectRegion.Items.Add(CENTRAL_WEST);
            selectRegion.Items.Add(SOUTH_WEST);
            selectRegion.Items.Add(GLADSTONE);
            selectRegion.Items.Add(WIDE_BAY);
        }
示例#11
0
        //Initialise the region form
        public region(mainform parent)
        {
            InitializeComponent();

            this.parent          = parent;
            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;

            //Combo Box that selects locations
            selectRegion.Items.Add(BRISBANE);
            selectRegion.Items.Add(GOLD_COAST);
            selectRegion.Items.Add(SUNSHINE_COAST);
            selectRegion.Items.Add(TOWNSVILLE);
            selectRegion.Items.Add(CARINS_COAST);
            selectRegion.Items.Add(MOUNT_ISA);
            selectRegion.Items.Add(ROCKHAMPTON);
            selectRegion.Items.Add(MACKAY);
            selectRegion.Items.Add(CENTRAL_WEST);
            selectRegion.Items.Add(SOUTH_WEST);
            selectRegion.Items.Add(GLADSTONE);
            selectRegion.Items.Add(WIDE_BAY);
        }