private void DealListShow() { DList.Items.Clear(); foreach (DealListEntity DLE in DLEL) { ItemData data = new ItemData(DLE.deal, DLE.name, DLE.id, DLE.date.ToString("yyyy/MM/dd"), DLE.type, DLE.money.ToString(), DLE.number.ToString(), DLE.taxrate.ToString(), DLE.commission.ToString(), DLE.explain, DLE.remark); DList.Items.Add(data); } DList.UpdateLayout(); }
private void DList_MouseDoubleClick(object sender, MouseButtonEventArgs e) { object o = DList.SelectedItem; if (o == null) return; ItemData item = o as ItemData; AddDealList adl = new AddDealList(user.Text, item.deal); adl.ShowDialog(); DealListEntity DLE = UserPanelController.Handler().DBControllerByName(user.Text).DealListReadByDeal(item.deal); int index = DList.SelectedIndex; DList.Items.Remove(item); if (DLE.id == item.id) { item = new ItemData(DLE.deal, DLE.name, DLE.id, DLE.date.ToString("yyyy/MM/dd"), DLE.type, DLE.money.ToString(), DLE.number.ToString(), DLE.taxrate.ToString(), DLE.commission.ToString(), DLE.explain, DLE.remark); DList.Items.Insert(index, item); } DList.UpdateLayout(); //MessageBox.Show("暂时未提供修改功能!"); }