/// <summary> /// Create Js /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void creatJavaScriptToolStripMenuItem_Click(object sender, EventArgs e) { var strJsName = MyMessageBox.ShowInput("pls Input Javascript Name", "Save Javascript"); if (strJsName == string.Empty) { return; } if (QueryHelper.IsExistByKey(strJsName)) { MyMessageBox.ShowMessage("Error", "javascript is already exist"); } else { var result = Operater.CreateNewJavascript(strJsName, string.Empty); if (string.IsNullOrEmpty(result)) { var jsNode = new TreeNode(strJsName) { ImageIndex = (int)GetSystemIcon.MainTreeImageType.JsDoc, SelectedImageIndex = (int)GetSystemIcon.MainTreeImageType.JsDoc }; var jsTag = RuntimeMongoDbContext.SelectTagData; jsNode.Tag = ConstMgr.JavascriptDocTag + ":" + jsTag + "/" + strJsName; trvsrvlst.SelectedNode.Nodes.Add(jsNode); trvsrvlst.SelectedNode = jsNode; RuntimeMongoDbContext.SelectObjectTag = jsNode.Tag.ToString(); ViewJavascript(); } else { MyMessageBox.ShowMessage("Error", "Create Javascript Error", result, true); } } }
/// <summary> /// 保存 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void cmdSave_Click(object sender, EventArgs e) { if (txtEditJavaScript.Text != string.Empty) { var strJsName = MyMessageBox.ShowInput("please Input Javascript Name:[Save at system.js]", "Save Javascript"); Operater.CreateNewJavascript(strJsName, txtEditJavaScript.Text); } }
/// <summary> /// Save Aggregate Pipeline /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void cmdSaveAggregatePipeline_Click(object sender, EventArgs e) { if (_aggrArray.Count == 0) { return; } var strJsName = MyMessageBox.ShowInput("pls Input Aggregate Pipeline Name :", "Save Aggregate Pipeline"); Operater.CreateNewJavascript(strJsName, new BsonDocument("Pipeline:", _aggrArray).ToString()); }