Exemple #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
Exemple #2
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 #3
0
 private void OnReactionSCItem(ReactionSCEventArgs e)
 {
     ThereHandlerDo = true;  //Если функцию ниже никто не наследует, то это значение поменяется на false
     ReactionSCItemDo(e);
     ThereHandler = ThereHandler ? ThereHandler : ThereHandlerDo;    //если уже взведен, то не трогаем, иначе берет значение предыдущего флага
     if (ReactionSCItem != null)
     {
         ReactionSCItem(this, e);
         ThereHandler = true;
     }
 }
Exemple #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));
                }
            }
        }
Exemple #5
0
        /// <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
Exemple #6
0
 protected virtual void ReactionSCItemDo(ReactionSCEventArgs e)
 {
     ThereHandlerDo = false;
 }
Exemple #7
0
 protected override void ReactionSCItemDo(ReactionSCEventArgs e)
 {
 }