コード例 #1
0
ファイル: LoginForm.cs プロジェクト: gunmm/TTCarProject
        private void login()
        {
            if (usernameComboBox.Text.Length == 0)
            {
                MessageBox.Show("用户名不能为空!");
                return;
            }

            if (passwordTextBox.Text.Length == 0)
            {
                MessageBox.Show("密码不能为空!");
                return;
            }


            Dictionary <string, object> param = new Dictionary <string, object>();

            param.Add("tel", usernameComboBox.Text);
            param.Add("password", HttpHelper.GetMD5(passwordTextBox.Text));
            Thread threadStatus2 = new Thread(new ParameterizedThreadStart(beginLoad));

            threadStatus2.Start(param);

            formLoading = new FormLoading2();
            formLoading.StartPosition   = FormStartPosition.CenterScreen;
            formLoading.FormBorderStyle = FormBorderStyle.None;
            formLoading.StartWaiting();
            formLoading.ShowDialog();
        }
コード例 #2
0
        private void confirmButton_Click(object sender, EventArgs e)
        {
            if (carnumberTextBox.Text.Length == 0)
            {
                MessageBox.Show("车牌号不能为空!");
                return;
            }

            if (driverNameTextBox.Text.Length == 0)
            {
                MessageBox.Show("司机姓名不能为空!");
                return;
            }

            if (driverPhonetextBox.Text.Length == 0)
            {
                MessageBox.Show("司机电话不能为空!");
                return;
            }

            Dictionary <string, object> param = new Dictionary <string, object>();

            param.Add("appointMan", managerTextBox.Text);
            param.Add("appointType", (typeComboBox.SelectedIndex + 1).ToString());
            param.Add("beginTime", beginDateTimePicker.Value.ToString().Replace("/", "-"));
            param.Add("endTime", endDateTimePicker.Value.ToString().Replace("/", "-"));
            param.Add("appointPlatnumber", carnumberTextBox.Text);
            param.Add("driverName", driverNameTextBox.Text);
            param.Add("driverPhone", driverPhonetextBox.Text);
            param.Add("appointReason", reasonRichTextBox.Text);
            Thread threadStatus2 = new Thread(new ParameterizedThreadStart(beginLoad));

            threadStatus2.Start(param);

            formLoading = new FormLoading2();
            formLoading.StartPosition   = FormStartPosition.CenterScreen;
            formLoading.FormBorderStyle = FormBorderStyle.None;
            formLoading.StartWaiting();
            formLoading.ShowDialog();


            //string serverIp = ConfigurationManager.AppSettings["serverIp"].ToString();


            //string strURL = serverIp + "/mobile/subscribeAdd";

            //Dictionary<string, object> param = new Dictionary<string, object>();
            //param.Add("appointMan", managerTextBox.Text);
            //param.Add("appointType", (typeComboBox.SelectedIndex + 1).ToString());
            //param.Add("beginTime", beginDateTimePicker.Value.ToString().Replace("/","-"));
            //param.Add("endTime", endDateTimePicker.Value.ToString().Replace("/", "-"));
            //param.Add("appointPlatnumber", carnumberTextBox.Text);
            //param.Add("driverName", driverNameTextBox.Text);
            //param.Add("driverPhone", driverPhonetextBox.Text);
            //param.Add("appointReason",reasonRichTextBox.Text);
            //string str = HttpHelper.HttpPost(strURL, param);
            //if (str.Length == 0)
            //{
            //    MessageBox.Show("系统异常,请稍后重试!");
            //}
            //else if (str == "accessToken")
            //{
            //    LoginForm loginForm = new LoginForm();
            //    loginForm.StartPosition = FormStartPosition.CenterScreen;
            //    loginForm.ShowDialog();
            //}
            //else
            //{
            //    JObject jsonObj = JObject.Parse(str);
            //    string body = jsonObj["body"].ToString();
            //    string head = jsonObj["head"].ToString();
            //    HeaderModel headerModel = new HeaderModel();
            //    headerModel = (HeaderModel)HttpHelper.JsonToObject(head, headerModel);
            //    if (Convert.ToInt16(headerModel.rspCode) == 0)
            //    {
            //        MessageBox.Show("预约成功!");
            //        this.Close();
            //    }
            //    else
            //    {
            //        MessageBox.Show(headerModel.rspMsg);
            //    }
            //}
        }