using DevExpress.XtraEditors;
using DeviceRepairAndOptimization.Data;
using DeviceRepairAndOptimization.Models;
using System.Collections.Generic;

namespace DeviceRepairAndOptimization.Pages.DriveMaintenance
{
    public partial class xuc_RepairLogLst : XtraUserControl
    {
        int intEquipmentID = 0;


        public xuc_RepairLogLst(int equipmentID)
        {
            InitializeComponent();
            intEquipmentID = equipmentID;
        }

        /// <summary>
        /// 数据加载
        /// </summary>
        /// <returns></returns>
        List<View_DriveRepairLogs> GetDatas()
        {
            return DriveRepairLogsMaintenance.Instance.GetDatasByEquipmentID(intEquipmentID);
        }

        void BindData()
        {
            List<View_DriveRepairLogs> lst = GetDatas();
            gridControl1.DataSource = lst;
            gridView1.BestFitColumns();
        }

        /// <summary>
        /// 窗口加载
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void xuc_RepairLogLst_Load(object sender, System.EventArgs e)
        {
            BindData();
        }
    }
}
