Exemple #1
0
        public void PositionUp(long pLonId)
        {
            IList <Module> lLstObjModules = mObjModuleDAO.GetEntitiesList()
                                            .OrderBy(a => a.Position)
                                            .ThenBy(b => b.Name)
                                            .AsEnumerable()
                                            .Select((c, i) => { c.Position = i + 1; return(c); })
                                            .ToList();

            Module lObjModule = lLstObjModules.FirstOrDefault(x => x.Id == pLonId);
            int    lIntIndex  = lLstObjModules.IndexOf(lObjModule);

            if (lIntIndex > 0)
            {
                int LIntIndexTemp = lLstObjModules[lIntIndex - 1].Position;
                lLstObjModules[lIntIndex - 1].Position = lLstObjModules[lIntIndex].Position;
                lLstObjModules[lIntIndex].Position     = LIntIndexTemp;

                mObjModuleDAO.SaveOrUpdateEntity(lLstObjModules[lIntIndex - 1]);
                mObjModuleDAO.SaveOrUpdateEntity(lLstObjModules[lIntIndex]);
            }
            else
            {
                throw new Exception("El registro ya tiene la primera posición.");
            }
        }
Exemple #2
0
 public void SaveOrUpdate(User pObjUser)
 {
     if (!ExistsUser(pObjUser.UserName, pObjUser.Id))
     {
         pObjUser.Password = pObjUser.Password.Encode();
         mObjUserDAO.SaveOrUpdateEntity(pObjUser);
     }
     else
     {
         throw new Exception("El usuario ingresado ya existe.");
     }
 }
Exemple #3
0
 public void SaveOrUpdate(Item pObjItem)
 {
     if (!Exists(pObjItem))
     {
         mObjItemDAO.SaveOrUpdateEntity(pObjItem);
     }
     else
     {
         throw new Exception("El artículo ingresado ya existe.");
     }
 }
 public void SaveOrUpdate(ItemTypeDefinition pObjItemDefinition)
 {
     if (!Exists(pObjItemDefinition))
     {
         mObjItemTypeDefinitionDAO.SaveOrUpdateEntity(pObjItemDefinition);
     }
     else
     {
         throw new Exception("La definición ingresada ya existe.");
     }
 }
Exemple #5
0
 public void SaveOrUpdate(Auction pObjAuction)
 {
     if (!Exists(pObjAuction))
     {
         mObjAuctionDAO.SaveOrUpdateEntity(pObjAuction);
     }
     else
     {
         throw new Exception("La subasta ingresada ya existe.");
     }
 }
 public void SaveOrUpdate(PartnerMapping pObjPartnerMapping)
 {
     if (!Exists(pObjPartnerMapping))
     {
         mObjPartnerMappingDAO.SaveOrUpdateEntity(pObjPartnerMapping);
     }
     else
     {
         throw new Exception("El mapeo del socio de negocio temporal ingresado ya se encuentra registrado.");
     }
 }
Exemple #7
0
 public void SaveOrUpdate(UserType pObjUserType)
 {
     if (!Exists(pObjUserType))
     {
         mObjUserTypeDAO.SaveOrUpdateEntity(pObjUserType);
     }
     else
     {
         throw new Exception("El tipo de usuario ingresado ya existe.");
     }
 }
Exemple #8
0
 public void SaveOrUpdate(Configuration pObjConfiguration)
 {
     if (!Exists(pObjConfiguration))
     {
         mObjConfigurationDAO.SaveOrUpdateEntity(pObjConfiguration);
     }
     else
     {
         throw new Exception("Registro existente.");
     }
 }
Exemple #9
0
 public void SaveOrUpdate(BatchLine pObjBatchLine)
 {
     if (!Exists(pObjBatchLine))
     {
         mObjBatchLineDAO.SaveOrUpdateEntity(pObjBatchLine);
     }
     else
     {
         throw new Exception("La linea de lote ingresada ya existe.");
     }
 }
Exemple #10
0
 public void SaveOrUpdate(Partner pObjPartner)
 {
     if (!Exists(pObjPartner))
     {
         mObjPartnerDAO.SaveOrUpdateEntity(pObjPartner);
     }
     else
     {
         throw new Exception("El cliente ingresado ya existe.");
     }
 }
