public static void CreateNew(string parentId, string dbAccount, string seller, Window ownnerWnd, Action <TreeNode> callback) { var wnd = new WndShortcutEditor(null, null, null); wnd.FirstShow(seller, ownnerWnd, () => { if (wnd._isSubmit) { var et = EntityHelper.Create <ShortcutEntity>(dbAccount); et.ParentId = parentId; et.Title = wnd.tboxQuestion.Text.Trim(); et.Text = wnd._data.Content; et.Code = wnd._data.Code; et.ImageName = wnd.imgMain.Tag == null ? "" : wnd.imgMain.Tag.ToString(); callback(et); } }, false); }
public static void Edit(ShortcutEntity pre, string seller, string dbAccount, Window ownnerWnd, Action <TreeNode> callback) { var wnd = new WndShortcutEditor(pre.Title, pre.Text, pre.Code, pre.ImageName); wnd.FirstShow(seller, ownnerWnd, () => { if (wnd._isSubmit) { var et = pre.Clone <ShortcutEntity>(false); et.Title = wnd.tboxQuestion.Text.Trim(); et.Text = wnd._data.Content; et.Code = wnd._data.Code; et.ImageName = wnd.imgMain.Tag == null ? "" : wnd.imgMain.Tag.ToString(); EntityHelper.SetModifyTick(et); callback(et); } }, false); }