Sha256: 1f2a6f14617e874544ba8bad13d648fed520c3778091336fd3fc8dd71e06b2e8

Contents?: true

Size: 1.62 KB

Versions: 21

Compression:

Stored size: 1.62 KB

Contents

module C80Estate
  class AjaxController < ActionController::Base

    def get_atype_propnames

      atype_id = request.params[:atype_id]
      obj = Atype.get_propnames(atype_id)

      respond_to do |format|
        format.js { render json: obj, status: :ok }
        # format.json
      end

    end

    def areas_ecoef

      area_id = request.params[:area_id] == "" ? nil:request.params[:area_id]
      atype_id = request.params[:atype_id] == "" ? nil:request.params[:atype_id]
      start_date = request.params[:start_date] == "" ? nil:request.params[:start_date]
      end_date = request.params[:end_date] == "" ? nil:request.params[:end_date]

      obj = Sevent.ecoef(area_id: area_id,
                         start_date: start_date,
                         end_date: end_date,
                         atype_id: atype_id
      )

      respond_to do |format|
        format.js { render json: obj, status: :ok }
        # format.json
      end
    end
    
    def properties_busy_coef

      prop_id = request.params[:prop_id] == "" ? nil:request.params[:prop_id]
      start_date = request.params[:start_date] == "" ? nil:request.params[:start_date]
      atype_id = request.params[:atype_id] == "" ? nil:request.params[:atype_id]
      end_date = request.params[:end_date] == "" ? nil:request.params[:end_date]

      obj = Pstat.busy_coef(prop_id: prop_id,
                            start_date: start_date,
                            end_date: end_date,
                            atype_id: atype_id
      )

      respond_to do |format|
        format.js { render json: obj, status: :ok }
        # format.json
      end

    end

  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
c80_estate-0.1.0.23 app/controllers/c80_estate/ajax_controller.rb
c80_estate-0.1.0.22 app/controllers/c80_estate/ajax_controller.rb
c80_estate-0.1.0.21 app/controllers/c80_estate/ajax_controller.rb
c80_estate-0.1.0.20 app/controllers/c80_estate/ajax_controller.rb
c80_estate-0.1.0.19 app/controllers/c80_estate/ajax_controller.rb
c80_estate-0.1.0.18 app/controllers/c80_estate/ajax_controller.rb
c80_estate-0.1.0.17 app/controllers/c80_estate/ajax_controller.rb
c80_estate-0.1.0.16 app/controllers/c80_estate/ajax_controller.rb
c80_estate-0.1.0.15 app/controllers/c80_estate/ajax_controller.rb
c80_estate-0.1.0.14 app/controllers/c80_estate/ajax_controller.rb
c80_estate-0.1.0.13 app/controllers/c80_estate/ajax_controller.rb
c80_estate-0.1.0.12 app/controllers/c80_estate/ajax_controller.rb
c80_estate-0.1.0.11 app/controllers/c80_estate/ajax_controller.rb
c80_estate-0.1.0.10 app/controllers/c80_estate/ajax_controller.rb
c80_estate-0.1.0.9 app/controllers/c80_estate/ajax_controller.rb
c80_estate-0.1.0.8 app/controllers/c80_estate/ajax_controller.rb
c80_estate-0.1.0.7 app/controllers/c80_estate/ajax_controller.rb
c80_estate-0.1.0.6 app/controllers/c80_estate/ajax_controller.rb
c80_estate-0.1.0.5 app/controllers/c80_estate/ajax_controller.rb
c80_estate-0.1.0.4 app/controllers/c80_estate/ajax_controller.rb