async void DelMenuRow(Menu p_row) { if (!await Kit.Confirm("确认要删除吗?")) { Kit.Msg("已取消删除!"); return; } if (p_row.IsAdded) { _fv.Data = _tv.SelectedItem; return; } if (await AtCm.Delete(p_row)) { long id = p_row.ID; Row tvRow = (from tr in (Table)_tv.Data where tr.ID == id select tr).FirstOrDefault(); if (tvRow != null) { _tv.DeleteItem(tvRow); } _fv.Data = _tv.SelectedItem; AtCm.PromptForUpdateModel(); } }
async void DelRpt(Rpt rpt) { if (rpt.IsAdded && !rpt.IsChanged) { _fv.Data = null; return; } if (!await Kit.Confirm($"确认要删除报表[{rpt.Name}]吗?")) { Kit.Msg("已取消删除!"); return; } if (rpt.IsAdded) { _fv.Data = null; } else if (await AtCm.DelByID <Rpt>(rpt.ID)) { _fv.Data = null; LoadAll(); AtCm.PromptForUpdateModel(); } }
async void Exchange(Menu src, Menu tgt) { if (await AtCm.ExchangeDispidx(src, tgt)) { LoadTreeData(); AtCm.PromptForUpdateModel("菜单调序成功"); } }
async void OnSave(object sender, Mi e) { if (await AtCm.Save(_fv.Data.To <Rpt>())) { _lv.Data = await AtCm.Query <Rpt>("报表-最近修改"); AtCm.PromptForUpdateModel(); } }
async void OnSave(object sender, Mi e) { if (await AtCm.Save(_fv.Data.To <Menu>())) { OnFvDataChanged(_fv, _fv.Data); LoadTreeData(); AtCm.PromptForUpdateModel(); } }
async void OnSave(object sender, Mi e) { var op = _fv.Data.To <Option>(); if (await AtCm.Save(op)) { LoadCategory(); _lv.Data = await AtCm.Query <Option>("选项-分类选项", new { Category = op.Category }); AtCm.PromptForUpdateModel(); } }
async void Exchange(Option p_src, Option p_tgt) { var tbl = Table <Option> .Create(); var save = (Option)tbl.AddRow(new { Name = p_src.Name, Category = p_src.Category }); save.AcceptChanges(); save.Dispidx = p_tgt.Dispidx; save = (Option)tbl.AddRow(new { Name = p_tgt.Name, Category = p_tgt.Category }); save.AcceptChanges(); save.Dispidx = p_src.Dispidx; if (await AtCm.BatchSave(tbl)) { _lv.Data = await AtCm.Query <Option>("选项-分类选项", new { Category = p_src.Category }); AtCm.PromptForUpdateModel(); } }
public override async void SaveTemplate(string p_xml) { if (!_rpt.Contains("define")) { _rpt.AddCell <string>("define"); } _rpt["define"] = p_xml; if (_rpt.IsAdded) { _rpt["ctime"] = _rpt["mtime"] = Kit.Now; } else { _rpt["mtime"] = Kit.Now; } if (await AtCm.Save(_rpt)) { AtCm.PromptForUpdateModel(); } }
async void DelOption(Option p_option) { if (!await Kit.Confirm("确认要删除吗?")) { Kit.Msg("已取消删除!"); return; } if (p_option.IsAdded) { _fv.Data = null; return; } if (await AtCm.Delete(p_option)) { LoadCategory(); _lv.Data = await AtCm.Query <Option>("选项-分类选项", new { Category = p_option.Category }); _fv.Data = null; AtCm.PromptForUpdateModel(); } }