package com.example.administrator.zhapp.adapter;

import android.content.Context;
import android.widget.TextView;

import com.example.administrator.zhapp.BaseListViewAdapter.CommonAdapter;
import com.example.administrator.zhapp.BaseListViewAdapter.ViewHolder;
import com.example.administrator.zhapp.R;
import com.example.administrator.zhapp.entity.XsDqgzBgListBean;

import java.util.List;

/**
 * Created by Rehome-rjb1 on 2017/7/17.
 */

public class XsDqgzBgListAdapter extends CommonAdapter<XsDqgzBgListBean.DataBean> {


    private List<XsDqgzBgListBean.DataBean> datas;

    public XsDqgzBgListAdapter(Context context, List<XsDqgzBgListBean.DataBean> datas) {
        super(context, R.layout.item_dqgzzx, datas);
        this.datas = datas;
    }

    @Override
    protected void convert(ViewHolder viewHolder, XsDqgzBgListBean.DataBean item, int position) {


        TextView tvJhmc = viewHolder.getView(R.id.tv_jhmc);

        TextView tvJhsh = viewHolder.getView(R.id.tv_jhsh);
        TextView tvJhbc = viewHolder.getView(R.id.tv_jhbc);

        TextView tvJhms = viewHolder.getView(R.id.tv_jhms);
        TextView tvZxqk = viewHolder.getView(R.id.tv_zxqk);
        TextView tvZxzt = viewHolder.getView(R.id.tv_zxzt);

        tvJhmc.setText("计划名称：" + item.getJhmc());
        tvJhsh.setText("计划时间：" + item.getZxrq());
        tvJhbc.setText("计划班次：" + item.getZxbc());
        tvJhms.setText("变更类型：" + item.getBglxmc());
        tvZxqk.setText("变更描述：" + item.getBgms());


        //执行状态（0:未执行、1:工作完成、2:工作取消，3.延期执行，4.申请中）
        //申请中的执行记录，不允许再做变更操作

//        String status = "";
//        if (item.getStatus().equals("0")) {
//            status = "待审核";
//        } else if (item.getStatus().equals("1")) {
//            status = "未完成";
//        } else if (item.getStatus().equals("2")) {
//            status = "完成";
//        }

        viewHolder.setText(R.id.tv_zxzt, item.getStatus());
    }
}
