コード例 #1
0
        /// <summary>
        /// 根据id更新内容链接
        /// </summary>
        /// <param name="Ids"></param>
        private void UpdateContentById(string url, string Ids)
        {
            C_ContentApp    contentapp    = new C_ContentApp();
            C_ContentEntity contentEntity = contentapp.GetForm(Ids);

            if (contentEntity != null)
            {
                contentEntity.F_UrlAddress = url;
                contentapp.SubmitForm(contentEntity, Ids);
            }
        }
コード例 #2
0
        /// <summary>
        /// 初始化
        /// </summary>
        /// <param name="Id"></param>
        private void InitHtmlSavePath(string Id)
        {
            if (!string.IsNullOrEmpty(Id))
            {
                if (CONTENTENTITY == null || CONTENTENTITY.F_Id != Id)
                {
                    C_ContentApp contentapp = new C_ContentApp();
                    CONTENTENTITY = contentapp.GetForm(Id);
                    C_ModulesEntity moduleentity = contentapp.GetModuleByContentID(Id);

                    if (JudgmentHelp.judgmentHelp.IsNullEntity <C_ModulesEntity>(moduleentity))
                    {
                        HTMLSAVEPATH += moduleentity.F_ActionName + @"\";
                    }
                }
            }
        }
コード例 #3
0
        /// <summary>
        /// 根据栏目id获取内容集合
        /// </summary>
        /// <param name="Ids"></param>
        /// <returns></returns>
        private string GetContentsById(string Ids, string mcodes, Dictionary <string, string> attrs)
        {
            string                       strs            = "";
            C_ContentApp                 contentapp      = new C_ContentApp();
            List <C_ContentEntity>       contententitys  = new List <C_ContentEntity>();
            IQueryable <C_ContentEntity> contententitysT = null;

            //数据源
            if (attrs.ContainsKey("sourcename"))
            {
                string sourceName = "";
                attrs.TryGetValue("sourcename", out sourceName);
                C_ModulesApp    modulesApp   = new C_ModulesApp();
                C_ModulesEntity moduleentity = new C_ModulesEntity();
                moduleentity = modulesApp.GetFormByActionName(sourceName);
                if (moduleentity != null && moduleentity.F_Id != Guid.Empty.ToString())
                {
                    contententitysT = contentapp.GetListIq(moduleentity.F_Id);
                }
            }
            else
            {
                contententitysT = contentapp.GetListIq(Ids);
            }
            if (contententitysT != null)
            {
                //排序
                if (attrs.ContainsKey("sort"))
                {
                    string val = "";
                    attrs.TryGetValue("sort", out val);

                    string sortName = "F_" + val;
                    contententitysT = contententitysT.OrderBy(sortName);
                }
                //排序
                if (attrs.ContainsKey("sortdesc"))
                {
                    string val = "";
                    attrs.TryGetValue("sortdesc", out val);

                    string sortName = "F_" + val;
                    contententitysT = contententitysT.OrderBy(sortName, true);
                }
                //行数
                if (attrs.ContainsKey("tatol"))
                {
                    string val = "";
                    attrs.TryGetValue("tatol", out val);
                    int tatolnum = 0;
                    if (int.TryParse(val, out tatolnum))
                    {
                        contententitys = contententitysT.Take(tatolnum).ToList();
                    }
                }
                //处理连接地址
                contententitys.ForEach(delegate(C_ContentEntity model)
                {
                    if (model != null && model.F_UrlAddress != null)
                    {
                        model.F_UrlPage = model.F_UrlAddress;
                        model.F_UrlPage = model.F_UrlPage.Replace(@"\", "/");
                    }
                });
                if (contententitys != null && contententitys.Count > 0)
                {
                    foreach (C_ContentEntity contententity in contententitys)
                    {
                        strs += GetHtmlPage(mcodes, contententity);
                    }
                }
            }
            return(strs);
        }