private void cmdLogon_Click(object sender, System.EventArgs e) { logger mylog = new logger(); mylog.makelog("Login"); HTTPSAPGateway SAPGateway = new HTTPSAPGateway(); string sMessage = ""; Cursor.Current = Cursors.WaitCursor; Cursor.Show(); if (SAPGateway.CheckLogin(this.txtUname.Text, this.txtPword.Text, out sMessage)) { frmStart frmMain = (frmStart)this.Parent; this.frmParent.SAPUname = this.txtUname.Text; this.frmParent.SAPPword = this.txtPword.Text; this.frmParent.SAPUname = this.txtUname.Text; this.frmParent.SAPPword = this.txtPword.Text; try { this.frmParent.SAPlogontime = new DateTime(DateTime.UtcNow.Ticks); this.Close(); } catch (Exception ex) { frmStart.HandleException(ex, true); } } else { //MessageBox.Show(sMessage, frmStart.MESSAGE_BOX_TITLE); if (sMessage == "") { this.lblStatusBar.Text = "Cannot Connect"; } else { this.lblStatusBar.Text = sMessage; } } SAPGateway = null; Cursor.Current = Cursors.Default; }
/// <summary> /// Warns the user if the version in the assembly file does not match /// the version on the web servers' CurrentVersionXML /// </summary> private void CheckVersion() { logger mylog = new logger(); mylog.makelog("Calling CheckVersion"); this.lblStatusBar.Text = "Checking Version.."; this.lblStatusBar.Update(); Type t = typeof(ce5b.frmStart); HTTPSAPGateway oGateway = new HTTPSAPGateway(); this.sCurrent = oGateway.GetCurrentVersion().Trim(); this.sRunning = t.Assembly.GetName().Version.ToString().Trim(); //if (this.sCurrent != this.sRunning) //{ // if (Program.PlatformType == "SYMBOL WinCE") // { // string sWarn = "The application is not the current version.\n " + // "Please Close Application and Download latest version via link"; // MessageBox.Show(sWarn, "Warning", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1); // this.lblStatusBar.Text = "Incorrect Version :" + sCurrent; // } // else // { // string sWarn = "The application is not the current version.\n " + // "Please Close Application and Download latest version via link"; // MessageBox.Show(sWarn, "Warning", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1); // this.lblStatusBar.Text = "Incorrect Version :" + sCurrent; // } //} //else //{ // this.lblStatusBar.Text = "Checked Version :" + sCurrent; //} this.lblStatusBar.Update(); mylog.makelog("Exit Check Version"); mylog.makelog(this.sCurrent); }