public void Initialize() { // Load Calls Calls = new BindingList <Call>(); CallName[] callNames = (CallName[])Enum.GetValues(typeof(CallName)); foreach (var callName in callNames) { Call call = new Call(CallName.EN_Unicode); call.Load(callName, true); Calls.Add(call); } CallNamesDataGridView.DataSource = Calls; // Load presets. //string[] names = mainForm.GeneratorPanel.Presets.Select(x => x.PresetName).ToArray(); //PresetNameComboBox.Items.AddRange(names); // Load help. var count = HelpContent.Count(); //JocysCom.ClassLibrary.Security.Password.Templates.Call c = new JocysCom.ClassLibrary.Security.Password.Templates.Call("Call Name"); //c.SaveAs("demofile.js"); //c.Load("demofile.js", true); this.ActiveControl = CallsTextBox; //ShowPanelTopCheckBox_CheckedChanged(null, null); //ShowPanelRightCheckBox_CheckedChanged(null, null); //ShowPanelLeftCheckBox_CheckedChanged(null, null); }
public ActionResult Create(FormCollection collection) { var help = new Radyn.Help.DataStructure.Help(); try { this.RadynTryUpdateModel(help, collection); HelpContent helpContent = new HelpContent { Title = help.DefaultTitle, Content = help.DefaultConent, LanguageId = SessionParameters.Culture, CreateDate = DateTime.Now, LastUpdate = DateTime.Now }; if (HelpComponent.Instance.HelpFacade.Insert(help)) { ShowMessage(Resources.Common.InsertSuccessMessage, Resources.Common.MessaageTitle, messageIcon: MessageIcon.Succeed); return(RedirectToAction("Index")); } ShowMessage(Resources.Common.ErrorInInsert, Resources.Common.MessaageTitle, messageIcon: MessageIcon.Error); return(RedirectToAction("Index")); } catch (Exception exception) { ShowExceptionMessage(exception); return(View(help)); } }
public ActionResult Create(HelpContent helpContent) { string strResult = string.Empty; bool bResult = HelpContentService.Add(helpContent, out strResult); string msg = bResult ? "新增成功" : "新增失败"; return(Json(JsonMessageHelper.getJsonMessage(bResult, msg, strResult), "text", JsonRequestBehavior.AllowGet)); }
public void ContentTest() { HelpContent target = new HelpContent(); string expected = "testvalue"; string actual; target.Content = expected; actual = target.Content; Assert.AreEqual(expected, actual); }
public static HelpContent GetContent(this Help.DataStructure.Help help, string culture) { var articleContent = new HelpContentFacade().Get(help.Id, culture); if (articleContent != null) { return(articleContent); } articleContent = new HelpContent() { HelpId = help.Id, Title = help.DefaultTitle, Content = help.DefaultConent, }; return(articleContent); }
public bool Insert(DataStructure.Help obj, HelpContent content) { //try //{ //base.ConnectionHandler.StartTransaction(IsolationLevel.ReadUncommitted); return(base.Insert(obj)); //content.HelpId = obj.Id; //if (!new HelpContentBO().Insert(ConnectionHandler, content)) // throw new Exception("Error In Add Help Content"); //base.ConnectionHandler.CommitTransaction(); // return true; //} //catch (Exception ex) //{ // ConnectionHandler.Transaction.Rollback(); // throw new Exception(ex.Message); //} }
public ActionResult Create(FormCollection collection, Guid helpId) { var helpContent = new HelpContent(); try { this.RadynTryUpdateModel(helpContent, collection); helpContent.CreateDate = DateTime.Now; helpContent.LastUpdate = DateTime.Now; helpContent.HelpId = helpId; if (HelpComponent.Instance.HelpContentFacade.Insert(helpContent)) { ShowMessage(Resources.Common.InsertSuccessMessage, Resources.Common.MessaageTitle, messageIcon: MessageIcon.Succeed); return(RedirectToAction("Index", new { helpId = helpId })); } ShowMessage(Resources.Common.ErrorInInsert, Resources.Common.MessaageTitle, messageIcon: MessageIcon.Error); return(RedirectToAction("Index", new { helpId = helpId })); } catch (Exception exception) { ShowExceptionMessage(exception); return(View(helpContent)); } }
public void HelpContentConstructorTest() { HelpContent target = new HelpContent(); Assert.IsNotNull(target); }