Exemple #11
0
 public void SaveOrUpdate(FoodDelivery pObjFoodDelivery)
 {
     if (!Exists(pObjFoodDelivery))
     {
         mObjFoodDeliveryDAO.SaveOrUpdateEntity(pObjFoodDelivery);
     }
     else
     {
         throw new Exception("La entrega de mercancía ya se encuentra registrada.");
     }
 }
Exemple #12
0
 public void SaveOrUpdate(Batch pObjBatch)
 {
     if (!Exists(pObjBatch))
     {
         mObjBatchDAO.SaveOrUpdateEntity(pObjBatch);
     }
     else
     {
         throw new Exception("El lote ingresado ya existe.");
     }
 }
Exemple #13
0
 public void SaveOrUpdate(ItemType pObjItemType)
 {
     if (!Exists(pObjItemType))
     {
         mObjItemTypeDAO.SaveOrUpdateEntity(pObjItemType);
     }
     else
     {
         throw new Exception("El tipo de artículo ingresado ya existe.");
     }
 }
Exemple #14
0
 public void SaveOrUpdate(PartnerClassification pObjPartnerClassification)
 {
     if (!Exists(pObjPartnerClassification))
     {
         mObjPartnerClassificationDAO.SaveOrUpdateEntity(pObjPartnerClassification);
     }
     else
     {
         throw new Exception("La clasificación ingresada ya existe.");
     }
 }
Exemple #15
0
        //public void CreateGoodsReturn(IList<DetailedBatchDTO> pLstObjDetailedBatches)
        //{
        //    foreach (var lObjDetailedBatch in pLstObjDetailedBatches)
        //    {
        //        CreateGoodsReturn(lObjDetailedBatch);
        //    }
        //}

        //public void CreateGoodsReturn(DetailedBatchDTO pObjDetailedBatch)
        //{
        //        //Valid availability
        //        if (pObjDetailedBatch.QuantityToPick > 0 && GetAvailableQuantity(pObjDetailedBatch) >= pObjDetailedBatch.QuantityToPick)
        //        {
        //            //Get item batches from lines
        //            foreach (var lObjLine in pObjDetailedBatch.Lines.Where(x => GetAvailableQuantity(pObjDetailedBatch, x) > 0))
        //            {
        //                if (pObjDetailedBatch.QuantityToPick > 0 && GetAvailableQuantity(pObjDetailedBatch) >= pObjDetailedBatch.QuantityToPick)
        //                {
        //                    //Get quantity to apply
        //                    int lIntQuantityToApply = pObjDetailedBatch.QuantityToPick > GetAvailableQuantity(pObjDetailedBatch, lObjLine) ? GetAvailableQuantity(pObjDetailedBatch, lObjLine) : pObjDetailedBatch.QuantityToPick;

        //                    //Create Goods Return
        //                    GoodsReturn lObjGoodsReturn = new GoodsReturn()
        //                    {
        //                        BatchId = pObjDetailedBatch.Id,
        //                        Quantity = lIntQuantityToApply,
        //                        //BatchNumber = lObjLine.BatchNumber,
        //                        //BatchDate = lObjLine.BatchDate,
        //                        //ItemId = lObjLine.ItemId,
        //                        Delivered = pObjDetailedBatch.Delivered,
        //                        Exported = false
        //                    };

        //                    //Add Goods Return
        //                    mObjGoodsReturnDAO.AddEntity(lObjGoodsReturn);

        //                    //Update quantities
        //                    pObjDetailedBatch.ReturnedQuantity += lIntQuantityToApply;
        //                    lObjLine.ReturnedQuantity += lIntQuantityToApply;
        //                    pObjDetailedBatch.QuantityToPick -= lIntQuantityToApply;

        //                    if (pObjDetailedBatch.Delivered)
        //                    {
        //                        pObjDetailedBatch.AvailableQuantityToReturnDelivery -= lIntQuantityToApply;
        //                        lObjLine.AvailableQuantityToReturnDelivery -= lIntQuantityToApply;
        //                    }
        //                    else
        //                    {
        //                        pObjDetailedBatch.AvailableQuantityToReturn -= lIntQuantityToApply;
        //                        lObjLine.AvailableQuantityToReturn -= lIntQuantityToApply;
        //                    }
        //                }
        //            }

        //            //Update Batch
        //            mObjBatchDAO.SaveOrUpdateEntity(mObjBatchDAO.GetEntity(pObjDetailedBatch.Id));
        //        }
        //    }

        public void CreateGoodsReturn(DetailedBatchDTO pObjDetailedBatch, int pIntQttyToReturn, int pIntDeliveredQtty)
        {
            //Valid availability
            if (pObjDetailedBatch.QuantityToPick > 0 && GetAvailableQuantity(pObjDetailedBatch, pIntQttyToReturn, pIntDeliveredQtty) >= pObjDetailedBatch.QuantityToPick)
            {
                //Get quantity to apply
                int lIntQuantityToApply = pObjDetailedBatch.QuantityToPick > GetAvailableQuantity(pObjDetailedBatch, pIntQttyToReturn, pIntDeliveredQtty) ? GetAvailableQuantity(pObjDetailedBatch, pIntQttyToReturn, pIntDeliveredQtty)
                            : pObjDetailedBatch.QuantityToPick;

                //Create Goods Return
                GoodsReturn lObjGoodsReturn = new GoodsReturn()
                {
                    BatchId      = pObjDetailedBatch.Id,
                    Quantity     = lIntQuantityToApply,
                    Weight       = pObjDetailedBatch.Weight,
                    Delivered    = pObjDetailedBatch.Delivered,
                    Exported     = false,
                    ReturnMotive = pObjDetailedBatch.ReturnMotive
                };

                //Add Goods Return
                mObjGoodsReturnDAO.AddEntity(lObjGoodsReturn);

                //Update quantities
                pObjDetailedBatch.ReturnedQuantity += lIntQuantityToApply;
                //lObjLine.ReturnedQuantity += lIntQuantityToApply;
                pObjDetailedBatch.QuantityToPick -= lIntQuantityToApply;

                if (pObjDetailedBatch.Delivered)
                {
                    pObjDetailedBatch.AvailableQuantityToReturnDelivery -= lIntQuantityToApply;
                    //lObjLine.AvailableQuantityToReturnDelivery -= lIntQuantityToApply;
                }
                else
                {
                    pObjDetailedBatch.AvailableQuantityToReturn -= lIntQuantityToApply;
                    //lObjLine.AvailableQuantityToReturn -= lIntQuantityToApply;
                }



                ////Update Batch
                mObjBatchDAO.SaveOrUpdateEntity(mObjBatchDAO.GetEntity(pObjDetailedBatch.Id));
            }
        }
