/// <summary>
 /// 删除记录
 /// </summary>
 private void BtnDelete_Click(object sender)
 {
     if (View.DGSelect.SelectedItem == null)
     {
         MessageBox.Show("请选择要删除的功能模块!");
     }
     foreach (var item in View.DGSelect.Items)
     {
         if (View.DGSelect.SelectedItem == item)
         {
             EquipmentRepairRecord model = item as EquipmentRepairRecord;
             new EquipmentRepairRecordBIZ().delete(model);
             MessageBox.Show("删除成功!");
             BtnSearch_Click(null);
         }
     }
 }
 /// <summary>
 /// 修改记录
 /// </summary>
 private void BtnUpdate_Click(object sender)
 {
     if (View.DGSelect.SelectedItem == null)
     {
         MessageBox.Show("请选择要修改的记录!");
     }
     foreach (var item in View.DGSelect.Items)
     {
         if (View.DGSelect.SelectedItem == item)
         {
             EquipmentRepairRecord model = item as EquipmentRepairRecord;
             //FuncModule gnmk = (FuncModule)sender;
             EquipmentRepairRecordEditView view = new EquipmentRepairRecordEditView(model);
             view.ShowDialog();
             BtnSearch_Click(null);
         }
     }
 }
 public int InsertOrUpdateBy(EquipmentRepairRecord _model, string _identity)
 {
     return(_model.ID == 0 ? dal.Insert(_model) : dal.Update(_model, _identity));
 }
 public int delete(EquipmentRepairRecord _model)
 {
     return(dal.Delete(_model));
 }
 public int Update(EquipmentRepairRecord _model)
 {
     return(dal.Update(_model, "ID"));
 }
 public int UpdateBy(EquipmentRepairRecord _model, string _identity)
 {
     return(dal.Update(_model, _identity));
 }
 public int Insert(EquipmentRepairRecord _model)
 {
     return(dal.Insert(_model));
 }
 public EquipmentRepairRecordEditView(EquipmentRepairRecord md)
 {
     InitializeComponent();
     this.Loaded += new RoutedEventHandler(EquipmentRepairRecordEditVM.PageLoad);
     MD           = md;
 }
 public int Delete(EquipmentRepairRecord model)
 {
     return(CommonAccess.ComSQLiteDelete(model, "ID"));
 }
 public int Update(EquipmentRepairRecord model, string _identity)
 {
     return(CommonAccess.ComSQLiteUpdate(model, _identity));
 }
 public int Insert(EquipmentRepairRecord model)
 {
     return(CommonAccess.ComSQLiteInsert(model));
 }