Example #1
0
        public string Save(XmlDocument doc)
        {
            NavigationPortalInfo param = new NavigationPortalInfo();

            param = (NavigationPortalInfo)AjaxUtil.Deserialize(param, doc);

            this.service.Save(param);

            return("{\"message\":{\"returnCode\":0,\"value\":\"�����ɹ���\"}}");
        }
Example #2
0
        // -------------------------------------------------------
        // 添加 删除 修改
        // -------------------------------------------------------

        #region 函数:Save(NavigationPortalInfo param)
        /// <summary>保存记录</summary>
        /// <param name="param">实例<see cref="NavigationPortalInfo"/>详细信息</param>
        /// <returns>实例<see cref="NavigationPortalInfo"/>详细信息</returns>
        public NavigationPortalInfo Save(NavigationPortalInfo param)
        {
            if (!this.IsExist(param.Id))
            {
                this.Insert(param);
            }
            else
            {
                this.Update(param);
            }

            return(param);
        }
Example #3
0
        public string FindOne(XmlDocument doc)
        {
            StringBuilder outString = new StringBuilder();

            string id = XmlHelper.Fetch("id", doc);

            NavigationPortalInfo param = this.service.FindOne(id);

            outString.Append("{\"ajaxStorage\":" + AjaxUtil.Parse <NavigationPortalInfo>(param) + ",");

            outString.Append("\"message\":{\"returnCode\":0,\"value\":\"��ѯ�ɹ���\"}}");

            return(outString.ToString());
        }
Example #4
0
        public string CreateNewObject(XmlDocument doc)
        {
            StringBuilder outString = new StringBuilder();

            NavigationPortalInfo param = new NavigationPortalInfo();

            param.Id = DigitalNumberContext.Generate("Key_Guid");

            param.Status = 1;

            param.UpdateDate = param.CreateDate = DateTime.Now;

            outString.Append("{\"ajaxStorage\":" + AjaxUtil.Parse <NavigationPortalInfo>(param) + ",");

            outString.Append("\"message\":{\"returnCode\":0,\"value\":\"�����ɹ���\"}}");

            return(outString.ToString());
        }
Example #5
0
 /// <summary>修改记录</summary>
 /// <param name="param">实例<see cref="NavigationPortalInfo"/>详细信息</param>
 public void Update(NavigationPortalInfo param)
 {
     this.ibatisMapper.Update(StringHelper.ToProcedurePrefix(string.Format("{0}_Update", this.tableName)), param);
 }
