Example #1
0
        private void cbolanguage_SelectedIndexChanged(object sender, System.EventArgs e)
        {
            int selectedIndex = this.cbolanguage.SelectedIndex;

            EcoLanguage.ChangeLang(selectedIndex);
            System.Resources.ResourceManager resourceManager = new System.Resources.ResourceManager(base.GetType());
            this.Text           = resourceManager.GetString("$this.Text");
            this.label8.Text    = resourceManager.GetString("label8.Text");
            this.label7.Text    = resourceManager.GetString("label7.Text");
            this.label6.Text    = resourceManager.GetString("label6.Text");
            this.butlogin.Text  = resourceManager.GetString("butlogin.Text");
            this.butcancel.Text = resourceManager.GetString("butcancel.Text");
        }
Example #2
0
        private void rmtcbLang_SelectedIndexChanged(object sender, System.EventArgs e)
        {
            int selectedIndex = this.rmtcbLang.SelectedIndex;

            EcoLanguage.ChangeLang(selectedIndex);
            System.Resources.ResourceManager resourceManager = new System.Resources.ResourceManager(base.GetType());
            this.Text              = resourceManager.GetString("$this.Text");
            this.rmtlbSrvIP.Text   = resourceManager.GetString("rmtlbSrvIP.Text");
            this.rmtlbSrvPort.Text = resourceManager.GetString("rmtlbSrvPort.Text");
            this.rmtlbusrnm.Text   = resourceManager.GetString("label8.Text");
            this.rmtlbpsw.Text     = resourceManager.GetString("label7.Text");
            this.rmtlbLang.Text    = resourceManager.GetString("label6.Text");
            this.rmtbutLogin.Text  = resourceManager.GetString("butlogin.Text");
            this.rmtbutcancel.Text = resourceManager.GetString("butcancel.Text");
        }
