예제 #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="e"></param>
        protected override void ReactionSCItemDo(ReactionSCEventArgs e)
        {
            if (CurrentAction != ActionSet.ScanItem)
            {
                Negative("Неверно! " + SS.WhatUNeed(CurrentAction));
                return;
            }

            RefItem item = e.Ref as RefItem;

            DataRow[] DR = RemainItems.Select("item = '" + item.ID + "'");
            if (DR.Length == 0)
            {
                Negative("Товар " + item.InvCode + " не найден. Возможно уже выложили?");
                return;
            }

            //Всасываем все говно в наши объекты
            Adress0.FoundID(DR[0]["Adress0"].ToString());
            Amount        = (int)(decimal)DR[0]["Amount"];
            Item          = item;
            lineno_       = (short)DR[0]["lineno_"];
            CurrentAction = ActionSet.ScanAdress;
            Positive(SS.WhatUNeed(CurrentAction));
        } // ReactionSCItemDo
예제 #2
0
 public RefillLayout(Model ReadySS, ABaseMode CallObj)
     : base(ReadySS, CallObj)
 {
     CurrentMode    = Mode.RefillLayout;
     DocAP          = (CallObj as RefillChoise).DocAP;
     lineno_        = 0;
     Adress0        = new RefSection(SS);
     Adress1        = new RefSection(SS);
     LastMove       = new RefPalleteMove(SS);
     Item           = new RefItem(SS);
     PreviousAction = "";
     RemainItems    = new DataTable();
 }
예제 #3
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));
                }
            }
        }
예제 #4
0
파일: RefillSet.cs 프로젝트: sanekkop/WPM
        } // CollectedLines
        /// <summary>
        ///
        /// </summary>
        /// <param name="ReadySS"></param>
        /// <param name="CallObj"></param>
        public RefillSet(Model ReadySS, ABaseMode CallObj)
            : base(ReadySS, CallObj)
        {
            //Стандартные включалки
            CurrentMode     = Mode.RefillSet;
            ReactionSCItem += new ReactionSCItemHandler(RefillSet_ReactionSCItem);
            DocAP           = (CallObj as RefillChoise).DocAP;

            //Просто
            Adress0        = new RefSection(SS);
            Adress1        = new RefSection(SS);
            Item           = new RefItem(SS);
            PreviousAction = "";
        } // RefillSet (constructor)
예제 #5
0
        public int IndexTableItem; //индекс строчки

        public ControlCollect(Model ReadySS, ABaseMode CallObj)
            : base(ReadySS, CallObj)
        {
            CurrentMode    = Mode.ControlCollect;
            ControlCC      = null;
            Item           = new RefItem(SS);
            LabelControlCC = null;
            GoodsCC        = new DataTable();
            GoodsCC.Columns.Add("Number", Type.GetType("System.Int32"));
            GoodsCC.Columns.Add("Artikul", Type.GetType("System.String"));
            GoodsCC.Columns.Add("NameItem", Type.GetType("System.String"));
            GoodsCC.Columns.Add("Count", Type.GetType("System.Int32"));
            GoodsCC.Columns.Add("ID", Type.GetType("System.String"));
        }
예제 #6
0
파일: RefillSet.cs 프로젝트: sanekkop/WPM
        /// <summary>
        ///
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void RefillSet_ReactionSCItem(object sender, ReactionSCEventArgs e)
        {
            if (CurrentAction != ActionSet.ScanItem)
            {
                Negative("Неверно! " + SS.WhatUNeed(CurrentAction));
                return;
            }

            RefItem item = e.Ref as RefItem;

            if (item.ID != Item.ID)
            {
                Negative("Не тот товар! " + SS.WhatUNeed(CurrentAction));
                return;
            }
            CurrentAction = ActionSet.EnterCount;
            Positive(SS.WhatUNeed(CurrentAction));
        } // RefillSet_ReactionSCItem
