public int Save_HTL_Deals(HotelDealViewModel model) { HTL_Deals objToSave = new HTL_Deals(); objToSave.DealMasterId = model.DealMasterId; objToSave.HotelId = model.HotelId; objToSave.DealIdentifier = model.DealIdentifierText; objToSave.MarkupOnPerRoom = model.MarkupOnPerRoom; objToSave.isPercentMarkupOnPerRoom = model.isPercentMarkupOnPerRoom; objToSave.MarkupOnExtraGuestCharge = model.MarkupOnExtraGuestCharge; objToSave.isPercentMarkupOnExtraGuestCharge = model.isPercentMarkupOnExtraGuestCharge; objToSave.CommissionOnPerRoom = model.CommissionOnPerRoom; objToSave.isPercentCommissionOnPerRoom = model.isPercentCommissionOnPerRoom; objToSave.CommissionOnExtraGuestCharge = model.CommissionOnExtraGuestCharge; objToSave.isPercentCommissionOnExtraGuestCharge = model.isPercentCommissionOnExtraGuestCharge; objToSave.CurrencyId = model.CurrencyId; objToSave.VersionNo = 1; objToSave.MakerId = model.MakerId; objToSave.MakerDate = model.MakerDate; objToSave.isVerified = model.isVerified; objToSave.VerifiedBy = model.VerifiedBy; objToSave.VerifiedDate = model.VerifiedDate; entity.AddToHTL_Deals(objToSave); entity.SaveChanges(); return(objToSave.HotelDealId); }
public bool Edit_HTL_Deals(int dealId, int userId) { HTL_Deals objToDelete = new HTL_Deals(); entity.HTL_SaveChangesOnDeal(dealId, userId, "E"); return(true); }
public bool Update_Htl_Deals(HotelDealViewModel model) { Edit_HTL_Deals(model.HotelDealId, model.UpdatedBy.Value); HTL_Deals objToUpdate = new HTL_Deals(); objToUpdate = entity.HTL_Deals.Where(x => x.HotelDealId == model.HotelDealId).FirstOrDefault(); objToUpdate.DealMasterId = model.DealMasterId; objToUpdate.HotelId = model.HotelId; objToUpdate.DealIdentifier = model.DealIdentifierText; objToUpdate.MarkupOnPerRoom = model.MarkupOnPerRoom; objToUpdate.isPercentMarkupOnPerRoom = model.isPercentMarkupOnPerRoom; objToUpdate.MarkupOnExtraGuestCharge = model.MarkupOnExtraGuestCharge; objToUpdate.isPercentMarkupOnExtraGuestCharge = model.isPercentMarkupOnExtraGuestCharge; objToUpdate.CommissionOnPerRoom = model.CommissionOnPerRoom; objToUpdate.isPercentCommissionOnPerRoom = model.isPercentCommissionOnPerRoom; objToUpdate.CommissionOnExtraGuestCharge = model.CommissionOnExtraGuestCharge; objToUpdate.isPercentCommissionOnExtraGuestCharge = model.isPercentCommissionOnExtraGuestCharge; objToUpdate.CurrencyId = model.CurrencyId; objToUpdate.UpdatedBy = model.UpdatedBy; objToUpdate.UpdatedDate = model.UpdatedDate; entity.ApplyCurrentValues(objToUpdate.EntityKey.EntitySetName, objToUpdate); entity.SaveChanges(); return(true); }