Beispiel #1
0
        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);
        }
Beispiel #2
0
        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));
            }
        }
Beispiel #3
0
        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));
        }
Beispiel #4
0
        public void ContentTest()
        {
            HelpContent target   = new HelpContent();
            string      expected = "testvalue";
            string      actual;

            target.Content = expected;
            actual         = target.Content;
            Assert.AreEqual(expected, actual);
        }
Beispiel #5
0
        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);
        }
Beispiel #6
0
 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);
     //}
 }
Beispiel #7
0
        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));
            }
        }
Beispiel #8
0
        public void HelpContentConstructorTest()
        {
            HelpContent target = new HelpContent();

            Assert.IsNotNull(target);
        }