Exemplo n.º 1
0
 private void lnkSettingWeb_Click(object sender, EventArgs e)
 {
     using (Authentication.frmConfigWebService fConfig = new frmConfigWebService())
     {
         fConfig.ShowDialog();
         this.txtUserName.Focus();
         this.txtUserName.Select(0, 0);
     }
 }
Exemplo n.º 2
0
        private void frmLogin_Load(object sender, EventArgs e)
        {
            try
            {
                RefreshConnection();
                Calbee.Infra.Common.Constants.WConstants.userName = string.Empty;
                lblVersion.Text = "Version : " + System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString().Trim();
                currentVersion  = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString().Trim();

                string serverVersion = Calbee.WMS.Services.Core.CoreServiceProxy.WS.GetProgramVersion(Calbee.Infra.Common.Constants.WConstants.defaultProgramName);

                if (!currentVersion.Equals(serverVersion))
                {
                    if (MessageBox.Show("Do you want to updates program", "Confirm", MessageBoxButtons.YesNo,
                                        MessageBoxIcon.Question, MessageBoxDefaultButton.Button1) == DialogResult.Yes)
                    {
                        // update program from server.
                        DownloadFile(Calbee.WMS.Services.Core.DownloadCAB.WS.Url);
                        Application.Exit();
                    }
                }

                this.txtUserName.Focus();
                this.txtUserName.Select(0, 0);
            }
            catch (Exception ex)
            {
                if (ex.Message.ToString().IndexOf("404") > 0)
                {
                    using (Authentication.frmConfigWebService fConfig = new frmConfigWebService())
                    {
                        fConfig.ShowDialog();
                        this.txtUserName.Focus();
                        this.txtUserName.Select(0, 0);
                    }
                }
                else
                {
                    MsgBox.DialogErrorTryCatch("Error FormLoad Login : ", ex);
                }
            }
        }