private void miRegistration_Click(object sender, EventArgs e) { var passwordForm = new CKeyForm(); if (passwordForm.ShowDialog() == DialogResult.OK) { // The interruption on half of one second at registration of user data allows to avoid searching of keys in hack Thread.Sleep(500); CPassword.UpdateHash(passwordForm.Login + passwordForm.Email + passwordForm.IMEI + "'", passwordForm.Key); var culture = Application.CurrentCulture; if (CPassword.Verify()) { MessageBox.Show(ResourceManagerProvider.GetLocalizedString("MSG_REGISTRATION_SUCCESSFUL", culture), ResourceManagerProvider.GetLocalizedString("MSG_INFORMATION_TITLE", culture), MessageBoxButtons.OK, MessageBoxIcon.None); // Successful registration data CPassword.UpdateRegistrationInfo(passwordForm.Login, passwordForm.Email, passwordForm.IMEI); miRegistration.Visible = false; UpdateRegisteredUserInfo(); } else { // Wrong registration data MessageBox.Show(ResourceManagerProvider.GetLocalizedString("MSG_REGISTRATION_WRONG", culture), ResourceManagerProvider.GetLocalizedString("MSG_INFORMATION_TITLE", culture), MessageBoxButtons.OK, MessageBoxIcon.None); } } }
private void MainForm_Load(object sender, EventArgs e) { CPassword.GetRegistrationInfo(); InitLocaleInfo(); MessageBoxManager.Register(); _xmlWrapper.LoadXml(); Logger.Write(String.Format("File LoadXml Operation Starts : {0} {1}{2}", DateTime.Now.ToLongDateString(), DateTime.Now.ToLongTimeString(), "\r\n\t=========================================================\r\n")); if (CPassword.Verify()) { miRegistration.Visible = false; } _portReader.NotificationReadReady += PortReader_NotificationReadReady; _portReader.NotificationFinishedReady += PortReader_NotificationFinishedReady; _portReader.TelephoneReadReady += PortReader_TelephoneReadReady; _portReader.TelephoneFinishedReady += PortReader_TelephoneFinishedReady; CountryFilterDataBind(); GroupFilterDataBind(); }
/// <summary> /// Check if registration is valid and check if mobile phone can support required AT commands /// </summary> private void ValidateMobile() { if (CPassword.Verify()) { if (GetIMEI() != CPassword.IMEI) { throw new Exception(String.Format(ResourceManagerProvider.GetLocalizedString("MSG_WRONG_IMEI_REGISTRATION", Application.CurrentCulture), CPassword.User, CPassword.IMEI)); } _isIntroductoryVersion = false; } else { _isIntroductoryVersion = true; } // Check support of SMS/USSD by phone if (SendNotification || Operation == PortReaderOperation.Notification) { if (CheckSendSms() != ResponseCode.OK) { throw new Exception(ResourceManagerProvider.GetLocalizedString("MSG_SMS_NOT_SUPPORTED", Application.CurrentCulture)); } if (CheckSendUSSD() != ResponseCode.OK) { throw new Exception(ResourceManagerProvider.GetLocalizedString("MSG_USSD_NOT_SUPPORTED", Application.CurrentCulture)); } } }
public void PerformTranslation() { var culture = Application.CurrentCulture; Text = ResourceManagerProvider.GetLocalizedString("WND_MAIN_FORM_TITLE", culture); // Fill menu items miFile.Text = ResourceManagerProvider.GetLocalizedString("MI_FILE", culture); miImport.Text = ResourceManagerProvider.GetLocalizedString("MI_IMPORT", culture); miSave.Text = ResourceManagerProvider.GetLocalizedString("MI_SAVE", culture); miExit.Text = ResourceManagerProvider.GetLocalizedString("MI_EXIT", culture); miEdit.Text = ResourceManagerProvider.GetLocalizedString("MI_EDIT", culture); miSearch.Text = ResourceManagerProvider.GetLocalizedString("MI_SEARCH", culture); miSettings.Text = ResourceManagerProvider.GetLocalizedString("MI_SETTINGS", culture); miSettingsModem.Text = ResourceManagerProvider.GetLocalizedString("MI_SETTINGS_MODEM", culture); miSettingsCall.Text = ResourceManagerProvider.GetLocalizedString("MI_SETTINGS_CALL", culture); miLanguage.Text = ResourceManagerProvider.GetLocalizedString("MI_LANGUAGE", culture); miLanguageRussian.Text = ResourceManagerProvider.GetLocalizedString("MI_LANGUAGE_RUSSIAN", culture); miLanguageEnglish.Text = ResourceManagerProvider.GetLocalizedString("MI_LANGUAGE_ENGLISH", culture); miLanguageUkraine.Text = ResourceManagerProvider.GetLocalizedString("MI_LANGUAGE_UKRAINE", culture); miInformation.Text = ResourceManagerProvider.GetLocalizedString("MI_INFORMATION", culture); miView.Text = ResourceManagerProvider.GetLocalizedString("MI_VIEW", culture); miLog.Text = ResourceManagerProvider.GetLocalizedString("MI_LOG", culture); miRegistration.Text = ResourceManagerProvider.GetLocalizedString("MI_REGISTRATION", culture); miHelp.Text = ResourceManagerProvider.GetLocalizedString("MI_HELP", culture); miAbout.Text = ResourceManagerProvider.GetLocalizedString("MI_ABOUT", culture); // Fill context menu miSelectActivated.Text = ResourceManagerProvider.GetLocalizedString("MI_SELECT_ACTIVATED", culture); miCallSelected.Text = ResourceManagerProvider.GetLocalizedString("MI_CALL_SELECTED", culture); miCallLatest.Text = ResourceManagerProvider.GetLocalizedString("MI_CALL_LATEST", culture); miSendNotification.Text = ResourceManagerProvider.GetLocalizedString("MI_SEND_NOTIFICATION", culture); miCopyToClipboard.Text = ResourceManagerProvider.GetLocalizedString("MI_COPY_TO_CLIPBOARD", culture); miSetActivationSelected.Text = ResourceManagerProvider.GetLocalizedString("MI_SET_ACTIVATION_SELECTED", culture); miResetActivationSelected.Text = ResourceManagerProvider.GetLocalizedString("MI_RESET_ACTIVATION_SELECTED", culture); miDeleteSelected.Text = ResourceManagerProvider.GetLocalizedString("MI_DELETE_SELECTED", culture); btnCall.Text = ResourceManagerProvider.GetLocalizedString("BTN_CALL", culture); btnAddDiapason.Text = ResourceManagerProvider.GetLocalizedString("BTN_ADD_DIAPASON", culture); if (CPassword.Verify()) { UpdateRegisteredUserInfo(); } else { lUser.Text = ResourceManagerProvider.GetLocalizedString("L_USER", culture); } listTelephones.Columns[0].Text = ResourceManagerProvider.GetLocalizedString("LST_TELEPHONES_NUMBER", culture); listTelephones.Columns[1].Text = ResourceManagerProvider.GetLocalizedString("LST_TELEPHONES_DATE", culture); listTelephones.Columns[2].Text = ResourceManagerProvider.GetLocalizedString("LST_TELEPHONES_DATE_ACTIVATION", culture); listTelephones.Columns[3].Text = ResourceManagerProvider.GetLocalizedString("LST_TELEPHONES_COMMENT", culture); AdjustLastColumn(listTelephones); lGroupFilter.Text = String.Format("{0}:", ResourceManagerProvider.GetLocalizedString("L_GROUP_FILTER", culture)); // Update All label by removing and adding new localized text if (cbGroupFilter.Items.Count > 0) { var showAll = cbGroupFilter.SelectedIndex == 0; cbGroupFilter.Items.RemoveAt(0); cbGroupFilter.Items.Insert(0, ResourceManagerProvider.GetLocalizedString("CB_GROUP_FILTER_ALL", culture)); if (showAll) { cbGroupFilter.Text = ResourceManagerProvider.GetLocalizedString("CB_GROUP_FILTER_ALL", culture); } } //Set button text of MessageBox from resources MessageBoxManager.OK = ResourceManagerProvider.GetLocalizedString("BTN_OK", culture); MessageBoxManager.Cancel = ResourceManagerProvider.GetLocalizedString("BTN_CANCEL", culture); /* MessageBoxManager.Retry = ResourceManagerProvider.GetLocalizedString("CB_GROUP_FILTER_ALL", culture); * MessageBoxManager.Ignore = ResourceManagerProvider.GetLocalizedString("CB_GROUP_FILTER_ALL", culture); * MessageBoxManager.Abort = ResourceManagerProvider.GetLocalizedString("CB_GROUP_FILTER_ALL", culture); */ MessageBoxManager.Yes = ResourceManagerProvider.GetLocalizedString("BTN_YES", culture); MessageBoxManager.No = ResourceManagerProvider.GetLocalizedString("BTN_NO", culture); }
private void Button3_Click_1(System.Object sender, System.EventArgs e) { try { if (string.IsNullOrEmpty(UName.Text.Trim())) { MessageBox.Show("Plz.. Enter UserName.."); } else if (string.IsNullOrEmpty(OPassword.Text.Trim())) { MessageBox.Show("Plz.. Enter Old Password.."); } else if (string.IsNullOrEmpty(NPassword.Text.Trim()) | string.IsNullOrEmpty(OPassword.Text.Trim())) { MessageBox.Show("Plz.. Enter New Password and Confirm it.."); } else if (NPassword.Text != CPassword.Text) { MessageBox.Show("Plz.. Password You Typed Did Not Match .. Plz Enter New Password Both Boxes.."); } else if (string.IsNullOrEmpty(AK.Text.Trim())) { MessageBox.Show("Plz.. Enter Access Key.."); } else { con = new SqlConnection("Data Source=.\\SQLEXPRESS;Initial Catalog=Bus_System;Integrated Security=True"); con.Open(); cmd = new SqlCommand("select username,password from Newuser where username='******' and password='******'", con); dr = cmd.ExecuteReader(); dr.Read(); if (dr.HasRows) { dr.Close(); cmd = new SqlCommand("select * from AKPrivate where KeyIMP='" + AK.Text + "'", con); dr = cmd.ExecuteReader(); dr.Read(); if (dr.HasRows) { dr.Close(); cmd = new SqlCommand("Update Newuser Set password='******' Where username='******'", con); cmd.ExecuteNonQuery(); MessageBox.Show("Password Changed Successfully..!"); AK.Clear(); NPassword.Clear(); CPassword.Clear(); OPassword.Clear(); UName.Clear(); } else { MessageBox.Show("Wrong Access Key..!"); } } else { MessageBox.Show("Wrong Username and Password..!"); } dr.Close(); con.Close(); } } catch (Exception ex) { MessageBox.Show("Sorry.. Something Went Wrong..! Or " + ex.Message); } }