private void buttonIN_Click(object sender, EventArgs e) { var windowUserIN = new WindowUserIN(); windowUserIN.ShowDialog(); if (windowUserIN.UserNameFlag && windowUserIN.UserPasswordFlag) { var windowMain = new WindowMain(); windowMain.users = windowUserIN.usersIn; windowMain.richTextBox1.Text = $"Вход выполнен! Логин: {windowMain.users.UserName} Имя: {windowMain.users.Name}"; windowMain.Show(); Hide(); MessageBox.Show("Вход выполнен!", "Вход"); } }
private void TestButton_Click(object sender, EventArgs e) { var windowMain = new WindowMain(); /*windowMain.users.AdminStatus = true; * windowMain.users.Name = "Igor"; * windowMain.users.UserName = "******"; * windowMain.users.Password = "******"; * windowMain.users.loginStatus = true; * windowMain.richTextBox1.Text = $"Вход выполнен! Логин: {windowMain.users.UserName} Имя: {windowMain.users.Name}";*/ windowMain.richTextBox1.Text = $"Вход выполнен! Тестовый режим!"; windowMain.Show(); Hide(); MessageBox.Show("Вход выполнен!", "Вход"); }
private void buttonOK_Click(object sender, EventArgs e) { var windowMain = new WindowMain(); string indexId = (windowMain.IndexId + 1).ToString(); var equipmentService = new EquipmentService(); equipmentService.CheckEquipmentsId = new CompositeCheker <Equipment>() { Checkers = { new BasicChecker <Equipment>(), new ClonChecker <Equipment>() { Error = "This Equipment ID already exists!" } } }; equipmentService.CheckEquipmentsName = new CompositeCheker <Equipment>() { Checkers = { new BasicChecker <Equipment>() } }; equipmentService.CheckEquipmentsSerialNumber = new CompositeCheker <Equipment>() { Checkers = { new BasicChecker <Equipment>(), new ClonChecker <Equipment>() { Error = "This Equipment Serial Nunber already exists!" } } }; equipmentService.CheckEquipmentsLocation = new CompositeCheker <Equipment>() { Checkers = { new BasicChecker <Equipment>() } }; equipmentService.CheckEquipmentsNumberStatusQuall = new CompositeCheker <Equipment>() { Checkers = { new BasicChecker <Equipment>() } }; equipmentService.CheckEquipmentsNumberProtocol = new CompositeCheker <Equipment>() { Checkers = { new BasicChecker <Equipment>(), new ClonChecker <Equipment>() { Error = "This Equipment Number protocol already exists!" } } }; equipmentService.CreatEquipment(user, indexId, textBoxNameEquipment.Text, textBoxSerialNumber.Text, textBoxLocation.Text, textBoxStatus.Text, textBoxNumberQuall.Text, dateTimePicker1.Text, int.Parse(textBoxYers.Text)); windowMain.BaseDate("EquipmentEntityTest6"); }