Example #3
0
        private void rmtbutLogin_Click(object sender, System.EventArgs e)
        {
            bool flag = false;

            this.m_forceClose = 0;
            try
            {
                Ecovalidate.checkTextIsNull(this.rmttbSrvIP, ref flag);
                if (flag)
                {
                    EcoMessageBox.ShowError(EcoLanguage.getMsg(LangRes.Required, new string[]
                    {
                        this.rmtlbSrvIP.Text
                    }));
                }
                else
                {
                    try
                    {
                        string text = IPAddress.Parse(this.rmttbSrvIP.Text).ToString();
                        this.rmttbSrvIP.Text = text;
                    }
                    catch (System.Exception)
                    {
                        EcoMessageBox.ShowError(EcoLanguage.getMsg(LangRes.IPFORMAT, new string[0]));
                        this.rmttbSrvIP.Focus();
                        return;
                    }
                    Ecovalidate.checkTextIsNull(this.rmttbSrvPort, ref flag);
                    if (flag)
                    {
                        EcoMessageBox.ShowError(EcoLanguage.getMsg(LangRes.Required, new string[]
                        {
                            this.rmtlbSrvPort.Text
                        }));
                    }
                    else
                    {
                        if (!Ecovalidate.Rangeint(this.rmttbSrvPort, 1, 65535))
                        {
                            EcoMessageBox.ShowError(EcoLanguage.getMsg(LangRes.Range, new string[]
                            {
                                this.rmtlbSrvPort.Text,
                                "1",
                                "65535"
                            }));
                        }
                        else
                        {
                            if (this.rmttbusrnm.Text == "")
                            {
                                EcoMessageBox.ShowError(EcoLanguage.getMsg(LangRes.Login_needname, new string[0]));
                                this.rmttbusrnm.Focus();
                            }
                            else
                            {
                                if (this.rmttbpsw.Text == "")
                                {
                                    EcoMessageBox.ShowError(EcoLanguage.getMsg(LangRes.Login_needpsw, new string[0]));
                                    this.rmttbpsw.Focus();
                                }
                                else
                                {
                                    ValuePairs.setValuePair("MasterIP", this.rmttbSrvIP.Text);
                                    string text2 = this.rmttbSrvPort.Text;
                                    ValuePairs.setValuePair("ServicePort", text2);
                                    ValuePairs.setValuePair("Username", this.rmttbusrnm.Text);
                                    System.Version version  = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version;
                                    string         serialNo = ValuePairs.getSerialNo(true);
                                    string         param    = string.Concat(new object[]
                                    {
                                        this.rmttbusrnm.Text,
                                        "\n",
                                        this.rmttbpsw.Text,
                                        "\n",
                                        version,
                                        "\nMaster\nRemote\n",
                                        serialNo
                                    });
                                    progressPopup progressPopup = new progressPopup("Login", 1, EcoLanguage.getMsg(LangRes.PopProgressMsg_Login, new string[0]), Resources.login_background, new progressPopup.ProcessInThread(this.checkAuth), param, 0);
                                    progressPopup.StartPosition = FormStartPosition.CenterScreen;
                                    progressPopup.ShowDialog();
                                    object return_V = progressPopup.Return_V;
                                    int?   num      = return_V as int?;
                                    if (num == -1)
                                    {
                                        EcoMessageBox.ShowError(EcoLanguage.getMsg(LangRes.srvConnectFail, new string[0]));
                                        this.m_forceClose = -1;
                                        base.Close();
                                    }
                                    else
                                    {
                                        if (num == -2)
                                        {
                                            EcoMessageBox.ShowError(EcoLanguage.getMsg(LangRes.Login_loginfail, new string[0]));
                                        }
                                        else
                                        {
                                            if (num == -3)
                                            {
                                                EcoMessageBox.ShowError(EcoLanguage.getMsg(LangRes.Login_VerMismatch, new string[0]));
                                            }
                                            else
                                            {
                                                if (num == -4)
                                                {
                                                    EcoMessageBox.ShowError(EcoLanguage.getMsg(LangRes.DB_waitready, new string[0]));
                                                }
                                                else
                                                {
                                                    ValuePairs.setValuePair("MasterIP", this.rmttbSrvIP.Text);
                                                    ValuePairs.setValuePair("ServicePort", this.rmttbSrvPort.Text);
                                                    ValuePairs.SaveValueKeyToRegistry(false);
                                                    this.m_userName = this.rmttbusrnm.Text;
                                                    this.m_psw      = this.rmttbpsw.Text;
                                                    EcoLanguage.ChangeLang(this.rmtcbLang.SelectedIndex);
                                                    base.Close();
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
            catch (System.Exception ex)
            {
                MessageBox.Show(ex.Message);
                this.m_forceClose = -1;
                base.Close();
            }
        }
Example #4
0
        private void butlogin_Click(object sender, System.EventArgs e)
        {
            this.m_forceClose = 0;
            try
            {
                if (this.tbuserId.Text == "")
                {
                    EcoMessageBox.ShowError(EcoLanguage.getMsg(LangRes.Login_needname, new string[0]));
                    this.tbuserId.Focus();
                }
                else
                {
                    if (this.tbpassword.Text == "")
                    {
                        EcoMessageBox.ShowError(EcoLanguage.getMsg(LangRes.Login_needpsw, new string[0]));
                        this.tbpassword.Focus();
                    }
                    else
                    {
                        string text = "Standalone";
                        string interProcessKeyValue = InterProcessShared <System.Collections.Generic.Dictionary <string, string> > .getInterProcessKeyValue("Listen_Port");

                        if (!string.IsNullOrEmpty(interProcessKeyValue) && System.Convert.ToInt32(interProcessKeyValue) != 0)
                        {
                            ValuePairs.setValuePair("ServicePort", interProcessKeyValue);
                        }
                        System.Version version  = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version;
                        string         serialNo = ValuePairs.getSerialNo(false);
                        string         param    = string.Concat(new object[]
                        {
                            this.tbuserId.Text,
                            "\n",
                            this.tbpassword.Text,
                            "\n",
                            version,
                            "\n",
                            text,
                            "\nLocal\n",
                            serialNo
                        });
                        progressPopup progressPopup = new progressPopup("User Login", 1, EcoLanguage.getMsg(LangRes.PopProgressMsg_Login, new string[0]), Resources.login_background, new progressPopup.ProcessInThread(this.checkAuth), param, 0);
                        progressPopup.StartPosition = FormStartPosition.CenterScreen;
                        progressPopup.ShowDialog();
                        object return_V = progressPopup.Return_V;
                        int?   num      = return_V as int?;
                        if (num == -1)
                        {
                            EcoMessageBox.ShowError(EcoLanguage.getMsg(LangRes.srvConnectFail, new string[0]));
                            this.m_forceClose = -1;
                            base.Close();
                        }
                        else
                        {
                            if (num == -2)
                            {
                                EcoMessageBox.ShowError(EcoLanguage.getMsg(LangRes.Login_loginfail, new string[0]));
                            }
                            else
                            {
                                if (num == -3)
                                {
                                    EcoMessageBox.ShowError(EcoLanguage.getMsg(LangRes.Login_VerMismatch, new string[0]));
                                }
                                else
                                {
                                    if (num == -4)
                                    {
                                        EcoMessageBox.ShowError(EcoLanguage.getMsg(LangRes.DB_waitready, new string[0]));
                                    }
                                    else
                                    {
                                        this.m_userName = this.tbuserId.Text;
                                        this.m_psw      = this.tbpassword.Text;
                                        EcoLanguage.ChangeLang(this.cbolanguage.SelectedIndex);
                                        base.Close();
                                    }
                                }
                            }
                        }
                    }
                }
            }
            catch (System.Exception ex)
            {
                MessageBox.Show(ex.Message);
                this.m_forceClose = -1;
                base.Close();
            }
        }