private void BtnLogin_Click(object sender, EventArgs e) //Регистрация кассира { if (!CheckId()) { Drv.GetShortECRStatus(); //Запрос состояния ФР ErrorsForm ErorrsformP = new ErrorsForm(6666, Drv.INN, Drv.ECRMode, Drv.ECRModeDescription, Drv.ECRMode8Status, Drv.ECRModeStatus, Drv.ECRAdvancedMode, Drv.ECRAdvancedModeDescription); ErorrsformP.ShowDialog(this); ErorrsformP.Dispose(); return; } if (btnLogin.BackColor == Color.Lime) { TextBoxFIO_TextChanged(sender, e); TextBoxINN_TextChanged(sender, e); if ((tbFIO.BackColor == Color.Snow) && (tbINN.BackColor != Color.LightCoral)) { Properties.Settings.Default.userFIO = tbFIO.Text; Properties.Settings.Default.userINN = tbINN.Text; Properties.Settings.Default.Save(); KKT_StatusCheck(); btnLogin.BackColor = Color.DodgerBlue; btnLogin.Text = "LogOut"; tbFIO.ReadOnly = tbINN.ReadOnly = label13.Visible = tbSummAll.Visible = panel2.Visible = true; groupBox4.Visible = false; } } else { btnLogin.BackColor = Color.Lime; btnLogin.Text = "Login"; tbFIO.ReadOnly = tbINN.ReadOnly = label13.Visible = tbSummAll.Visible = groupBox3.Visible = groupBox4.Visible = panel2.Visible = false; } if (tbFIO.ReadOnly) { fioCasher = tbFIO.Text; innCasher = tbINN.Text; } else { fioCasher = innCasher = ""; } }
private bool UpdateResult() //Проверка состояния ККТ { int ResultCode = Drv.ResultCode; string ResultCodeDesc = Drv.ResultCodeDescription; toolStripStatusLabel1.Text = string.Format("Результат: {0}, {1}", ResultCode, ResultCodeDesc); if (ResultCode != 0) { Drv.GetShortECRStatus(); ErrorsForm ErorrsformP = new ErrorsForm(ResultCode, ResultCodeDesc, Drv.ECRMode, Drv.ECRModeDescription, Drv.ECRMode8Status, Drv.ECRModeStatus, Drv.ECRAdvancedMode, Drv.ECRAdvancedModeDescription); ErorrsformP.ShowDialog(this); ErorrsformP.Dispose(); return(false); } else { return(true); } }