Exemple #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);
            }
        }
 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());
 }
Exemple #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.");
            }
        }
Exemple #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.");
            }
        }
Exemple #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.");
            }
        }
Exemple #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);
        }
 public void SaveOrUpdateList(IList <PartnerMapping> pLstObjPartnerMapping)
 {
     mObjPartnerMappingDAO.SaveOrUpdateEntitiesList(pLstObjPartnerMapping);
 }
Exemple #8
0
 public void SaveOrUpdateList(IList <GuideCharge> pLstObjGuideCharges)
 {
     mObjGuideChargeDAO.SaveOrUpdateEntitiesList(pLstObjGuideCharges);
 }
Exemple #9
0
 public void SaveOrUpdateEntityList(List <Batch> pLstBatch)
 {
     mObjBatchDAO.SaveOrUpdateEntitiesList(pLstBatch);
 }