Beispiel #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();
                    }
                }
            }
        }
Beispiel #2
0
 public VdWndFavoriteNoteEditor(string txt, WndFavoriteNoteEditor wnd, Func <string, string> func = null)
     : base(wnd)
 {
     Text = (txt ?? "");
     _wnd = wnd;
     base.SetBinding("Text", wnd.tboxContent, () =>
     {
         return(string.IsNullOrEmpty(Text) ? "必填!" : null);
     });
 }
Beispiel #3
0
        public static void Create(string sellerMain, Window owner, Action onClosed)
        {
            WndFavoriteNoteEditor wndFavoriteNoteEditor = EtWindow.ShowSameShopOneInstance <WndFavoriteNoteEditor>(sellerMain, new Func <WndFavoriteNoteEditor>(() =>
            {
                return(new WndFavoriteNoteEditor(sellerMain));
            }), owner);

            wndFavoriteNoteEditor.Closed += (s, e) =>
            {
                if (onClosed != null)
                {
                    onClosed();
                }
            };
        }
Beispiel #4
0
 private void btnCreate_Click(object sender, RoutedEventArgs e)
 {
     WndFavoriteNoteEditor.Create(WndMgr.SellerMainNick, WndMgr, LoadData);
 }
Beispiel #5
0
        public static void Edit(string sellerMain, FavoriteNoteEntity noteEntity, Window owner, Action onClosed)
        {
            WndFavoriteNoteEditor wndFavoriteNoteEditor = new WndFavoriteNoteEditor(sellerMain, noteEntity);

            wndFavoriteNoteEditor.FirstShow(sellerMain, owner, onClosed, false);
        }