Example #6
0
 /// <summary>添加记录</summary>
 /// <param name="param">实例<see cref="NavigationPortalInfo"/>详细信息</param>
 public void Insert(NavigationPortalInfo param)
 {
     this.ibatisMapper.Insert(StringHelper.ToProcedurePrefix(string.Format("{0}_Insert", this.tableName)), param);
 }
        // -------------------------------------------------------
        // ���� ɾ��
        // -------------------------------------------------------

        #region 属性:Save(NavigationPortalInfo param)
        /// <summary>������¼</summary>
        /// <param name="param">ʵ��<see cref="NavigationPortalInfo"/>��ϸ��Ϣ</param>
        /// <returns>ʵ��<see cref="NavigationPortalInfo"/>��ϸ��Ϣ</returns>
        public NavigationPortalInfo Save(NavigationPortalInfo param)
        {
            return(this.provider.Save(param));
        }
        private string GetContainerHtml(NavigationPortalInfo navigationPortal, IAccountInfo account)
        {
            StringBuilder outString = new StringBuilder();

            outString.Append("<table style=\"width:100%;\" >");
            outString.Append("<tr>");
            outString.Append("<td style=\"width:137px; padding-right:10px; vertical-align:top;\" >");

            IList <NavigationPortalSidebarItemGroupInfo> sidebarItemGroups = NavigationContext.Instance.NavigationPortalSidebarItemGroupService.FindAllByPortalId(navigationPortal.Id);

            IList <NavigationPortalSidebarItemInfo> sidebarItems = NavigationContext.Instance.NavigationPortalSidebarItemService.FindAllByPortalId(navigationPortal.Id);

            int sidebarItemGroupIndex = 0;

            outString.Append("<div class=\"ajax-accordion-container\" >");
            outString.Append("<div id=\"portal$sidebarItemGroup$accordion\" class=\"ajax-accordion-wrapper\" >");
            outString.Append("<script type=\"text/javascript\">");
            outString.Append("var treeViewNodeStorages=[];");
            outString.Append("</script>");

            foreach (NavigationPortalSidebarItemGroupInfo sidebarItemGroup in sidebarItemGroups)
            {
                if (sidebarItemGroup.Status == 1)
                {
                    outString.AppendFormat("<div id=\"portal$sidebarItemGroup$accordion${0}\" class=\"ajax-accordion\" >", sidebarItemGroup.Id);

                    if (sidebarItemGroupIndex == 0)
                    {
                        outString.AppendFormat("<a class=\"ajax-accordion-header begin\" >{0}</a>", sidebarItemGroup.Text);
                    }
                    else if (sidebarItemGroupIndex + 1 == sidebarItemGroups.Count)
                    {
                        outString.AppendFormat("<a class=\"ajax-accordion-header end\" >{0}</a>", sidebarItemGroup.Text);
                    }
                    else
                    {
                        outString.AppendFormat("<a class=\"ajax-accordion-header\" >{0}</a>", sidebarItemGroup.Text);
                    }

                    outString.Append("<div class=\"ajax-accordion-content\" style=\"display:none;\" >");
                    outString.AppendFormat("<div id=\"portal$sidebarItemGroup$accordion$tree${0}\" class=\"ajax-accordion-tree-view\" ></div>", sidebarItemGroup.Id);
                    outString.Append("<script type=\"text/javascript\">");
                    outString.AppendFormat("treeViewNodeStorages[{0}]=[", sidebarItemGroupIndex);

                    // {"id":"无合同无工作联系单类的报销",
                    // "parentId":"0",
                    // "name":"无合同无工作联系单类的报销",
                    // "url":"javascript:xTreeExtend.selected('无合同无工作联系单类的报销','0','无合同无工作联系单类的报销')",
                    // "title":"无合同无工作联系单类的报销",
                    // "target":"",
                    // "hasChildren":"true"},
                    sidebarItems.Where <NavigationPortalSidebarItemInfo>((item, index) => (item.SidebarItemGroupId == sidebarItemGroup.Id && item.Status == 1)).ToList().ForEach(item =>
                    {
                        if (item.Status == 1)
                        {
                            outString.Append("{");
                            outString.Append("id:\"" + item.Id + "\",");
                            outString.Append("parentId:\"" + (item.ParentId == "00000000-0000-0000-0000-000000000000" ? "0" : item.ParentId) + "\",");
                            outString.Append("name:\"" + item.Text + "\",");
                            outString.Append("url:\"" + item.Url + "\",");
                            outString.Append("title:\"" + item.Description + "\",");
                            outString.Append("target:\"" + item.Target + "\",");
                            outString.Append("hasChildren:\"true\"");
                            outString.Append("},");
                        }
                    });

                    if (outString.ToString().Substring(outString.Length - 1, 1) == ",")
                    {
                        outString = outString.Remove(outString.Length - 1, 1);
                    }

                    outString.AppendLine("];");
                    outString.Append("</script>");
                    outString.Append("</div>");
                    outString.Append("</div>");

                    sidebarItemGroupIndex++;
                }
            }
            outString.Append("</div>");
            outString.Append("</div>");
            outString.Append("<div class=\"ajax-accordion-placeholder\"></div>");

            outString.Append("</td>");
            outString.Append("<td>");
            // outString.Append("<td>");

            outString.Append("<div class=\"x-ui-pkg-customize-menu\" style=\"padding:0;\" ></div>");
            outString.Append("<div class=\"x-ui-pkg-customize-dialog-wrapper\" style=\"display:none;\" >");
            outString.Append("<div class=\"x-ui-pkg-customize-dialog\" ></div>");
            outString.Append("</div>");
            outString.Append("<div class=\"x-ui-pkg-customize-wrapper\">");

            //if (docEditMode == DocEditMode.Edit && !string.IsNullOrEmpty(resetWidgetZone))
            //{
            //  outString.Append(CustomizeContext.Instance.WidgetZoneService.GetHtml(resetWidgetZone));
            //}
            //else
            //{
            //  outString.Append(BuilderContext.Instance.CustomizeManagement.ParseHomePage("Organization", navigationPortal.OrganizationId));
            //}

            outString.Append(BuilderContext.Instance.CustomizeManagement.ParseHomePage("Organization", navigationPortal.OrganizationUnitId));

            outString.Append("</div>");
            outString.Append("</td>");
            outString.Append("</tr>");
            outString.Append("</table>");

            return(outString.ToString());
        }