} // ReactionSCSectionDo /// <summary> /// /// </summary> /// <returns></returns> private ABaseMode Refresh() { string TextQuery = "select " + "DocAP.$АдресПеремещение.Адрес0 as Adress0, " + "RefSections.descr as Adress, " + "DocAP.$АдресПеремещение.Количество as Amount, " + "DocAP.$АдресПеремещение.Товар as Item, " + "RefItems.Descr as Name, " + "RefItems.$Спр.Товары.ИнвКод as InvCode, " + "DocAP.lineno_ as lineno_ " + "from DT$АдресПеремещение as DocAP (nolock) " + "left join $Спр.Товары as RefItems (nolock) " + "on RefItems.id = DocAP.$АдресПеремещение.Товар " + "left join $Спр.Секции as RefSections (nolock) " + "on RefSections.id = DocAP.$АдресПеремещение.Адрес0 " + "where " + "DocAP.$АдресПеремещение.Дата1 = :EmptyDate " + "and DocAP.iddoc = :iddoc"; SQL1S.QuerySetParam(ref TextQuery, "iddoc", DocAP.ID); RemainItems.Clear(); SS.ExecuteWithReadNew(TextQuery, out RemainItems); if (RemainItems.Rows.Count == 0) { return(JumpTo(new RefillLayoutComplete(SS, this))); } string tmpBarcodePallete = DocAP.GetAttributeHeader("ШКПаллеты").ToString(); TextQuery = "select top 1 " + "Ref.id as id " + "from $Спр.ПеремещенияПаллет as Ref (nolock) " + "where " + "Ref.$Спр.ПеремещенияПаллет.ШКПаллеты = :PalleteBarcode " + "and Ref.ismark = 0 " + "order by " + "Ref.id desc "; SQL1S.QuerySetParam(ref TextQuery, "PalleteBarcode", tmpBarcodePallete); DataTable DT; SS.ExecuteWithReadNew(TextQuery, out DT); if (DT.Rows.Count > 0) { LastMove.FoundID(DT.Rows[0]["id"].ToString()); } CurrentAction = ActionSet.ScanItem; return(Positive(SS.WhatUNeed(CurrentAction))); } // Refresh
} // 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