public async void ExecuteAddInstanceCommand(object parameter) { try { var dlg = new CreateDatabaseDialog(); dlg.WindowStartupLocation = WindowStartupLocation.CenterOwner; if (dlg.ShowDialog() == true) { var dbName = dlg.ViewModel.DbName; this.Busy = true; this.BusyContent = "Adding new instanse "; await Task.Factory.StartNew(() => { if (InstanceService.AddInstance(dbName)) { LoadInstances(); } }); } } finally { this.Busy = false; } }
public ActionResult Create([Bind(Include = "id,resourceAddress,key,image,title,code,context,result")] Instance instance, HttpPostedFileBase file) { if (ModelState.IsValid) { if (customService.SaveFile(file)) { instance.resourceAddress = file.FileName; } instanceService.AddInstance(instance); return(RedirectToAction("Index")); } return(View(instance)); }
/// <summary> /// 新建申请单 /// </summary> /// <param name="model"></param> /// <returns></returns> public static bool AddInstance(ref Model.Instancenew model, out string errMsg) { return(InstanceService.AddInstance(ref model, out errMsg)); }