예제 #7
0
        public ItemCard(Model ReadySS, ABaseMode CallObj)
            : base(ReadySS, CallObj)
        {
            CurrentMode = Mode.ItemCard;
            OldMode     = CallObj;
            try
            {
                Item = (CallObj as RefillLayout).Item;
            }
            catch
            {
                Item = (CallObj as ControlCollect).Item;
            }

            if (!Item.Selected)
            {
                //нет товара, значит достанем последний товар
                DataTable MyRemainItems = (CallObj as RefillLayout).RemainItems;
                Item.FoundID(MyRemainItems.Rows[0]["Item"].ToString());
            }
        } // ItemCard (constructor)
예제 #8
0
파일: RefillSet.cs 프로젝트: sanekkop/WPM
        } // RefillSet_ReactionSCItem

        //----------------------------------
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        private ABaseMode Refresh()
        {
            DocAP.Refresh();
            if (RobotWaiting)
            {
                CurrentAction = ActionSet.Waiting;
                return(Negative("1С не ответила! (флаг ожидания)"));
            }
            string TextQuery =
                "select top 1 " +
                "DocAP.$АдресПеремещение.Адрес0 as Adress0, " +
                "DocAP.$АдресПеремещение.Адрес1 as Adress1, " +
                "DocAP.$АдресПеремещение.Количество as Amount, " +
                "DocAP.$АдресПеремещение.Товар as Item, " +
                "DocAP.lineno_ as lineno_ " +
                "from DT$АдресПеремещение as DocAP (nolock) " +
                "where " +
                "DocAP.$АдресПеремещение.Дата1 = :EmptyDate " +
                "and DocAP.iddoc = :iddoc " +
                "and DocAP.$АдресПеремещение.Количество > 0 ";

            SQL1S.QuerySetParam(ref TextQuery, "iddoc", DocAP.ID);
            DataTable DT;

            SS.ExecuteWithReadNew(TextQuery, out DT);
            if (DT.Rows.Count == 0)
            {
                return(JumpTo(new RefillSetComplete(SS, this)));
            }
            //Всасываем все говно в наши объекты
            Adress0.FoundID(DT.Rows[0]["Adress0"].ToString());
            Adress1.FoundID(DT.Rows[0]["Adress1"].ToString());
            Amount = (int)(decimal)DT.Rows[0]["Amount"];
            Item   = new RefItem(SS); //Есть бага в объекте ARef, поэтому пересоздаем
            Item.FoundID(DT.Rows[0]["Item"].ToString());
            lineno_ = (short)DT.Rows[0]["lineno_"];

            CurrentAction = ActionSet.ScanAdress;
            return(Positive(SS.WhatUNeed(CurrentAction)));
        } // Refresh
예제 #9
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;
        }
예제 #10
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="key"></param>
        protected override void ReactionKeyDo(Keys key)
        {
            if ((Helper.IsGreenKey(key) || key == Keys.Enter) && (GoodsCC.Rows.Count > 0))
            {
                Item = new RefItem(SS);
                Item.FoundID(GoodsCC.Rows[IndexTableItem]["ID"].ToString());
                JumpTo(new ItemCard(SS, this));
            }
            else if (key == Keys.Escape)
            {
                if (ControlCC == null)
                {
                    SS.OnReport(new ReportEventArgs("Задача выбрана..."));
                    JumpTo(new ChoiseWork(SS, this));
                }
                else
                {
                    GoodsCC.Clear();
                    ControlCC      = null;
                    LabelControlCC = null;
                    Item           = new RefItem(SS);
                    Positive("Ожидание команды");
                    return;
                }
            }
            else if (key == Keys.Up)
            {
                if (GoodsCC.Rows.Count == 0)
                {
                    IndexTableItem = 0;
                    return;
                }
                if (IndexTableItem > 0)
                {
                    IndexTableItem--;
                }
                else
                {
                    IndexTableItem = GoodsCC.Rows.Count - 1;
                }
                Positive();
                return;
            }

            else if (key == Keys.Down)
            {
                if (GoodsCC.Rows.Count == 0)
                {
                    IndexTableItem = 0;
                    return;
                }
                if (IndexTableItem < GoodsCC.Rows.Count - 1)
                {
                    IndexTableItem++;
                }
                else
                {
                    IndexTableItem = 0;
                }
                Positive();
                return;
            }
        } // ReactionKeyDo