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();
        }