Exemple #16
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 #17
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 #18
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 #19
0
 public void SaveOrUpdate(FoodCharge pObjFoodCharge)
 {
     mObjFoodChargeDAO.SaveOrUpdateEntity(pObjFoodCharge);
     //if(!Exist)
 }
Exemple #20
0
 public void Save(FoodChargeCheck pObjFoodChargeCheck)
 {
     mObjFoodChargeCheckListDAO.SaveOrUpdateEntity(pObjFoodChargeCheck);
 }
Exemple #21
0
 public void SaveOrUpdate(GoodsReceipt pObjGoodsReceipt)
 {
     mObjGoodsReceiptDAO.SaveOrUpdateEntity(pObjGoodsReceipt);
 }
Exemple #22
0
 public void SaveOrUpdate(GoodsReturn pObjGoodsReturn)
 {
     mObjGoodsReturnDAO.SaveOrUpdateEntity(pObjGoodsReturn);
 }
Exemple #23
0
 public void SaveOrUpdate(Stock pObjItemType)
 {
     mObjStockDAO.SaveOrUpdateEntity(pObjItemType);
 }
Exemple #24
0
 public void SaveOrUpdate(InvoiceLine pObjInvoiceLine)
 {
     mObjInvoiceLineDAO.SaveOrUpdateEntity(pObjInvoiceLine);
 }
Exemple #25
0
 public void SaveOrUpdate(FoodChargeLine pObjFoodChargeLine)
 {
     mObjFoodChargeLineDAO.SaveOrUpdateEntity(pObjFoodChargeLine);
 }
 public void SaveOrUpdate(JournalEntryLine pObjJournalEntryLine)
 {
     mObjJournalEntryLineDAO.SaveOrUpdateEntity(pObjJournalEntryLine);
 }
Exemple #27
0
 public void SaveOrUpdate(GoodsIssue pObjGoodsIssue)
 {
     mObjGoodsIssueDAO.SaveOrUpdateEntity(pObjGoodsIssue);
 }