예제 #1
0
        public FaultEditForm(string faultId)
        {
            InitializeComponent();
            globalFaultId = faultId;
            //
            DataSet ds_level = null, ds = null;
            AccountAdd aa = new AccountAdd();
            Account acc = new Account();
            ds_level = aa.CreateDataSet_FaultLevel();//故障模式列表
            ds = acc.queryFaultById(faultId);

            text_eqasset.DataBindings.Add(new Binding("Text", ds.Tables[0], "asset"));
            text_eqname.DataBindings.Add(new Binding("Text", ds.Tables[0], "eqname"));
            text_dep.DataBindings.Add(new Binding("Text", ds.Tables[0], "departname"));
            text_partname.DataBindings.Add(new Binding("Text", ds.Tables[0], "part_name"));
            dateTime_fault.DataBindings.Add(new Binding("Value", ds.Tables[0], "fault_date"));
            dateTime_begin.DataBindings.Add(new Binding("Value", ds.Tables[0], "repair_date"));
            dateTime_end.DataBindings.Add(new Binding("Value", ds.Tables[0], "repairover_date"));
            richText_fault_process.DataBindings.Add(new Binding("Text", ds.Tables[0], "fault_process"));
            richText_fault_reason.DataBindings.Add(new Binding("Text", ds.Tables[0], "fault_reason"));
            richText_countermeasure.DataBindings.Add(new Binding("Text", ds.Tables[0], "countermeasure"));
            InitComboBox(combo_level, ds_level, "id", "level_name", ds, "fault_level");
            img = (byte[])(ds.Tables[0]).Rows[0][12];
        }