private List <SqlParameter> Set_Values_In_SupplierHotelDays(SupplierHotelTariffDayInfo SupplierHotelTariffDayInfo) { List <SqlParameter> sqlParams = new List <SqlParameter>(); if (SupplierHotelTariffDayInfo.SupplierHotelDayId != 0) { sqlParams.Add(new SqlParameter("@SupplierHotelDayId", SupplierHotelTariffDayInfo.SupplierHotelDayId)); } sqlParams.Add(new SqlParameter("@SupplierHotelId", SupplierHotelTariffDayInfo.SupplierHotelId)); sqlParams.Add(new SqlParameter("@CityId", SupplierHotelTariffDayInfo.CityId)); sqlParams.Add(new SqlParameter("@Title", SupplierHotelTariffDayInfo.Title)); if (SupplierHotelTariffDayInfo.SupplierHotelDayId == 0) { sqlParams.Add(new SqlParameter("@IsActive", SupplierHotelTariffDayInfo.IsActive)); sqlParams.Add(new SqlParameter("@CreatedDate", SupplierHotelTariffDayInfo.CreatedDate)); sqlParams.Add(new SqlParameter("@CreatedBy", SupplierHotelTariffDayInfo.CreatedBy)); } sqlParams.Add(new SqlParameter("@UpdatedDate", SupplierHotelTariffDayInfo.UpdatedDate)); sqlParams.Add(new SqlParameter("@UpdatedBy", SupplierHotelTariffDayInfo.UpdatedBy)); return(sqlParams); }
public JsonResult InsertSupplierHotel(SupplierHotelTariffViewModel sViewModel) { try { Set_Date_Session(sViewModel.SupplierHotelTariff); for (int i = 1; i <= sViewModel.SupplierHotelTariff.DayDuration; i++) { SupplierHotelTariffDayInfo SupplierHotelDay = new SupplierHotelTariffDayInfo(); SupplierHotelDay.IsActive = true; Set_Date_Session(SupplierHotelDay); sViewModel.SupplierHotelTariff.supplierHotelTariffDays.Add(SupplierHotelDay); } _sRepo.InsertSupplierHotel(sViewModel.SupplierHotelTariff); sViewModel.FriendlyMessage.Add(MessageStore.Get("SUPPLIERHOTELTARIFF01")); } catch (Exception ex) { sViewModel.FriendlyMessage.Add(MessageStore.Get("SYS01")); Logger.Error("Insert Supplier Hotel Tariff Detail " + ex.Message); } return(Json(sViewModel)); }
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>(); }
private SupplierHotelTariffDayInfo Get_SupplierHotelDays_Values(DataRow dr) { SupplierHotelTariffDayInfo supplierhoteldays = new SupplierHotelTariffDayInfo(); //List<SupplierHotelDayItemInfo> ItemInfoList = new List<SupplierHotelDayItemInfo>(); supplierhoteldays.SupplierHotelDayId = Convert.ToInt32(dr["SupplierHotelDayId"]); supplierhoteldays.SupplierHotelId = Convert.ToInt32(dr["SupplierHotelId"]); supplierhoteldays.CityId = Convert.ToInt32(dr["CityId"]); supplierhoteldays.Title = Convert.ToString(dr["Title"]); supplierhoteldays.IsActive = Convert.ToBoolean(dr["IsActive"]); supplierhoteldays.CreatedDate = Convert.ToDateTime(dr["CreatedDate"]); supplierhoteldays.CreatedBy = Convert.ToInt32(dr["CreatedBy"]); supplierhoteldays.UpdatedDate = Convert.ToDateTime(dr["UpdatedDate"]); supplierhoteldays.UpdatedBy = Convert.ToInt32(dr["UpdatedBy"]); supplierhoteldays.supplierHotelDayItems = Get_SupplierHotelTariffDayItems(supplierhoteldays.SupplierHotelDayId); return(supplierhoteldays); }
public void Update_SupplierHotelDay(SupplierHotelTariffDayInfo SupplierHotelTariffDayInfo) { _sqlHelper.ExecuteNonQuery(Set_Values_In_SupplierHotelDays(SupplierHotelTariffDayInfo), Storeprocedures.sp_Update_SupplierHotelDays.ToString(), CommandType.StoredProcedure); }