private bool Exists(FoodCharge pObjFoodCharge) { return(mObjFoodChargeDAO .GetEntitiesList() .Where(x => x.AuctionId == pObjFoodCharge.AuctionId && x.SellerId == pObjFoodCharge.SellerId && x.Id != pObjFoodCharge.Id) .Count() > 0 ? true : false); }
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(FoodCharge pObjFoodCharge) { mObjFoodChargeDAO.SaveOrUpdateEntity(pObjFoodCharge); //if(!Exist) }