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."); } }
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."); } }
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."); } }
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."); } }
public void SaveOrUpdate(UserType pObjUserType) { if (!Exists(pObjUserType)) { mObjUserTypeDAO.SaveOrUpdateEntity(pObjUserType); } else { throw new Exception("El tipo de usuario ingresado ya existe."); } }
public void SaveOrUpdate(Configuration pObjConfiguration) { if (!Exists(pObjConfiguration)) { mObjConfigurationDAO.SaveOrUpdateEntity(pObjConfiguration); } else { throw new Exception("Registro existente."); } }
public void SaveOrUpdate(BatchLine pObjBatchLine) { if (!Exists(pObjBatchLine)) { mObjBatchLineDAO.SaveOrUpdateEntity(pObjBatchLine); } else { throw new Exception("La linea de lote ingresada ya existe."); } }
public void SaveOrUpdate(Partner pObjPartner) { if (!Exists(pObjPartner)) { mObjPartnerDAO.SaveOrUpdateEntity(pObjPartner); } else { throw new Exception("El cliente ingresado ya existe."); } }
public void SaveOrUpdate(FoodDelivery pObjFoodDelivery) { if (!Exists(pObjFoodDelivery)) { mObjFoodDeliveryDAO.SaveOrUpdateEntity(pObjFoodDelivery); } else { throw new Exception("La entrega de mercancía ya se encuentra registrada."); } }
public void SaveOrUpdate(Batch pObjBatch) { if (!Exists(pObjBatch)) { mObjBatchDAO.SaveOrUpdateEntity(pObjBatch); } else { throw new Exception("El lote ingresado ya existe."); } }
public void SaveOrUpdate(ItemType pObjItemType) { if (!Exists(pObjItemType)) { mObjItemTypeDAO.SaveOrUpdateEntity(pObjItemType); } else { throw new Exception("El tipo de artículo ingresado ya existe."); } }
public void SaveOrUpdate(PartnerClassification pObjPartnerClassification) { if (!Exists(pObjPartnerClassification)) { mObjPartnerClassificationDAO.SaveOrUpdateEntity(pObjPartnerClassification); } else { throw new Exception("La clasificación ingresada ya existe."); } }
//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)); } }
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."); } }
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."); } }
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."); } }
public void SaveOrUpdate(FoodCharge pObjFoodCharge) { mObjFoodChargeDAO.SaveOrUpdateEntity(pObjFoodCharge); //if(!Exist) }
public void Save(FoodChargeCheck pObjFoodChargeCheck) { mObjFoodChargeCheckListDAO.SaveOrUpdateEntity(pObjFoodChargeCheck); }
public void SaveOrUpdate(GoodsReceipt pObjGoodsReceipt) { mObjGoodsReceiptDAO.SaveOrUpdateEntity(pObjGoodsReceipt); }
public void SaveOrUpdate(GoodsReturn pObjGoodsReturn) { mObjGoodsReturnDAO.SaveOrUpdateEntity(pObjGoodsReturn); }
public void SaveOrUpdate(Stock pObjItemType) { mObjStockDAO.SaveOrUpdateEntity(pObjItemType); }
public void SaveOrUpdate(InvoiceLine pObjInvoiceLine) { mObjInvoiceLineDAO.SaveOrUpdateEntity(pObjInvoiceLine); }
public void SaveOrUpdate(FoodChargeLine pObjFoodChargeLine) { mObjFoodChargeLineDAO.SaveOrUpdateEntity(pObjFoodChargeLine); }
public void SaveOrUpdate(JournalEntryLine pObjJournalEntryLine) { mObjJournalEntryLineDAO.SaveOrUpdateEntity(pObjJournalEntryLine); }
public void SaveOrUpdate(GoodsIssue pObjGoodsIssue) { mObjGoodsIssueDAO.SaveOrUpdateEntity(pObjGoodsIssue); }