Ejemplo n.º 1
0
        private void LoadHelp(string formkey)
        {
            BHelp     bhelp = new BHelp();
            HelpProxy pLoad = bhelp.GetHelpByFormKey(formkey);

            LiteralContent.Text = pLoad.HtmlCotent;
        }
Ejemplo n.º 2
0
        /// <summary>
        /// برگرداندن ریشه درخت
        /// </summary>
        /// <returns>پروکسی راهنما</returns>
        public HelpProxy GetHelpRoot()
        {
            try
            {
                IList <Help> helpList = helpRepository.GetHelpTree();
                if (helpList.Count > 1)
                {
                    throw new InvalidDatabaseStateException(UIFatalExceptionIdentifiers.HelpRootIsMorThanOne, "Help Root more than one", ExceptionSrc);
                }
                Help      help  = helpList.FirstOrDefault();
                HelpProxy proxy = new HelpProxy();

                if (helpList != null)
                {
                    proxy.ID      = help.ID;
                    proxy.FormKey = help.FormKey;
                    if (BLanguage.CurrentLocalLanguage == LanguagesName.Parsi)
                    {
                        proxy.Name       = help.FaName;
                        proxy.HtmlCotent = help.FaHTMLContent;
                    }
                    else
                    {
                        proxy.Name       = help.EnName;
                        proxy.HtmlCotent = help.EnHTMLContent;
                    }
                }
                return(proxy);
            }
            catch (Exception ex)
            {
                LogException(ex, "BHelp", "GetHelpRoot");
                throw ex;
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// یک کلید فرم دریافت میکند و محتوا را برمیگرداند
        /// </summary>
        /// <param name="FormKey">کلید فرم</param>
        /// <returns>پروکسی راهنما</returns>
        public HelpProxy GetHelpByFormKey(string FormKey)
        {
            try
            {
                HelpProxy proxy = new HelpProxy();
                Help      hlp   = null;

                hlp = helpRepository.GetByCriteria(new CriteriaStruct(Utility.GetPropertyName((() => new Help().FormKey)), FormKey)).FirstOrDefault();
                if (hlp == null)
                {
                    throw new InvalidDatabaseStateException(UIFatalExceptionIdentifiers.HelpFormKeyDoesNotExists, String.Format("راهنمایی برای فرم با کلید {0} موجود نیست", FormKey), "GTS.Clock.Business.BHelp");
                }
                proxy.ID      = hlp.ID;
                proxy.FormKey = hlp.FormKey;
                if (BLanguage.CurrentLocalLanguage == LanguagesName.Parsi)
                {
                    proxy.Name       = hlp.FaName;
                    proxy.HtmlCotent = hlp.FaHTMLContent;
                }
                else
                {
                    proxy.Name       = hlp.EnName;
                    proxy.HtmlCotent = hlp.EnHTMLContent;
                }
                return(proxy);
            }
            catch (Exception ex)
            {
                LogException(ex);
                throw ex;
            }
        }
Ejemplo n.º 4
0
        private void LoadContent(string itmSelected)
        {
            BHelp     bhelp = new BHelp();
            HelpProxy help  = new HelpProxy();

            help = bhelp.GetHelpByFormKey(itmSelected);
            FreeTextBox1.Text = help.HtmlCotent;
        }
Ejemplo n.º 5
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            BHelp     bhelp = new BHelp();
            HelpProxy help  = new HelpProxy();

            help.ID         = Convert.ToDecimal(HFFormID.Value);
            help.HtmlCotent = FreeTextBox1.Text;
            bhelp.UpdateHelp(help);
            HFMassegeOk.Value = "ok";
        }
Ejemplo n.º 6
0
        private void LoadTreeView()
        {
            BHelp     bhelp = new BHelp();
            HelpProxy proot = bhelp.GetHelpRoot();

            ComponentArt.Web.UI.TreeViewNode nodeRoot = new ComponentArt.Web.UI.TreeViewNode();
            nodeRoot.Text  = proot.Name;
            nodeRoot.ID    = proot.FormKey.ToString();
            nodeRoot.Value = proot.ID.ToString();
            LoadChild(nodeRoot);
            TreeViewHelpForm_HelpForm.Nodes.Add(nodeRoot);
        }
Ejemplo n.º 7
0
        /// <summary>
        /// برگرداندن گرهای یک والد
        /// </summary>
        /// <param name="helpId">کلید اصلی والد</param>
        /// <returns>لیست پروکسی راهنما</returns>
        public IList <HelpProxy> GetHelpChilds(decimal helpId)
        {
            try
            {
                IList <Help> helpList = helpRepository.GetByCriteria(new CriteriaStruct(Utility.GetPropertyName(() => new Help().Parent), new Help()
                {
                    ID = helpId
                }));
                IList <HelpProxy> proxyList = new List <HelpProxy>();

                foreach (Help child in helpList.OrderBy(x => x.LevelOrder).ToList())
                {
                    HelpProxy proxy = new HelpProxy();

                    if (helpList != null)
                    {
                        proxy.ID       = child.ID;
                        proxy.FormKey  = child.FormKey;
                        proxy.ParentId = helpId;
                        if (BLanguage.CurrentLocalLanguage == LanguagesName.Parsi)
                        {
                            proxy.Name       = child.FaName;
                            proxy.HtmlCotent = child.FaHTMLContent;
                        }
                        else
                        {
                            proxy.Name       = child.EnName;
                            proxy.HtmlCotent = child.EnHTMLContent;
                        }
                    }
                    proxyList.Add(proxy);
                }
                return(proxyList);
            }
            catch (Exception ex)
            {
                LogException(ex, "BHelp", "GetHelpChilds");
                throw ex;
            }
        }
Ejemplo n.º 8
0
        /// <summary>
        /// به روز رسانی راهنما در دیتابیس
        /// </summary>
        /// <param name="proxy">پروکسی راهنما</param>
        public void UpdateHelp(HelpProxy proxy)
        {
            try
            {
                Help help = base.GetByID(proxy.ID);

                if (BLanguage.CurrentLocalLanguage == LanguagesName.Parsi)
                {
                    help.FaHTMLContent = proxy.HtmlCotent;
                }
                else
                {
                    help.EnHTMLContent = proxy.HtmlCotent;
                }
                this.SaveChanges(help, UIActionType.EDIT);
            }
            catch (Exception ex)
            {
                LogException(ex, "BHelp", "UpdateHelp");
                throw ex;
            }
        }
Ejemplo n.º 9
0
        public void GetRoot_Test()
        {
            HelpProxy proxy = busHlp.GetHelpRoot();

            Assert.IsTrue(proxy.ID > 0);
        }
Ejemplo n.º 10
0
        public void GetHelpByFormKey()
        {
            HelpProxy hlp = busHlp.GetHelpByFormKey("tlbItemHelp_TlbShift");

            Assert.IsNotNull(hlp);
        }