示例#1
0
        /// <summary>
        /// si ya se entrego por lo menos un paquete en regalos (Para evitar convertir en paquete un regalo ya otorgado)
        /// </summary>
        /// <history>
        /// [emoguel] created 11/07/2016
        /// </history>
        private async void GiftInPack()
        {
            if (enumMode == EnumMode.Edit)
            {
                var lstGiftsDetail = await BRGiftsReceiptDetail.GetGiftsReceiptDetail(new GiftsReceiptDetail { gegi = gift.giID });

                chkgiPack.IsEnabled      = (lstGiftsDetail.Count < 1);
                dgrGiftInPack.IsReadOnly = (lstGiftsDetail.Count > 0);
            }
        }
示例#2
0
        /// <summary>
        /// guardamos los regalos cancelados
        /// </summary>
        /// <param name="pReceiptID"></param>
        /// <param name="pReceiptExchangeID"></param>
        /// <param name="pGiftsCancelled"></param>
        /// <param name="pUseCxCCost"></param>
        /// <returns></returns>
        /// <history>
        /// [vipacheco] 18/Julio/2016 Created
        /// </history>
        public async static Task Save(int pReceiptID, int pReceiptExchangeID, List <string> pGiftsCancelled, bool pUseCxCCost, GiftsReceipt pGiftsReceipt, ObservableCollection <GiftsReceiptDetail> pGiftsReceiptsDetail, ObservableCollection <GiftsReceiptDetailCancel> pGiftsCancel, bool pIsExchange, string pCancelFiel)
        {
            // obtenemos los regalos del recibo original para marcarlos como cancelados
            List <GiftsReceiptDetail> lstResult = await BRGiftsReceiptDetail.GetGiftsReceiptDetail(pReceiptID);

            // Recorremos los regalos cancelados
            foreach (string iGift in pGiftsCancelled)
            {
                // Localizamos los regalos cancelados
                GiftsReceiptDetail giftupdate = lstResult.Where(x => x.gegi == iGift).Single();
                Gift gift = frmHost._lstGifts.Where(x => x.giID == giftupdate.gegi).Single();

                // marcamos el regalo como cancelado en el recibo original
                giftupdate.GetType().GetProperty(pCancelFiel).SetValue(giftupdate, true, null);

                // si se debe generar un recibo exchange
                if (pIsExchange)
                {
                    // agregamos el regalo en el recibo exchange
                    await AddGiftExchange(pReceiptExchangeID, giftupdate, pGiftsCancelled);
                }
            }
        }