Beispiel #1
0
        } // 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();
        }
Beispiel #2
0
 private void OnReactionSCBox(RefBox e)
 {
     if (ReactionSCBox != null)
     {
         ReactionSCBox(this, e);
         ThereHandler = true;
     }
 }
Beispiel #3
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="ReadySS"></param>
        /// <param name="CallObj"></param>
        public UnLoading(Model ReadySS, ABaseMode CallObj)
            : base(ReadySS, CallObj)
        {
            //Стандартные включалки
            CurrentMode = Mode.UnLoading;

            //Просто
            AdressUnLoad   = new RefSection(SS);
            BoxUnLoad      = new RefBox(SS);
            DocUnload      = new Doc(SS);
            DocCC          = new StructBox();
            PreviousAction = "";
        } // RefillSet (constructor)
Beispiel #4
0
        } // ReactionKeyDo

        protected override void ReactionSCDo(ReactionSCEventArgs e)
        {
            if (e.Ref.GetType() == new RefBox(SS).GetType())
            {
                RefBox Box = e.Ref as RefBox;

                Doc doc = new Doc(SS);
                doc.FoundID(Box.GetAttribute("КонтрольНабора").ToString());
                RefreshDoc(doc);
                return;
            }
            else if (e.Ref.GetType() == new RefItem(SS).GetType())
            {
                Item = e.Ref as RefItem;

                string ItemID    = Item.ID.ToString();
                string LabelItem = Item.InvCode.ToString().Trim() + " " + Item.Name.ToString().Trim();

                if (ControlCC == null)
                {
                    Negative("Не выбран сборочный лист!");
                    return;
                }
                String TextQuery =
                    "SELECT " +
                    "Goods.$Спр.Товары.ИнвКод as InvCode, " +
                    "DocCC.$КонтрольНабора.Количество as Count " +
                    "FROM DT$КонтрольНабора as DocCC (nolock) " +
                    "JOIN $Спр.Товары as Goods (nolock) " +
                    "ON Goods.Id = DocCC.$КонтрольНабора.Товар " +
                    "WHERE " +
                    "Goods.id = :ItemID " +
                    "and DocCC.iddoc = :iddoc";
                SQL1S.QuerySetParam(ref TextQuery, "ItemID", ItemID);
                SQL1S.QuerySetParam(ref TextQuery, "iddoc", ControlCC);
                DataTable DT;
                if (!SS.ExecuteWithRead(TextQuery, out DT))
                {
                    return;
                }
                if (DT.Rows.Count == 0)
                {
                    Negative("В сборочном нет " + LabelItem);
                    return;
                }
                else
                {
                    JumpTo(new ItemCard(SS, this));
                }
            }
        }
Beispiel #5
0
        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;
        }