void InputNumbCardClickHandeler(object sender, EventArgs e) { int numb = 0; numb = IOF.InputXmlFile(numb, Properties.Resources.CardFile, myModel.list()); StructCard Card = SearchCard(myModel.list(), out numb); if (!(Card == null)) { if (atmInput.TextPassword.Text == Card.getPaswrod().ToString()) { atmInput.Hide(); ATMMenu ATMMenu = new ATMMenu(); _ = new PresentorATMMenu(ATMMenu, myModel); myModel.IndexIn(numb); ATMMenu.ShowDialog(); atmInput.Show(); atmInput.Hide(); } else { MessageBox.Show("Error Pasword", "Error"); } } else { MessageBox.Show("This card is not exist", "Error"); } }
void InputNumbCardClickHandeler(object sender, EventArgs e) { if (Check.ProvValidCard(atmInput.TextNumberCard.Text, atmInput.TextNumberCard.Text.Length)) { int numb = 0; numb = IOF.InputXmlFile(numb, "Card.xml", myModel.list()); for (int i = 0; i < numb; i++) { if (myModel.equals(myModel.list()[i].getNumbcard(), atmInput.TextNumberCard.Text)) { if (atmInput.TextPassword.Text == myModel.list()[i].getPaswrod().ToString()) { atmInput.Hide(); ATMMenu ATMMenu = new ATMMenu(); _ = new PresentorATMMenu(ATMMenu, myModel); myModel.IndexIn(i); ATMMenu.ShowDialog(); atmInput.Show(); atmInput.Hide(); } else { atmInput.label3.Text = "Error Pasword"; } } else { atmInput.label3.Text = "Number Card is'n Valid"; } } } }
void CutBalanceButtonClickHandel(object sender, EventArgs e) { i = myModel.IndexOut(); Input input = new Input(); _ = new PresentorInput(input, myModel); input.ShowDialog(); myModel.list()[i].setBalance(WorkWithBalance.CutBalans(myModel.InputNumbOut(), myModel.list()[i].getBalance())); IOF.OutputXmlFile(myModel.list()); input.Close(); }
static void Main(string[] args) { string pBook = ConfigurationManager.AppSettings.Get("programmingBook"); string ansBook = ConfigurationManager.AppSettings.Get("answerBook"); string concBook = ConfigurationManager.AppSettings.Get("concordanceBook"); IOF iOF = new IOF(); string txt = iOF.ReadPBook(pBook); TextParser textParser = new TextParser(); Text text = textParser.Parse(txt); text.DeleteEmptySentences(); using (StreamWriter writeToAnswerTXT = new StreamWriter(ansBook)) { //Вывести все предложения заданного текста в порядке возрастания количества //слов в каждом из них text.SortedByWordCount(); int len = 5, numOfSentences = 2; // Во всех вопросительных предложениях текста найти и напечатать без //повторений слова заданной длины text.PrintWordsInInterrogativeWithoutRepetitions(writeToAnswerTXT, len); //Из текста удалить все слова заданной длины, начинающиеся на согласную букву text.DeleteWordsBegWithConsonant(len); text.DeleteEmptySentences(); //В некотором предложении текста слова заданной длины заменить указанной //подстрокой, длина которойможет не совпадать с длиной слова string sub = "hello"; text.WordsReplaceWithSubstring(numOfSentences, len, sub); writeToAnswerTXT.Close(); }; using (StreamWriter writeToConcordanceTXT = new StreamWriter(concBook)) { //отобразить соответствие int countSentencePerPage = 5; text.Concordance(writeToConcordanceTXT, countSentencePerPage); writeToConcordanceTXT.Close(); }; }
static void Main(string[] args) { try { string path = ""; string stroka = ""; int count = 0; IOF iof = new IOF(); IOC ioc = new IOC(); Symbol symbol = new Symbol(); Sentence sentence = new Sentence(); Text text = new Text(); path = ioc.Messeges(path); stroka = iof.Read(path); ioc.Output(stroka); do { count = ioc.OutputMenu(); switch (count) { case 1: text.DeleteSpaces(stroka); Console.WriteLine(text); sentence.Processing(stroka); break; case 0: return; } } while (count != 0); } catch (Exception e) { Console.WriteLine(e); } }