public async Task <ViewResultBase> Edit(NullableIdInput input) { var app = new SystemApp(); if (input != null) { if (!input.Id.IsNullOrEmptyGuid()) { app = await _appLogic.GetByIdAsync(input.Id); } } return(View(app)); }
/// <summary> /// 初始化系统功能 /// </summary> /// <param name="dosKey"></param> /// <param name="icoNameKey"></param> /// <param name="dicSystem"></param> private bool initSystemAbility() { if (!File.Exists(Global.mXMLFilePath)) { if (!mXMLHelper.CreateXmlDocument("app", "UTF-8")) { return(false); } if (!mXMLHelper.InsertNode("app", "system", new string[] { "dos", "iconname" }, SystemApp.GetSystemDic())) { return(false); } DialogResult res = MessageBox.Show("是否扫描除C盘外所有已安装应用?", "扫描程序", MessageBoxButtons.OKCancel); if (res == DialogResult.OK) { List <SelectItem> dics = Global.GetApp(); foreach (SelectItem item in dics) { Icon icon; string fullPath = item.Value; string appName = item.Name; ExecuteCommon execute = new ExecuteCommon(); /* 读取xml */ if (!GetSameApp(appName)) { MessageBox.Show("已存在" + appName + "的应用程序!"); continue; } /* 绑定listview 写入XML */ if (!SaveOneSelfXml(new Dictionary <string, string>() { { "fullpath", fullPath }, { "InnerText", appName } })) { MessageBox.Show("添加应用程序失败!"); continue; } } } } return(true); }
public async Task <JsonResult> SaveApp(SystemApp app) { return(Json(await _appLogic.SaveApp(app))); }