예제 #1
0
 public RepairPlanEditForm(string planId)
 {
     InitializeComponent();
     globalPlanId = planId;
     //
     DataSet ds_department1 = null, ds_department2 = null, ds_level = null, ds = null;
     AccountAdd aa = new AccountAdd();
     Account ads = new Account();
     //初始化下拉列表
     ds_department1 = aa.CreateDataSet_Department();//部门列表
     ds_department2 = aa.CreateDataSet_Department();//部门列表
     ds_level = aa.CreateDataSet_RepairLevel();//维修级别列表
     ds = ads.queryRepairPlanById(planId);
     InitComboBox(combo_targetdep, ds_department1, "id", "departname", ds, "target_department");
     InitComboBox(combo_sourcedep, ds_department2, "id", "departname", ds, "source_department");
     InitComboBox(combo_level, ds_level, "id", "level_name", ds, "level_id");
     //表头塞值
     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_repairasset.DataBindings.Add(new Binding("Text", ds.Tables[0], "plan_asset"));
     dateTime_plandate.DataBindings.Add(new Binding("Value", ds.Tables[0], "start_date"));
     numeric_repairday.DataBindings.Add(new Binding("Value", ds.Tables[0], "over_time"));
     numeric_stopday.DataBindings.Add(new Binding("Value", ds.Tables[0], "stop_time"));
     text_fuzeren.DataBindings.Add(new Binding("Text", ds.Tables[0], "principal"));
     richText_memo.DataBindings.Add(new Binding("Text", ds.Tables[0], "memo"));
 }