Example #1
0
        private void call_UserData(string username, string password)
        {
            userinforeq = fllg_req.Utility.Create(username, password);
            RequestMessage searchrequest = new RequestMessage(enumRequestType.MessageProcessor,
                enumMessageType.Utility,
                enumRequestMethod.functionOperation, this._user,
                enumSendSysId.EXceed,
                userinforeq);
            RequestWorkItem workitem = new RequestWorkItem(searchrequest, 1);
            //threadhelper.AddWorkItem(workitem);
            ResponseMessage Response = ThreadHelper.Execute(searchrequest);
            if (Response.GetErrorMessage() != string.Empty)
            {
                MessageBox.Show(Response.GetErrorMessage());
                this.usernametxt.Focus();
            }
            else
            {
                this.userinfores = Response.Deserialize<fllg_res.Utility>();
                if (this._user.UserName == string.Empty)
                {
                    MessageBox.Show("用户名不存在");
                    this.usernametxt.Focus();
                }
                else
                {
                    this.screen = this.userinfores.UtilityHeader[0].Screen.Split(new char[] { ';' });
                    //InvokeHelper.Set(this, "DialogResult", DialogResult.OK);
                    DialogResult = DialogResult.OK;

                }
            }
        }
Example #2
0
        void threadhelper_WorkItemCompleted(object sender, WorkItemEventArgs e)
        {
            int tag = e.WorkItem.Tag;
            WorkItem item = e.WorkItem;
            if (item.Response.GetErrorMessage() != string.Empty)
            {
                MessageBox.Show(item.Response.GetErrorMessage());
                return;
            }
            if (tag == 1)
            {

                this.userinfores = e.WorkItem.Response.Deserialize<fllg_res.Utility>();

                //this.userinforeq.UtilityHeader.userid = userinfores.UtilityHeader.

                if (this._user.UserName == string.Empty)
                {
                    MessageBox.Show("用户名不存在");
                    InvokeHelper.Invoke(this.usernametxt, "Focus", null);
                }
                else
                {
                    this.screen = this.userinfores.UtilityHeader[0].Screen.Split(new char[]{';'});
                    InvokeHelper.Set(this, "DialogResult", DialogResult.OK);
                    //DialogResult = DialogResult.OK;

                }

            }
        }