private void SubmitButton_Click(object sender, EventArgs e) { if (firstUser == null) { showMessage("Old user is not found / Старый пользователь не найден"); } else if (secondUser == null) { showMessage("New user is not found / Новый пользователь не найден"); } else if (EquipmentList.SelectedIndex == -1) { showMessage("Equipment for tranfer is not selected / Оборудование не передачи не выбрано"); } else if (DeadlineDate.SelectionStart <= DateTime.Today) { showMessage("Chosen date is unavailable / Выбранная дата недоступна"); } else { PrintSheet.PrintTransferSheet(firstUser, secondUser, equipments[EquipmentList.SelectedIndex], DeadlineDate.SelectionStart.ToShortDateString()); Connector1C.transferEquipment(firstUser, secondUser, equipments[EquipmentList.SelectedIndex]); cardReader.CloseConnection(); this.Close(); } }
private void SubmitButton_Click(object sender, EventArgs e) { if (oldEquipment == null) { showMessage("Old equipment is not found / Старое оборудование не найдено"); } else if (newEquipment == null) { showMessage("New equipment is not found / Новое оборудование не найдено"); } else if (DeadlineDate.SelectionStart <= DateTime.Today) { showMessage("Chosen date is unavailable / Выбранная дата недоступна"); } else if (admin == null) { showMessage("Admin is not found / Администратор не найден"); } else { PrintSheet.PrintExchangeSheet(user, oldEquipment, newEquipment, DeadlineDate.SelectionStart.ToShortDateString()); Connector1C.transferEquipment(user, admin, oldEquipment); Connector1C.getEquipment(user, newEquipment); cardReader.CloseConnection(); this.Close(); } }
public override void CardId(string id) { Action a = () => { user = CardManager.getUser(id); if (user == null) { cardReader.Read(CardId); showMessage("User is not found / Пользователь не найден"); return; } equipments = Connector1C.getListOfEquipment(user); waititngCardLabel.Visible = false; waititngCardLabelRus.Visible = false; CardPanel.BackgroundImage = Properties.Resources.tick; CardPanel.BackgroundImageLayout = ImageLayout.Zoom; label1.Visible = true; label1.Text = user.Name + ", choose equipment that you lost (выберите утерянное оборудование):"; EquipmentList.Visible = true; if (equipments != null) { for (int i = 0; i < equipments.Count(); i++) { EquipmentList.Items.Add(equipments[i].Name); } } }; BeginInvoke(a); }
public override void CardId(string id) { Action a = () => { if (firstUser == null) { cardReader.Read(CardId); firstUser = CardManager.getUser(id); if (firstUser == null) { showMessage("User is not found / Пользователь не найден"); return; } equipments = Connector1C.getListOfEquipment(firstUser); waititngFirstCardLabel.Visible = false; waititngFirstCardLabelRus.Visible = false; FirstCardPanel.BackgroundImage = Properties.Resources.tick; FirstCardPanel.BackgroundImageLayout = ImageLayout.Zoom; label1.Visible = true; label1.Text = "Choose equipment of (Выберите оборудование)" + firstUser.Name + ":"; EquipmentList.Visible = true; if (equipments != null) { for (int i = 0; i < equipments.Count(); i++) { EquipmentList.Items.Add(equipments[i].Name); } } SecondCardPanel.Enabled = true; } else { secondUser = CardManager.getUser(id); if (secondUser == null || firstUser.Id == secondUser.Id) { cardReader.Read(CardId); showMessage("User is not found / Пользователь не найден"); return; } waititngSecondCardLabel.Visible = false; waititngSecondCardLabelRus.Visible = false; SecondCardPanel.BackgroundImage = Properties.Resources.tick; SecondCardPanel.BackgroundImageLayout = ImageLayout.Zoom; label2.Visible = true; label2.Text = "New user (Новый пользователь): " + secondUser.Name; } }; BeginInvoke(a); }
public override void EquipmentId(string id) { equipment = Connector1C.doesSomeoneHasEquipment(id); if (equipment == null) { barcodeReader.Read(EquipmentId); showMessage("Equipment is not found / Оборудование не найдено"); return; } waitingEquipmentLabel.Visible = false; waitingEquipmentLabelRus.Visible = false; EquipmentPanel.BackgroundImage = Properties.Resources.tick; user = Connector1C.equipmentPlace(id); label1.Visible = true; label1.Text = "User (Пользователь): " + user.Name + "\nEquipment (Оборудование): " + equipment.Name; }
private void SubmitButton_Click(object sender, EventArgs e) { if (equipment == null) { showMessage("Equipment is not found / Оборудование не найдено"); } else if (admin == null) { showMessage("Admin is not found / Администратор не найден"); } else { PrintSheet.PrintReturnSheet(new User(user.Name, ""), equipment); Connector1C.transferEquipment(user, admin, equipment); cardReader.CloseConnection(); this.Close(); } }
private void SubmitButton_Click(object sender, EventArgs e) { if (user == null) { showMessage("User is not found / Пользователь не найден"); } else if (EquipmentList.SelectedIndex == -1) { showMessage("Lost equipment is not selected / Утерянное оборудование не выбрано"); } else { PrintSheet.PrintLostSheet(user, equipments[EquipmentList.SelectedIndex]); Connector1C.lostEquipment(equipments[EquipmentList.SelectedIndex]); cardReader.CloseConnection(); this.Close(); } }
public override void EquipmentId(string id) { if (equipment == null) { equipment = Connector1C.getEquipmentByID(id); if (equipment != null) { waitingEquipmentLabel.Visible = false; waitingEquipmentLabelRus.Visible = false; EquipmentPanel.BackgroundImage = Properties.Resources.tick; label2.Visible = true; label2.Text = "Equipment (Оборудование): " + equipment.Name; } else { barcodeReader.Read(EquipmentId); showMessage("Equipment is not found / Оборудование не найдено"); } } }
private void SubmitButton_Click(object sender, EventArgs e) { if (user == null) { showMessage("User is not found / Пользователь не найден"); } else if (equipment == null) { showMessage("Equipment is not found / Оборудование не найдено"); } else if (DeadlineDate.SelectionStart <= DateTime.Today) { showMessage("Chosen date is unavailable / Выбранная дата недоступна"); } else { PrintSheet.PrintGetSheet(user, equipment, DeadlineDate.SelectionStart.ToShortDateString()); Connector1C.getEquipment(user, equipment); cardReader.CloseConnection(); this.Close(); } }
public override void EquipmentId(string id) { if (oldEquipment == null) { barcodeReader.Read(EquipmentId); oldEquipment = Connector1C.doesSomeoneHasEquipment(id); if (oldEquipment == null) { showMessage("Equipment is not found / Оборудование не найдено"); return; } NewEquipmentPanel.Enabled = true; user = Connector1C.equipmentPlace(id); waitingOldEquipmentLabel.Visible = false; waitingOldEquipmentLabelRus.Visible = false; OldEquipmentPanel.BackgroundImage = Properties.Resources.tick; label1.Visible = true; label1.Text = "User (Пользователь): " + user.Name + "\nOld equipment (Старое оборудование): " + oldEquipment.Name; } else { newEquipment = Connector1C.getEquipmentByID(id); if (newEquipment == null) { barcodeReader.Read(EquipmentId); showMessage("Equipment is not found / Оборудование не найдено"); return; } waitingNewEquipmentLabel.Visible = false; waitingNewEquipmentLabelRus.Visible = false; NewEquipmentPanel.BackgroundImage = Properties.Resources.tick; label2.Visible = true; label2.Text = "New equipment (Новое оборудование): " + newEquipment.Name; } }