Exemplo n.º 1
0
        private void hyperlink_Click(object sender, RoutedEventArgs e)
        {
            var rowData   = (RowData)dgMain.SelectedItem;
            var hyperlink = e.OriginalSource as Hyperlink;

            if (rowData != null && hyperlink != null)
            {
                string originalString = hyperlink.NavigateUri.OriginalString;
                if (originalString == "编辑")
                {
                    WndFavoriteNoteEditor.Edit(WndMgr.SellerMainNick, rowData.NoteEntity, WndMgr, () => { LoadData(); });
                }
                else
                {
                    if (originalString != "删除")
                    {
                        throw new Exception();
                    }
                    if (MsgBox.ShowDialog("确定要删除?", "操作确认", "Delete", WndMgr))
                    {
                        BuyerNoteHelper.Delete(rowData.NoteEntity);
                        LoadData();
                    }
                }
            }
        }
Exemplo n.º 2
0
        private void hyperLink_Click(object sender, RoutedEventArgs e)
        {
            var rowData = (RowData)dgMain.SelectedItem;
            var link    = e.OriginalSource as Hyperlink;

            if (rowData != null && link != null)
            {
                string originalString = link.NavigateUri.OriginalString;
                if (originalString == "详情")
                {
                    WndDetail.MyShow(rowData.NoteEntity.BuyerMainNick, rowData.NoteEntity.Recorder);
                }
                else
                {
                    if (!(originalString == "删除"))
                    {
                        throw new Exception();
                    }
                    if (MsgBox.ShowDialog("确定要删除?", "操作确认", "CtlBuyerNoteViewer.Delete", WndMgr))
                    {
                        BuyerNoteHelper.Delete(rowData.NoteEntity);
                        _searchedNotes.Remove(rowData.NoteEntity);
                        var newPageNo = (_pageData.Count > 1) ? pager.PageNo : (pager.PageNo - 1);
                        ShowPage(newPageNo);
                    }
                }
            }
        }
Exemplo n.º 3
0
        private void LoadBuyerNotes()
        {
            var searchCondition = GetSearchCondition();

            _searchedNotes = BuyerNoteHelper.SearchBuyerNotes(searchCondition.DateFrom, searchCondition.DateTo, searchCondition.Seller, searchCondition.Buyer, WndMgr.Seller);
            _searchedNotes = (_searchedNotes ?? new List <BuyerNoteEntity>());
            pager.Init(_searchedNotes.Count, _recPerPage, true, 1);
        }
Exemplo n.º 4
0
        private async void btnDeleteAll_Click(object sender, RoutedEventArgs e)
        {
            if (MsgBox.ShowDialog("确定要删除?", "操作确认", WndMgr))
            {
                await Task.Factory.StartNew(() => {
                    BuyerNoteHelper.BatchDelete(_searchedNotes);
                }, TaskCreationOptions.LongRunning);

                btnReset.xPerformClick();
            }
        }
Exemplo n.º 5
0
        private void LoadData()
        {
            var favNotes = BuyerNoteHelper.GetFavNotes(WndMgr.SellerMainNick);

            dgMain.ItemsSource = favNotes.Select(k => new RowData(k));
        }
Exemplo n.º 6
0
        public static string GetBuyerNotes(string buyerMain, string seller)
        {
            var ets = BuyerNoteHelper.GetBuyerNotesOnlyBuyer(buyerMain, seller);

            return(WndDetail.GetDesc(ets));
        }