Exemple #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();
        }
Exemple #2
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
Exemple #3
0
        public RefSection CompleteAdress; //Адрес комплектации

        private void Constructor()
        {
            Proposal       = new Doc(SS);
            TransferWindow = new RefSection(SS);
            SectorCC       = new RefSection(SS);
            Setter         = new RefEmployer(SS);
            DocCB          = new Doc(SS);
            CompleteAdress = new RefSection(SS);
            DocCB.FoundID(DocCC.GetAttributeHeader("ДокументОснование").ToString());
            Proposal.FoundID(DocCB.GetAttributeHeader("ДокументОснование").ToString());
            SectorCC.FoundID(DocCC.GetAttributeHeader("Сектор").ToString());
            TransferWindow.FoundID(DocCB.GetAttributeHeader("АдресОбразцов").ToString());
            CompleteAdress.FoundID(DocCB.GetAttributeHeader("АдресКомплектации").ToString());
            Setter.FoundID(DocCC.GetAttributeHeader("Наборщик").ToString());
            CurrentMode = Mode.SetTransfer;
            FVoiceOn    = true;
        }
Exemple #4
0
        } // 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