} // ReactionKeyDo /// <summary> /// /// </summary> /// <param name="e"></param> protected override void ReactionSCDo(ReactionSCEventArgs e) { if (CurrentAction == ActionSet.ScanAdress) { if (e.Ref.GetType() != new RefSection(SS).GetType()) { Negative("Неверно! " + SS.WhatUNeed(CurrentAction)); return; } RefSection Section = e.Ref as RefSection; AdressUnLoad.FoundID(Section.ID); string TextQuery = "UPDATE $Спр.МестаПогрузки " + "SET " + "$Спр.МестаПогрузки.Адрес9 = :AdressID ," + "$Спр.МестаПогрузки.Сотрудник8 = :EmployerID ," + "$Спр.МестаПогрузки.Дата9 = :Date ," + "$Спр.МестаПогрузки.Время9 = :Time " + "WHERE "; if (DocUnload.Selected) { TextQuery += " $Спр.МестаПогрузки .КонтрольНабора = :DocUnload "; SQL1S.QuerySetParam(ref TextQuery, "DocUnload", DocUnload.ID); } else { TextQuery += " $Спр.МестаПогрузки .ID = :ID "; SQL1S.QuerySetParam(ref TextQuery, "ID", BoxUnLoad.ID); } SQL1S.QuerySetParam(ref TextQuery, "AdressID", AdressUnLoad.ID); SQL1S.QuerySetParam(ref TextQuery, "EmployerID", Employer.ID); SQL1S.QuerySetParam(ref TextQuery, "Date", DateTime.Now); SQL1S.QuerySetParam(ref TextQuery, "Time", APIManager.NowSecond()); if (!SS.ExecuteWithoutRead(TextQuery)) { Negative("Не удалось зафиксировать! " + SS.WhatUNeed(CurrentAction)); return; } CurrentAction = ActionSet.ScanBox; Refresh(); return; } else if (CurrentAction != ActionSet.ScanBox) { Negative("Неверно! " + SS.WhatUNeed(CurrentAction)); return; } if (e.Ref.GetType() != new RefBox(SS).GetType()) { Negative("Неверно! " + SS.WhatUNeed(CurrentAction)); return; } RefBox Box = e.Ref as RefBox; BoxUnLoad.FoundID(Box.ID); DocUnload = new Doc(SS); CurrentAction = ActionSet.ScanAdress; AdressUnLoad = new RefSection(SS); Refresh(); }
internal virtual ABaseMode ReactionBarcodeBase(string Barcode) { JumpCounter = 0; FResult = MMResult.None; ResultObject = this; ThereHandler = false; Dictionary<string, string> dicBarcode = Helper.DisassembleBarcode(Barcode); bool IsRef = false; bool IsObject = false; //Это реально существующий объект //Это может быть справочник! ARef Ref = null; if (Barcode.Substring(0, 2) == "25" && dicBarcode["Type"] == "113") { Ref = new RefEmployer(SS); if (Ref.FoundIDD(dicBarcode["IDD"])) { IsRef = true; OnReactionSCEmployers(Ref as RefEmployer); } if (!IsRef) { Ref = new RefSection(SS); if (Ref.FoundIDD(dicBarcode["IDD"])) { IsRef = true; OnReactionSCSection(Ref as RefSection); } } if (!IsRef) { Ref = new RefPrinter(SS); if (Ref.FoundIDD(dicBarcode["IDD"])) { IsRef = true; OnReactionSCPrinter(Ref as RefPrinter); } } } else if (dicBarcode["Type"] == "6") { Ref = new RefBox(SS); if (Ref.FoundID(dicBarcode["ID"])) { IsRef = true; OnReactionSCBox(Ref as RefBox); } } else if (Barcode.Substring(0, 2) == "26" && dicBarcode["Type"] == "113") { Doc Doc = new Doc(SS); if (Doc.FoundIDD(dicBarcode["IDD"])) { IsObject = true; OnReactionDoc(Doc); } } else if (dicBarcode["Type"] == "pallete") { //ВОТ ЭТА ХУЕТА НИ КАК НЕ УЧИТЫВАЕТСЯ (КАК ОБЪЕКТ, ВСМЫСЛЕ) // ТАК ЧТО ПОТЕНЦИАЛЬНО МОГУТ БЫТЬ ПРОБЛЕМЫ НА ВСЯКИЙ СЛУЧАЙ ВЗВОДИМ ФЛАГ IsObject = true; //OnReactionPallete(Convert.ToInt32(dicBarcode["pallete"])); OnReactionPallete(Barcode); } IsObject = IsRef ? true : IsObject; //Если это справочник, то полюбому объект if (!IsObject) { //Товаром он может быть при любом раскладе, так что если не определился как объект, то будем искать товар Ref = new RefItem(SS); if ((Ref as RefItem).FoundBarcode(Barcode)) { { IsRef = true; OnReactionSCItem(new ReactionSCEventArgs(Barcode, Ref)); } } } if (IsRef) { //Вверху обрабатывали только справочники и в какой-то из них попали OnReactionSC(new ReactionSCEventArgs(Barcode, Ref)); } OnReactionBarcode(Barcode); // просто реакция на штрихкод if (!ThereHandler) { //никакой обработчик не сработал! Отобъем исходя из настроек по умолчанию FExcStr = "Нет действий с этим ШК в данном режиме!"; FResult = MMResult.Negative; } return ResultObject; }