Exemplo n.º 1
0
        private void button1_Click(object sender, EventArgs e)
        {
            String UserID = textBoxUserName.Text;

            labelMessage.Text       = "";
            labelMessage2.Text      = "";
            labelMessage.Visible    = true;
            labelMessage2.Visible   = true;
            labelMessage.ForeColor  = Color.White;
            labelMessage2.ForeColor = Color.White;
            String    KeyData    = " @APPKEY = '" + parthKEY + "', @UserNumber = '" + UserID + "' , @UserPass = '******'";
            config    callServer = new config();
            DataTable dt         = callServer.dialogServerInsert("LOGIN_APPLICATION", KeyData);
            DataRow   dr         = dt.Rows[0];

            if (dr["SUCESS"].ToString() == "1")
            {
                try
                {
                    this.Hide();
                    this.Visible = false;
                    DialogMainForm MainForm = new DialogMainForm(Int32.Parse(dr["USER_LOGIN_APP_NUMBER"].ToString()), Int32.Parse(dr["USER_OWN_LOGIN_APP_NUMBER"].ToString()), dr["USER_LOGIN_ID"].ToString(), dr["USER_NUMBER"].ToString());
                    MainForm.Show();
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.ToString());
                }
            }
            else
            {
                labelMessage.Text  = dr["MESAGE"].ToString();
                labelMessage2.Text = dr["MESAGE2"].ToString();
            }
        }
Exemplo n.º 2
0
        private void button1_Click(object sender, EventArgs e)
        {
            //Application.Run(new DialogMainForm());
            //this.Close();
            //Application.Run(new DialogMainForm());
            this.Visible = false;
            DialogMainForm MainForm = new DialogMainForm();

            MainForm.Show();
        }
Exemplo n.º 3
0
        private void button1_Click(object sender, EventArgs e)
        {
            String UserID = textBoxUserName.Text;

            labelMessage.Text       = "";
            labelMessage2.Text      = "";
            labelMessage.Visible    = true;
            labelMessage2.Visible   = true;
            labelMessage.ForeColor  = Color.White;
            labelMessage2.ForeColor = Color.White;
            String KeyData = "@UserID = '" + UserID + "' , @UserPass = '******' , @ProKey = '" + parthKEY + "'";

            config    callServer = new config();
            DataTable dt         = callServer.dialogServerInsert("CREATE_APPLICATION_KEY", KeyData);

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                DataRow dr = dt.Rows[i];
                if (dr["SUCESS"].ToString() == "1")
                {
                    try
                    {
                        this.Hide();
                        this.Visible = false;
                        DialogMainForm MainForm = new DialogMainForm(parthKEY, UserID);
                        MainForm.Show();
                    }
                    catch (Exception ex)
                    {
                        MessageBox.Show(ex.ToString());
                    }
                }
                else
                {
                    labelMessage.Text  = dr["MESAGE"].ToString();
                    labelMessage2.Text = dr["MESAGE2"].ToString();
                }
            }
        }