private SupplierHotelTariffDurationInfo GetSupplierHotelTariffDurationValues(DataRow dr) { SupplierHotelTariffDurationInfo SupplierHotelTariff = new SupplierHotelTariffDurationInfo(); //hoteltariffdatedetails.HotelTariffDurationDetailsId = Convert.ToInt32(dr["HotelTariffDurationDetailsId"]); //hoteltariffdatedetails.HotelTariffId = Convert.ToInt32(dr["HotelTariffId"]); //if (dr["NoOfNight"] != DBNull.Value) //{ // hoteltariffdatedetails.NoOfNight = Convert.ToInt32(dr["NoOfNight"]); //} if (dr["TariffDate"] != DBNull.Value) { SupplierHotelTariff.TariffDate = Convert.ToDateTime(dr["TariffDate"]); } if (dr["NetRate"] != DBNull.Value) { SupplierHotelTariff.NetRate = Convert.ToDecimal(dr["NetRate"]); } if (dr["SupplierHotelPriceId"] != DBNull.Value) { SupplierHotelTariff.SupplierHotelPriceId = Convert.ToInt32(dr["SupplierHotelPriceId"]); } if (dr["OccupancyDetailId"] != DBNull.Value) { SupplierHotelTariff.OccupancyDetailId = Convert.ToInt32(dr["OccupancyDetailId"]); } return(SupplierHotelTariff); }
public SupplierHotelTariffViewModel() { SupplierHotelTariff = new SupplierHotelTariffInfo(); SupplierHotelDetail = new SupplierHotelDetailInfo(); SupplierOccupancyDetail = new SupplierOccupancyDetailInfo(); SupplierHotelCustomerCategory = new SupplierHotelCustomerCategoryInfo(); SupplierHotelCustomerCategories = new List <SupplierHotelCustomerCategoryInfo>(); LstVendor = new List <VendorInfo>(); LstCities = new List <CityInfo>(); LstRoomTypes = new List <RoomTypeInfo>(); LstMeals = new List <MealInfo>(); LstHotel = new List <HotelInfo>(); FriendlyMessage = new List <FriendlyMessage>(); SupplierHotelTariffDuration = new SupplierHotelTariffDurationInfo(); SupplierHotelTariffDurations = new List <SupplierHotelTariffDurationInfo>(); LstStandardCharges = new List <ChargesInfo>(); LstSupplierHotelPriceDetail = new List <SupplierHotelPriceDetailInfo>(); LstSupplierHotelPrice = new List <SupplierHotelPriceInfo>(); CustomerCategories = new List <CustomerCategoryInfo>(); LstStandardCharges = new List <ChargesInfo>(); LstTaxFormula = new List <TaxFormulaInfo>(); LstTaxFormulaCharges = new List <TaxFormulaChargesInfo>(); SupplierHotelPrice = new SupplierHotelPriceInfo(); Pager = new PaginationInfo(); Cities = new List <CityInfo>(); SupplierHotelTariffDayInfo = new SupplierHotelTariffDayInfo(); SupplierHotelTariffDays = new List <SupplierHotelTariffDayInfo>(); SupplierHotelDayItem = new SupplierHotelDayItemInfo(); SupplierHotelDayItems = new List <SupplierHotelDayItemInfo>(); }
public void SaveSupplierHotelTariffDurationWithCustomerCategories(List <DateTime> dates, SupplierHotelTariffDurationInfo SupplierHotelTariffDuration, List <SupplierHotelCustomerCategoryInfo> SupplierHotelCustomerCategories) { foreach (var item in dates) { List <SqlParameter> sqlParams = new List <SqlParameter>(); sqlParams.Add(new SqlParameter("@SupplierHotelPriceId", SupplierHotelTariffDuration.SupplierHotelPriceId)); Logger.Debug("SaveSupplierHotelTariffDuration SupplierHotelPriceId:" + SupplierHotelTariffDuration.SupplierHotelPriceId); //sqlParams.Add(new SqlParameter("@NoOfNight", hotelTariffDateDetails.NoOfNight)); //Logger.Debug("SaveHotelTariffDuration NoOfNight:" + hotelTariffDateDetails.NoOfNight); sqlParams.Add(new SqlParameter("@TariffDate", item)); Logger.Debug("SaveHotelTariffDuration TariffDate:" + item); sqlParams.Add(new SqlParameter("@NetRate", SupplierHotelTariffDuration.NetRate)); Logger.Debug("SaveSupplierHotelTariffDuration NetRate:" + SupplierHotelTariffDuration.NetRate); sqlParams.Add(new SqlParameter("@OccupancyDetailId", SupplierHotelTariffDuration.OccupancyDetailId)); Logger.Debug("SaveSupplierHotelTariffDuration OccupancyDetailId:" + SupplierHotelTariffDuration.OccupancyDetailId); SupplierHotelTariffDuration.SupplierHotelDurationId = Convert.ToInt32(_sqlHelper.ExecuteScalerObj(sqlParams, Storeprocedures.spInsertSupplierHotelTariffDuration.ToString(), CommandType.StoredProcedure)); foreach (var itm in SupplierHotelCustomerCategories) { List <SqlParameter> sqlParam = new List <SqlParameter>(); sqlParam.Add(new SqlParameter("@SupplierHotelDurationId", SupplierHotelTariffDuration.SupplierHotelDurationId)); sqlParam.Add(new SqlParameter("@CustomerCategoryId", itm.CustomerCategoryId)); sqlParam.Add(new SqlParameter("@Margin", itm.Margin)); sqlParam.Add(new SqlParameter("@CreatedDate", itm.CreatedDate)); sqlParam.Add(new SqlParameter("@CreatedBy", itm.CreatedBy)); sqlParam.Add(new SqlParameter("@UpdatedDate", itm.UpdatedDate)); sqlParam.Add(new SqlParameter("@UpdatedBy", itm.UpdatedBy)); _sqlHelper.ExecuteNonQuery(sqlParam, Storeprocedures.spInsertSupplierHotelTariffCustomerCategory.ToString(), CommandType.StoredProcedure); } } }