public override void OnBarcode(string Barcode) { if (Barcode.IsValidBarcode()) { ////if (Barcode.IndexOf("SB_EM.") < 0 || Barcode.Length == 6 || !Number.IsNumber(Barcode.Substring(6))) ////{ //// ShowMessage("Необходимо отсканировать штрих-код сотрудника"); //// return; ////} //PerformQuery("Registration", Int32.Parse(Barcode.Substring(6))); //if (Parameters == null || Parameters[0] == null) return; //if (!((bool)(Parameters[0]))) //{ // ShowMessage("Сотрудник не найден в системе!"); // return; //} ////Регистрация успешна! ////string name = Parameters[1] as string; MainProcess.User = Int32.Parse(Barcode.Substring(6)); MainProcess.ClearControls(); //Открыть окно выбора процесса MainProcess.Process = new SelectingLampProcess(MainProcess); } }
protected override void OnHotKey(KeyAction key) { switch (key) { case KeyAction.Esc: if ("Припинити виконання операції".Ask()) { MainProcess.ClearControls(); MainProcess.Process = new SelectingProcess(); } break; case KeyAction.Complate: if ("Завершити виконання операції".Ask()) { ComplateOperation(); } break; case KeyAction.F12: case KeyAction.Proceed: if (factPickingData != null && factPickingData.StickerId > 0) { proceed(); } break; } }
/// <summary>Перехід до процесу з корпусом</summary> /// <param name="Barcode">Штрихкод комплектуючого</param> private void caseProcess(string Barcode) { bool onHectar = isCasePerHectare(Barcode); object[] array; //работает ли лампа = на гектаре if (onHectar) { array = LuminaireOnHectareInfo(Barcode); if (array.Length != 0) { MainProcess.ClearControls(); MainProcess.Process = new ChooseLighterOnHectare(MainProcess, array, Barcode); } } else { array = LuminairePerHectareInfo(Barcode); if (array.Length != 0) { MainProcess.ClearControls(); MainProcess.Process = new ChooseLighterPerHectare(MainProcess, array, Barcode); } } }
protected override void OnHotKey(KeyAction TypeOfAction) { if (palletEditControls.Visible) { switch (TypeOfAction) { case KeyAction.Esc: startScanNextPallet(); return; } } else if (scanNextPalletControls.Visible) { switch (TypeOfAction) { case KeyAction.Complate: complateProcess(); return; case KeyAction.Esc: if (acceptanceId == 0 || "Скасувати операцію?".Ask()) { MainProcess.ClearControls(); MainProcess.Process = new SelectingProcess(); } return; } } }
public override void OnBarcode(string Barcode) { if (Barcode.IsValidBarcode()) { TypeOfAccessories type = BarcodeWorker.GetTypeOfAccessoriesByBarcode(Barcode); switch (type) { case TypeOfAccessories.Lamp: MainProcess.ClearControls(); MainProcess.Process = new ReplacingAccessory(MainProcess, CaseBarcode, Barcode, Cases.IsCaseHaveAccessory(CaseBarcode, type), TypeOfAccessories.Lamp); break; case TypeOfAccessories.Case: break; case TypeOfAccessories.ElectronicUnit: MainProcess.ClearControls(); MainProcess.Process = new ReplacingAccessory(MainProcess, CaseBarcode, Barcode, Cases.IsCaseHaveAccessory(CaseBarcode, type), TypeOfAccessories.ElectronicUnit); break; } } }
/// <summary>Комплектующее отсканировано, нужно начать редактирование</summary> /// <param name="Barcode">ШтрихКод</param> public override sealed void OnBarcode(string barcode) { //Если это штрих-код комплектующего if (barcode.IsValidBarcode()) { if (groupRegistration) { groupRegistrationOnBarcode(barcode); return; } MainProcess.ClearControls(); this.barcode = barcode; bool accesoryIsExist = !string.IsNullOrEmpty(barcode) && BarcodeWorker.IsBarcodeExist(barcode); //Если в системе уже существует штрихкод if (!existMode && accesoryIsExist) { //Тип комплектующего штрихкода TypeOfAccessories typesOfAccessories = BarcodeWorker.GetTypeOfAccessoriesByBarcode(barcode); //Является ли тип комплектующего (существующий) = типу который нужно отредактировать (отсканированный) bool isTypeLikeCurrent = typesOfAccessories.ToString() + 's' != currentType.Name; //Если типы не совпадают - "Выход" if (isTypeLikeCurrent) { ShowMessage("Штрихкод уже используется в другом типе комплектующего!"); OnHotKey(KeyAction.Esc); return; } } showData(accesoryIsExist, barcode); } //Если это штрих-код позиции else if (barcode.IsValidPositionBarcode()) { Cases cases = accessory as Cases; if (cases != null) { long map; int register; int position; BarcodeWorker.GetPositionData(barcode, out map, out register, out position); cases.Map = map; cases.Register = register; cases.Position = position; cases.Status = TypesOfLampsStatus.IsWorking; MainProcess.ClearControls(); showData(cases.Id == 0, cases.BarCode); } } //Во всех других случаях else { ShowMessage("Невірний формат штрихкоду!"); OnHotKey(KeyAction.Esc); } }
public override void OnHotKey(KeyAction TypeOfAction) { switch (TypeOfAction) { //Назад case KeyAction.Esc: MainProcess.ClearControls(); MainProcess.Process = new RegistrationProcess(MainProcess); break; //Очищення case KeyAction.Complate: if (MessageBox.Show( "Очистить все данные на ТСД?", "Очистка", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1) == DialogResult.Yes) { dbArchitector.ClearAll(); } break; //Синхронізація case KeyAction.Proceed: new dbSynchronizer(MainProcess, serverIdProvider); MainProcess.ClearControls(); MainProcess.Process = new SelectingLampProcess(MainProcess); break; } }
public override void OnBarcode(string Barcode) { if (Barcode.IsValidBarcode()) { //Тип отсканированого комплектующего TypeOfAccessories type = BarcodeWorker.GetTypeOfAccessoriesByBarcode(Barcode); switch (type) { //Лампа - установка/замена лампы case TypeOfAccessories.Lamp: MainProcess.ClearControls(); MainProcess.Process = new ReplacingAccessory( MainProcess, CaseBarcode, Barcode, Cases.IsCaseHaveAccessory(CaseBarcode, TypeOfAccessories.Lamp), TypeOfAccessories.Lamp); break; //Корпус - установка/замена корпуса case TypeOfAccessories.Case: MainProcess.ClearControls(); MainProcess.Process = new ReplaceLights_SelectNew(MainProcess, Barcode, CaseBarcode); break; //Ел.блок - установка/замена блока case TypeOfAccessories.ElectronicUnit: MainProcess.ClearControls(); MainProcess.Process = new ReplacingAccessory( MainProcess, CaseBarcode, Barcode, Cases.IsCaseHaveAccessory(CaseBarcode, TypeOfAccessories.ElectronicUnit), TypeOfAccessories.ElectronicUnit); break; } } }
public override void OnHotKey(KeyAction TypeOfAction) { switch (TypeOfAction) { case KeyAction.Esc: { MainProcess.ClearControls(); MainProcess.Process = new RegistrationProcess(MainProcess); break; } case KeyAction.F5: { PerformQuery("ПолучитьСписокПланаПриходаТары"); if (ResultParameters == null || ResultParameters[0] == null) { ShowMessage("Подойдите в зону беспроводного покрытия"); return; } var dataTable = ResultParameters[0] as DataTable; if (dataTable != null && dataTable.Rows.Count < 1) { ShowMessage("В полученном документе нет строк для приема!"); return; } MainProcess.ClearControls(); MainProcess.Process = new IncomingProcess(MainProcess, dataTable); break; } } }
/// <summary>Выбор строки в таблице</summary> private void onRowSelected(object sender, OnRowSelectedEventArgs e) { long mapId = Convert.ToInt64(e.SelectedRow["Id"]); //Если таблица - значит есть вложенные карты. Опять отобразить if (checkIncludeMapOrInfo(mapId)) { MainProcess.ClearControls(); MainProcess.Process = new SelectMap(MainProcess, mapId, LampBarCode); } //Иначе - результат (выбранная карта) else { object[] array = getMapInfo(mapId); int start = Convert.ToInt32(array[2]); int finish = Convert.ToInt32(array[3]); MapInfo = new MapInfo(array[0], array[1].ToString(), start, finish); MainProcess.ClearControls(); MainProcess.Process = new InstallingNewLighter(MainProcess, LampBarCode) { MapInfo = MapInfo }; } }
public override void DrawControls() { switch (processStep) { case Steps.DocumentSelecting: { #region Выбор документа //PerformQuery("ПолучитьСписокПланаПриходаТары"); //if (Parameters == null || Parameters[0] == null) //{ // ShowMessage("Подойдите в зону беспроводного покрытия"); // MainProcess.Process = new SelectingProcess(MainProcess); // return; //} //dataTable = Parameters[0] as DataTable; //if (dataTable.Rows.Count == 0) //{ // ShowMessage("Нет запланированных документов для приема расходных материалов!"); // MainProcess.Process = new SelectingProcess(MainProcess); // return; //} TableControl = MainProcess.CreateTable("WareList", 259); TableControl.OnKeyPressedEvent = OnDataGridViewKeyPress; docsVisual = TableControl.GetControl() as DataGrid; MainProcess.ToDoCommand = "Выберите документ"; break; #endregion } case Steps.Incoming: { #region Пересчет расходных материалов MainProcess.ClearControls(); nomenclatureLabel = MainProcess.CreateLabel("<Ожидается код>", 19, 59, 215, ControlsStyle.LabelNormal).GetControl() as Label; MainProcess.CreateLabel("Запланировано:", 19, 93, 201, ControlsStyle.LabelNormal); planLabel = MainProcess.CreateLabel("0 / 0", 19, 120, 201, ControlsStyle.LabelRedRightAllign).GetControl() as Label; MainProcess.CreateLabel("Принято:", 19, 150, 201, ControlsStyle.LabelNormal); realLabel = MainProcess.CreateLabel("0 / 0", 19, 177, 201, ControlsStyle.LabelRedRightAllign).GetControl() as Label; actedLabel = MainProcess.CreateLabel("Количество брака:", 19, 228, 201, ControlsStyle.LabelNormal).GetControl() as Label; actedTextBox = MainProcess.CreateTextBox(136, 262, 81, "", ControlsStyle.LabelRedRightAllign, OnEnterToActTextbox, false).GetControl() as TextBox; uniqueCodeLabel = MainProcess.CreateLabel("Отмена - Esc", 19, 290, 201, ControlsStyle.LabelNormal).GetControl() as Label; actedLabel.Visible = false; actedTextBox.Visible = false; MainProcess.ToDoCommand = "ПРИЕМ РАСХ. МАТЕРИАЛОВ"; break; #endregion } } }
/// <summary>Выбор карты</summary> private void selectMap() { MainProcess.ClearControls(); MainProcess.Process = new SelectMap(MainProcess, 0, LampBarCode) { MapInfo = MapInfo }; }
public override void DrawControls() { MainProcess.ClearControls(); MainProcess.CreateLabel("Синхронізація!", 5, 125, 230, MobileFontSize.Large, MobileFontPosition.Center, MobileFontColors.Info, FontStyle.Bold); MainProcess.CreateLabel("Зараз оновлюється:", 5, 155, 230, MobileFontSize.Normal, MobileFontPosition.Center); infoLabel = MainProcess.CreateLabel(string.Empty, 5, 175, 230, MobileFontSize.Normal, MobileFontPosition.Center, MobileFontColors.Default, FontStyle.Bold); }
private void selectProcess(long selectedIndex, string description) { if (MainProcess.User <= 0) { "Необхідно авторизуватися (відсканувати себе)!".Warning(); return; } BusinessProcess process = null; Processes SelectedProcess = (Processes)selectedIndex; switch (SelectedProcess) { case Processes.Acceptance: MainProcess.ClearControls(); process = new Acceptance(); break; case Processes.Movement: MainProcess.ClearControls(); process = new Movement(); break; case Processes.Selection: process = tryStartPicking(); break; case Processes.Inventory: MainProcess.ClearControls(); process = new Inventory(); break; case Processes.StickerRepeating: MainProcess.ClearControls(); process = new StickerRepeating(); break; case Processes.ReturnFromHaul: MainProcess.ClearControls(); process = new ReturnFromHaul(); break; case Processes.BarcodeChecking: MainProcess.ClearControls(); process = new BarcodeChecking(); break; case Processes.IsPalletFull: MainProcess.ClearControls(); process = new IsPalletFull(); break; } if (process != null) { MainProcess.Process = process; } }
private void drawScanForm(string accessoryStr) { MainProcess.ClearControls(); MainProcess.ToDoCommand = TOPIC_OF_PROCESS; MainProcess.CreateLabel("Відскануте штрих код", 5, 150, 230, MobileFontSize.Large, MobileFontPosition.Center, MobileFontColors.Default); MainProcess.CreateLabel(accessoryStr, 5, 185, 230, MobileFontSize.Large, MobileFontPosition.Center, MobileFontColors.Info); }
/// <summary>Списание выбранного типа комплектующего</summary> private void exchange_Click(object sender) { object[] parameters = (object[])((System.Windows.Forms.Button)sender).Tag; TypeOfAccessories type = (TypeOfAccessories)parameters[0]; string topic = parameters[1].ToString(); MainProcess.ClearControls(); MainProcess.Process = new AcceptionSendingDocs(MainProcess, topic, type, typeof(SubSendingToExchangeUploadTable).Name); }
/// <summary>Приемка выбранного типа комплектующего</summary> private void acceptance_Click(object sender) { object[] parameters = (object[])((System.Windows.Forms.Button)sender).Tag; TypeOfAccessories type = (TypeOfAccessories)parameters[0]; string topic = parameters[1].ToString(); MainProcess.ClearControls(); MainProcess.Process = new AcceptanceOfNewAccessory(MainProcess, topic, type); }
public override void OnHotKey(KeyAction TypeOfAction) { switch (TypeOfAction) { case KeyAction.Esc: MainProcess.ClearControls(); MainProcess.Process = new SelectingLampProcess(MainProcess); break; } }
private void drawFinishForm() { MainProcess.ClearControls(); MainProcess.ToDoCommand = TOPIC_OF_PROCESS; MainProcess.CreateLabel("Світильник розібрано!", 5, 150, 230, MobileFontSize.Large, MobileFontPosition.Center, MobileFontColors.Default); MainProcess.CreateLabel("Зберегти дані?", 5, 185, 230, MobileFontSize.Large, MobileFontPosition.Center, MobileFontColors.Info); MainProcess.CreateButton("Ок", 10, 275, 105, 35, "ok", Save_click); MainProcess.CreateButton("Відміна", 125, 275, 105, 35, "cancel", Cancel_click); }
public override void OnHotKey(KeyAction TypeOfAction) { switch (TypeOfAction) { case KeyAction.Esc: MainProcess.ClearControls(); MainProcess.Process = new EditSelector(MainProcess); clearStaticFields(); break; } }
/// <summary>Позиция выбрана</summary> private void onRowSelected(object sender, OnRowSelectedEventArgs e) { string position = e.SelectedRow["Position"].ToString(); MainProcess.ClearControls(); MainProcess.Process = new InstallingNewLighter(MainProcess, LampBarCode) { MapInfo = MapInfo, Register = Register, Position = position }; }
public override void OnHotKey(KeyAction TypeOfAction) { textBoxControl.Hide(); switch (TypeOfAction) { case KeyAction.Esc: { if (ShowQuery("Отменить операцию (все собранные данные будут утеряны) ?")) { MainProcess.ClearControls(); MainProcess.Process = new SelectingProcess(MainProcess); } break; } case KeyAction.F1: case KeyAction.Proceed: { #region Завершение процесса if (!ShowQuery("Завершить процесс?")) { return; } if (currentBarcodeValue.Value != "") { WriteMarks(); currentBarcodeValue.Value = ""; table.ClearRows(); Nomenclature = ""; } PerformQuery("ЗаписатьОценкиПоКачествуНП", UploadToDT("SELECT NomenclatureId, DepartmentId, PalletNo FROM Pallets ORDER BY NomenclatureId"), UploadToDT("SELECT NomenclatureId, DepartmentId, CriterionsId, ParentCriterionId, Mark FROM Marks")); if (ResultParameters == null || ResultParameters[0] == null) { ShowMessage("Подойдите в зону беспроводного покрытия"); return; } MainProcess.ClearControls(); MainProcess.Process = new SelectingProcess(MainProcess); break; #endregion } } }
private void startSelectingProcess() { new SoftUpdater(); if (!initConsts()) { Warning_CantComplateOperation(); return; } MainProcess.ClearControls(); MainProcess.Process = new SelectingProcess(); }
public override void OnHotKey(KeyAction TypeOfAction) { switch (TypeOfAction) { case KeyAction.Esc: MainProcess.ClearControls(); MainProcess.Process = new InstallingNewLighter(MainProcess, LampBarCode) { MapInfo = MapInfo }; break; } }
public override sealed void DrawControls() { if (IsLoad) { MainProcess.ClearControls(); ListOfLabelsConstructor listOfLabels = new ListOfLabelsConstructor(MainProcess, "Ремонт", getUnitInfo()); List <LabelForConstructor> list = new List <LabelForConstructor>(); bool underWarrantly = underWarranty(); if (underWarrantly) { list.Add(new LabelForConstructor(string.Empty, ControlsStyle.LabelH2Red)); list.Add(new LabelForConstructor("УВАГА! Ел.блок", ControlsStyle.LabelH2Red)); list.Add(new LabelForConstructor("знаходиться на гарантії!", ControlsStyle.LabelH2Red)); } else { list.Add(new LabelForConstructor(string.Empty, ControlsStyle.LabelH2Red)); list.Add(new LabelForConstructor(string.Empty, ControlsStyle.LabelH2Red)); list.Add(new LabelForConstructor("Ел.блок не на гарантії", ControlsStyle.LabelH2)); } list.AddRange( new List <LabelForConstructor> { new LabelForConstructor(string.Empty, false), new LabelForConstructor("Модель: {0}"), new LabelForConstructor("Партія: {0}"), new LabelForConstructor("Гарантія до {0}"), new LabelForConstructor("Контрагент {0}"), new LabelForConstructor(string.Empty, false), new LabelForConstructor(underWarrantly ? "Помітити на обмін?" : string.Empty, ControlsStyle.LabelH2Red) }); listOfLabels.ListOfLabels = list; if (underWarrantly) { MainProcess.CreateButton("Так", 15, 275, 100, 35, "exchangeButton", exchange_Click); MainProcess.CreateButton("Ні", 125, 275, 100, 35, "repairButton", repair_Click); } else { MainProcess.CreateButton("Ок", 15, 275, 100, 35, "repairButton", repair_Click); MainProcess.CreateButton("Відміна", 125, 275, 100, 35, "exitButton", exit_click); } } }
/// <summary>Выбор позиции</summary> private void selectPostition() { hideTextBox(); if (string.IsNullOrEmpty(registerLabel.Text) || registerLabel.Text.Equals(NOT_CHOOSEN)) { ShowMessage("Не заполнен регистр!"); } else { MainProcess.ClearControls(); MainProcess.Process = new SelectPosition(MainProcess, MapInfo, registerLabel.Text, LampBarCode); } }
public override void OnHotKey(KeyAction TypeOfAction) { switch (TypeOfAction) { case KeyAction.Esc: MainProcess.ClearControls(); MainProcess.Process = new SelectingLampProcess(MainProcess); break; case KeyAction.Proceed: OnBarcode("9786175660690"); break; } }
/// <summary>Отображение</summary> /// <param name="id">Id</param> /// <param name="typeOfAccessories">Тип комплектующего</param> private void showInfoById(long id, TypeOfAccessories typeOfAccessories) { MainProcess.ClearControls(); ListOfLabelsConstructor list = new ListOfLabelsConstructor(MainProcess); string topic; Dictionary <string, KeyValuePair <Type, object> > listOfDetail; //Отображаем текстовое инфо о элементе list.ListOfLabels = CatalogObject.GetVisualPresenter(id, typeOfAccessories, out topic, out listOfDetail); MainProcess.ToDoCommand = topic; //Отображаем кнопки для перехода на связанные элементы drawButtons(listOfDetail); }
protected override void OnHotKey(KeyAction TypeOfAction) { switch (TypeOfAction) { case KeyAction.Esc: MainProcess.ClearControls(); MainProcess.Process = new SelectingProcess(); break; case KeyAction.Enter: selectProcess(selectedIndex, selectedDescription); break; } }
public override sealed void DrawControls() { if (IsLoad) { MainProcess.ClearControls(); MainProcess.CreateLabel("Відскануйте", 0, 130, 240, MobileFontSize.Normal, MobileFontPosition.Center, MobileFontColors.Info, FontStyle.Bold); MainProcess.CreateLabel("ШТРИХ-КОД!", 0, 150, 240, MobileFontSize.Normal, MobileFontPosition.Center, MobileFontColors.Info, FontStyle.Bold); if (currentType != typeof(Cases)) { MainProcess.CreateButton("Без штрихкода", 10, 270, 220, 35, string.Empty, () => OnBarcode(string.Empty)); } } }