Example #1
0
        public IActionResult SearchFuncAdd()
        {
            M_Search shMod = new M_Search();

            if (Mid > 0)
            {
                shMod = shBll.GetSearchById(Mid);
            }
            else
            {
                shMod.BKColor = colorArr[new Random().Next(colorArr.Length - 1)];
            }
            return(View(shMod));
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (function.isAjax())
            {
                string action = Request.Form["action"];
                string result = "";
                switch (action)
                {
                case "checkname":
                    result = CheckSearchName();
                    break;

                default:
                    break;
                }
                Response.Write(result); Response.Flush(); Response.End();
                return;
            }
            if (!IsPostBack)
            {
                if (Mid > 0)
                {
                    searchMod    = b_search.GetSearchById(Mid);
                    txtName.Text = searchMod.Name;
                    //rdoType.SelectedValue = search.Type.ToString();
                    txtFileUrl.Text             = searchMod.FlieUrl;
                    Edit_Btn.InnerText          = "保存设置";
                    hideid.Value                = ID.ToString();
                    ItemIcon_T.Text             = searchMod.Ico;
                    EditSearchName_Hid.Value    = searchMod.Name;
                    rdoOpenType.SelectedValue   = searchMod.OpenType.ToString();
                    SupportMobile.SelectedValue = searchMod.Mobile.ToString();
                    MotroSize.SelectedValue     = searchMod.Size.ToString();
                    txtOrderID.Value            = searchMod.OrderID.ToString();
                    IsEliteLevel.Checked        = searchMod.EliteLevel == 1 ? true : false;
                    function.Script(this, "CheckUserType();");
                }
                DataTable dt = groupBll.Select_All();
                selGroup_Rpt.DataSource = dt;
                selGroup_Rpt.DataBind();
                Call.SetBreadCrumb(Master, "<li><a href='" + customPath2 + "I/Main.aspx'>工作台</a></li><li><a href=\"UserFunc.aspx?LinkType=3\">会员导航</a></li><li class='active'>添加会员导航</li>");
            }
        }
Example #3
0
        //文件邦定事件
        protected void gvCard_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                int id = DataConverter.CLng((e.Row.FindControl("hfId") as HiddenField).Value);
                e.Row.Attributes.Add("ondblclick", "location.href='AddSearch.aspx?menu=edit&id=" + id + "'");
                M_Search sea = b_search.GetSearchById(id);
                if (sea != null)
                {
                    Image imgLinkType = e.Row.FindControl("imgLinkType") as Image;
                    Label linkType    = e.Row.FindControl("linkType") as Label;
                    Label lblState    = e.Row.FindControl("lblState") as Label;
                    switch (sea.Type)
                    {
                    case 0:                                       //站内链接
                        if (sea.LinkState == 1 && sea.State == 1) //存在该文件并且启用
                        {
                            lblState.Text = "启用";
                        }
                        if (sea.LinkState == 2 || sea.State == 2)    //不存在该文件
                        {
                            lblState.Text = "停用";
                        }
                        linkType.Text = "<i class='fa fa-folder-open' title='站内应用' style='color:#FF7A00;'></i>";
                        break;

                    case 1:    //用户中心
                        linkType.Text = "<i class='fa fa-list-alt' title='用户中心' style='color:#FF7A00;'></i>";
                        break;

                    case 2:    //站外链接
                        linkType.Text = "<i class='fa fa-folder-open' title='站内应用' style='color:#FF7A00;'></i>";
                        break;

                    default:
                        break;
                    }
                    if (sea.State == 2) //文件未启用
                    {
                        lblState.Text = "停用";
                    }
                    if (sea.State == 1) //文件启用
                    {
                        lblState.Text = "启用";
                    }
                    sea.FlieUrl = sea.FlieUrl.ToLower();
                    if (sea.FlieUrl.StartsWith("http:") || sea.FlieUrl.StartsWith("https:"))
                    {
                        linkType.Text = "<i class='fa fa-chain' title='站外链接' style='color:#FF7A00;'></i>";
                    }
                }
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (function.isAjax())
            {
                string action = Request.Form["action"];
                string result = "";
                switch (action)
                {
                case "checkname":
                    result = CheckSearchName();
                    break;

                default:
                    break;
                }
                Response.Write(result); Response.Flush(); Response.End();
                return;
            }
            if (!IsPostBack)
            {
                if (Mid > 0)
                {
                    searchMod    = b_search.GetSearchById(Mid);
                    txtName.Text = searchMod.Name;
                    //rdoType.SelectedValue = search.Type.ToString();
                    txtFileUrl.Text             = searchMod.FlieUrl;
                    Edit_Btn.InnerText          = "保存设置";
                    EditSearchName_Hid.Value    = searchMod.Name;
                    hideid.Value                = ID.ToString();
                    ItemIcon_T.Text             = searchMod.Ico;
                    rdoOpenType.SelectedValue   = searchMod.OpenType.ToString();
                    SupportMobile.SelectedValue = searchMod.Mobile.ToString();
                    MotroSize.SelectedValue     = searchMod.Size.ToString();
                    txtOrderID.Value            = searchMod.OrderID.ToString();
                }
                Call.SetBreadCrumb(Master, "<li><a href='" + customPath2 + "I/Main.aspx'>工作台</a></li><li><a href=\"SearchFunc.aspx\">管理导航</a></li><li class=\"active\">管理导航管理</li>");
            }
        }