예제 #1
0
        public void SaveOrUpdateSystemPermissions(PermissionTypeEnum pEnmTypePermission, IList <Permission> pLstObjPermissions)
        {
            if (pLstObjPermissions != null && pLstObjPermissions.Count > 0)
            {
                //Get permissions to update
                IList <Permission> lLstObjPermissionsToSaveOrUpdate = (from Current in mObjPermissionDAO.GetEntitiesList().Where(p => p.PermissionType == pEnmTypePermission &&
                                                                                                                                 (p.AccessType == AccessTypeEnum.MODULE || p.AccessType == AccessTypeEnum.SECTION)).ToList()
                                                                       join New in pLstObjPermissions on Current.Id equals New.Id
                                                                       where Current.AllowAccess != New.AllowAccess
                                                                       select Current).Select(x => { x.AllowAccess = !x.AllowAccess; return(x); }).ToList();

                //Get permissions to add
                lLstObjPermissionsToSaveOrUpdate = lLstObjPermissionsToSaveOrUpdate.Concat(pLstObjPermissions.Where(x => x.Id == 0)).ToList();

                //Save changes
                mObjPermissionDAO.SaveOrUpdateEntitiesList(lLstObjPermissionsToSaveOrUpdate);
            }
        }
예제 #2
0
 public void SaveOrUpdateList(List <DeductionCheckDTO> pLstObjCheckList)
 {
     mObjDeductionCheckDAO.SaveOrUpdateEntitiesList(pLstObjCheckList.Select(x => new DeductionCheck()
     {
         Id        = x.Id,
         AuctionId = x.AuctionId,
         SellerId  = x.SellerId,
         Deduct    = x.Deduct,
         Comments  = x.Comments
     })
                                                    .ToList());
 }
예제 #3
0
        public void SaveOrUpdate(FoodCharge pObjFoodCharge)
        {
            if (!Exists(pObjFoodCharge))
            {
                IList <FoodChargeLine> lLstObjLines = pObjFoodCharge.Lines;
                pObjFoodCharge.Lines = null;

                mObjFoodChargeDAO.SaveOrUpdateEntity(pObjFoodCharge);

                if (lLstObjLines != null && lLstObjLines.Count > 0)
                {
                    mObjFoodChargeLineDAO.SaveOrUpdateEntitiesList(lLstObjLines.Select(x => { x.FoodChargeId = pObjFoodCharge.Id; return(x); }).ToList());
                }
            }
            else
            {
                throw new Exception("El cobro de alimento capturado ya se encuentra registrado.");
            }
        }
예제 #4
0
        public void SaveOrUpdate(JournalEntry pObjJournalEntry)
        {
            if (!Exists(pObjJournalEntry))
            {
                IList <JournalEntryLine> lLstObjLines = pObjJournalEntry.Lines;
                pObjJournalEntry.Lines = null;

                mObjJournalEntryDAO.SaveOrUpdateEntity(pObjJournalEntry);

                if (lLstObjLines != null && lLstObjLines.Count > 0)
                {
                    mObjJournalEntryLineDAO.SaveOrUpdateEntitiesList(lLstObjLines.Select(x => { x.JournalEntryId = pObjJournalEntry.Id; return(x); }).ToList());
                }
            }
            else
            {
                throw new Exception("La factura capturada ya se encuentra registrada.");
            }
        }
예제 #5
0
        public void SaveOrUpdate(Invoice pObjInvoice)
        {
            if (!Exists(pObjInvoice))
            {
                IList <InvoiceLine> lLstObjLines = pObjInvoice.Lines;
                pObjInvoice.Lines = null;

                mObjInvoiceDAO.SaveOrUpdateEntity(pObjInvoice);

                if (lLstObjLines != null && lLstObjLines.Count > 0)
                {
                    mObjInvoiceLineDAO.SaveOrUpdateEntitiesList(lLstObjLines.Select(x => { x.InvoiceId = pObjInvoice.Id; return(x); }).ToList());
                }
            }
            else
            {
                throw new Exception("La factura capturada ya se encuentra registrada.");
            }
        }
예제 #6
0
        //public bool ApplyFoodCharge(long pLonSellerId,DateTime pAuctionDate)
        //{
        //    return Exists(pLonSellerId, pAuctionDate) ? GetApplyFoodCharge(pStrBatchNumber, pLonSellerId) : CalculateApplyFoodCharge(pStrBatchNumber, pLonSellerId);
        //}

        public void SaveOrUpdateList(IList <FoodChargeCheck> pLstObjCheckList)
        {
            mObjFoodChargeCheckListDAO.SaveOrUpdateEntitiesList(pLstObjCheckList);
        }
예제 #7
0
 public void SaveOrUpdateList(IList <PartnerMapping> pLstObjPartnerMapping)
 {
     mObjPartnerMappingDAO.SaveOrUpdateEntitiesList(pLstObjPartnerMapping);
 }
예제 #8
0
 public void SaveOrUpdateList(IList <GuideCharge> pLstObjGuideCharges)
 {
     mObjGuideChargeDAO.SaveOrUpdateEntitiesList(pLstObjGuideCharges);
 }
예제 #9
0
 public void SaveOrUpdateEntityList(List <Batch> pLstBatch)
 {
     mObjBatchDAO.SaveOrUpdateEntitiesList(pLstBatch);
 }