Beispiel #1
0
 /// <summary>
 /// 增加
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnAdd_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
 {
     try
     {
         PdaInfo pda   = new PdaInfo();
         int     PdaID = bsPad.Count + 1;
         pda.PadID = PdaID;
         pda.IsNew = true;
         using (FrmPdaOperSet frm = new FrmPdaOperSet(pda))
         {
             if (frm.ShowDialog() == DialogResult.OK)
             {
                 this.bsPad.DataSource = AGVDAccess.AGVClientDAccess.LoadAllPad();
                 this.bsPad.ResetBindings(false);
             }
         }
     }
     catch (Exception ex)
     {
         MsgBox.ShowError(ex.Message);
     }
 }
Beispiel #2
0
 /// <summary>
 /// 删除
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnEdit_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
 {
     try
     {
         PdaInfo pda = this.bsPad.Current as PdaInfo;
         if (pda != null)
         {
             IList <PdaOperSetInfo> pdaOperSetlist = AGVDAccess.AGVClientDAccess.LoadAllPdaOperSet();
             pda.PdaOperSetList = pdaOperSetlist.Where(p => p.PdaID == pda.PadID).ToList();
             using (FrmPdaOperSet frm = new FrmPdaOperSet(pda))
             {
                 if (frm.ShowDialog() == DialogResult.OK)
                 {
                     this.bsPad.DataSource = AGVDAccess.AGVClientDAccess.LoadAllPad();
                     this.bsPad.ResetBindings(false);
                 }
             }
         }
     }
     catch (Exception ex)
     {
         MsgBox.ShowError(ex.Message);
     }
 }