Ejemplo n.º 1
0
        private void M_ServiceController_CreateLicenceKeyEvent(object sender, EventArgs e)
        {
            this.Invoke(new MethodInvoker(delegate()
            {
                if (e != null)
                {
                    string content = sender.ToString();
                    BaseResultInfo <string> result = JsonHelper.JSONToObject <BaseResultInfo <string> >(content);

                    if (result.status == 10000)
                    {
                        this.DialogResult = DialogResult.OK;
                        this.Close();
                    }
                    else
                    {
                        MessageBox.Show(this, result.msg, "提示");
                    }
                }
                else
                {
                    MessageBox.Show(this, sender.ToString(), "提示");
                }
            }));
        }
Ejemplo n.º 2
0
        private void m_UserController_AddEvent(object sender, ServiceEventArgs e)
        {
            this.Invoke(new MethodInvoker(delegate()
            {
                if (e != null)
                {
                    string content = e.Content;

                    try
                    {
                        BaseResultInfo <string> result = JsonHelper.JSONToObject <BaseResultInfo <string> >(content);

                        if (result.status == 10000)
                        {
                            this.DialogResult = System.Windows.Forms.DialogResult.OK;
                            this.Close();
                        }
                        else
                        {
                            MessageBox.Show(this, result.msg, "提示");
                        }
                    }
                    catch (Exception ex)
                    {
                        MessageBox.Show(this, ex.Message, "提示");
                    }
                }
                else
                {
                    MessageBox.Show(this, sender.ToString(), "提示");
                }
            }));
        }
        private void m_LicenseController_DeleteEvent(object sender, ServiceEventArgs e)
        {
            if (IsDisposed || !this.IsHandleCreated)
            {
                return;
            }

            this.Invoke(new MethodInvoker(delegate()
            {
                if (e != null)
                {
                    string content = e.Content;

                    try
                    {
                        BaseResultInfo <object> result = JsonHelper.JSONToObject <BaseResultInfo <object> >(content);
                        if (this.current_AreaCode != null && result.status == 10000)
                        {
                            string pac = this.current_AreaCode.code;
                            this.m_LicenseController.Get(pac, 1000, 0);
                        }
                        else
                        {
                            MessageBox.Show(result.msg, "信息提示");
                        }
                    }
                    catch (Exception ex)
                    {
                        MessageBox.Show(ex.Message, "信息提示");
                    }
                }
                else
                {
                    MessageBox.Show(sender.ToString(), "删除许可出错", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }));
        }
Ejemplo n.º 4
0
        private void LoginController_LoginEvent(object sender, EventArgs e)
        {
            if (IsDisposed || !this.IsHandleCreated)
            {
                return;
            }

            this.Invoke(new MethodInvoker(delegate()
            {
                if (e != null)
                {
                    string content = sender.ToString();

                    BaseResultInfo <UserInfo> result = JsonHelper.JSONToObject <BaseResultInfo <UserInfo> >(content);

                    if (result != null)
                    {
                        if (result.status == 10000)
                        {
                            UserInfo user = result.obj;

                            GlobeHelper.Instance.User = user;

                            this.DialogResult = System.Windows.Forms.DialogResult.OK;
                        }
                        else
                        {
                            MessageBox.Show(result.msg, "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        }
                    }
                }
                else
                {
                    MessageBox.Show(this, sender.ToString() + "\r\n" + AppConfigHelper.GetAppConfig("Ip") + ":" + AppConfigHelper.GetAppConfig("Port"));
                }
            }));
        }