private void Login() { if (MD5.TextToMd5(JobNumBox.Text) == AdminPassWord) { isOperatorAdmin = true; OperatorID = "10S88888"; Close(); } if (JobNumBox.Text.Length == 8 && (JobNumBox.Text.ToUpper().IndexOf("10S") == 0 || JobNumBox.Text.ToUpper().IndexOf("10A") == 0) || JobNumBox.Text.Length == 9 && JobNumBox.Text.ToUpper().IndexOf("10A") == 0) { OperatorID = JobNumBox.Text; IsAdmin = JobNumBox.Text.ToUpper().IndexOf("10S") == 0 ? true : false; Close(); } else { JobNumBox.ForeColor = Color.Red; JobNumBox.ForeColor = Color.Black; JobNumBox.Text = ""; JobNumBox.Focus(); if (sc != null) { sc.Start(); } IsAdmin = false; } }
private void JobNumber_Load(object sender, EventArgs e) { //窗体位置 this.StartPosition = FormStartPosition.Manual; this.Location = new Point(1, 1); JobNumBox.Focus(); }
private void JobNumBox_KeyPress(object sender, KeyPressEventArgs e) { DateTime tempDt = DateTime.Now; TimeSpan ts = tempDt.Subtract(_dt); if (ts.Milliseconds > 50) { JobNumBox.Clear(); JobNumBox.Focus(); } _dt = tempDt; }
private void JobNumber_Shown(object sender, EventArgs e) { JobNumBox.Focus(); if (sc != null) { if (sc.IsOpen) { sc.Bangding(JobNumBox); sc.Stop(); sc.Start(); } } }