Example #1
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        M_Style mStyle = new M_Style();
        mStyle.StyleCategoryId = int.Parse(ddlStyleType.SelectedValue.ToString());
        mStyle.StyleCategoryId = 1;
        mStyle.Name = txtTypeName.Text.Trim();

        B_KyCommon bllCom = new B_KyCommon();
        bool flag = bllCom.CheckHas(mStyle.Name, "Name", "KyStyle");

        mStyle.Content = test.Value.Trim();
        mStyle.Type = modelId;
        B_Style bllStyle = new B_Style();
        if (btnSave.Text == "添加样式")
        {
            if (!flag)
            {
                bllStyle.AddStyle(mStyle);
                StyleBind();
            }
            else
            {
                Response.Write("<script>alert('己存在此样式')</script>");
                StyleBind();
            }
        }
    }
Example #2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     AdminGroupBll.Power_Judge(10);
     Response.Cache.SetNoStore();
     if (Request.QueryString["StyleId"] != null && Request.QueryString["StyleId"] != "")
     {
         try
         {
             StyleId = int.Parse(Request.QueryString["StyleId"]);
         }
         catch{}
     }
     if(StyleId==0)
     {
         return;
     }
     B_Style bll = new B_Style();
     DataTable dt = bll.GetStyleList(bll.StyleIDGetStylegoryId(StyleId));
     DataRow[] dr = dt.Select("StyleId=" + StyleId);
     if (dr.Length == 0)
     {
         return;
     }
     Response.Write(dr[0]["Content"].ToString());
     //
 }
Example #3
0
 private void StyleBind()
 {
     B_Style bll = new B_Style();
     ddlStyle.DataSource = bll.GetStyleByModel(0);
     ddlStyle.DataTextField = "Name";
     ddlStyle.DataValueField = "StyleID";
     ddlStyle.DataBind();
 }
Example #4
0
 protected void repLabelContent_ItemCommand(object sender, RepeaterCommandEventArgs e)
 {
     Label lbId = e.Item.FindControl("lbStyleId") as Label;
     int styleId = int.Parse(lbId.Text);
     B_Style bll_style = new B_Style();
     bll_style.Delete(styleId);
     StyleBind();
 }
Example #5
0
 private void StyleBind()
 {
     B_Style bll = new B_Style();
     DataTable dtStyle = bll.GetStyleByModel(modelId);
     ddlStyle.DataSource = dtStyle;
     ddlStyle.DataTextField = "Name";
     ddlStyle.DataValueField = "StyleID";
     ddlStyle.DataBind();
     DataTable commdt = bll.GetStyleByModel(0);
     if (dtStyle.Rows.Count <= 0 && commdt.Rows.Count <= 0)
         ddlStyle.Items.Add(new ListItem("请创建样式", "custom"));
     for (int i = 0; i < commdt.Rows.Count; i++)
     {
         ListItem lstItem = new ListItem(commdt.Rows[i]["Name"].ToString(), commdt.Rows[i]["StyleID"].ToString());
         lstItem.Attributes.Add("style", "background-color:#D5E9F9;border:solid 1px #FFF;");
         ddlStyle.Items.Insert(i, lstItem);
     }
     ddlStyle.Items.Add(new ListItem("自定义", "0"));
 }
Example #6
0
 private string GetStyleContent(int styleId)
 {
     if (!this.styleCache.Contains(styleId))
     {
         string styleContent = new B_Style().GetStyleContent(styleId);
         this.styleCache.Add(styleId, styleContent);
     }
     return this.styleCache[styleId].ToString();
 }
    private void StyleBind()
    {
        B_Style bll = new B_Style();
        ddlStyle.DataSource = bll.GetAllStyle();
        ddlStyle.DataTextField = "Name";
        ddlStyle.DataValueField = "StyleID";
        ddlStyle.DataBind();
        ddlStyle.Items.Add(new ListItem("自定义","0"));

        ddlColumnStyle.DataSource = bll.GetAllStyle();
        ddlColumnStyle.DataTextField = "Name";
        ddlColumnStyle.DataValueField = "StyleID";
        ddlColumnStyle.DataBind();
    }
Example #8
0
    protected void Page_Load(object sender, EventArgs e)
    {
        AdminGroupBll.Power_Judge(10);
        if (!IsPostBack)
        {
            SkipPageUrl = Request.ServerVariables["HTTP_REFERER"].ToString();

            UserModelBind();
            if (Request.QueryString["modelId"] != null)
            {
                isShowTr = int.Parse(Request.QueryString["modelId"].ToString());
            }
            GetCustomListDt(isShowTr);

            BindStyleCategory();    //绑定类别样式
            if (Request.QueryString["StyleId"] == null)
            {
                btnSave.Text = "添加样式";
            }
            else
            {
                btnSave.Text = "修改样式";
                B_Style bStyle = new B_Style();
                M_Style mStyle = bStyle.GetStyle(int.Parse(Request.QueryString["StyleId"].ToString()));
                txtTypeName.Text = mStyle.Name;
                int styleCategory = mStyle.StyleCategoryId;
                test.Value = mStyle.Content.ToString();
                for (int i = 0; i < ddlStyleType.Items.Count; i++)
                {
                    if (ddlStyleType.Items[i].Value.ToString() == styleCategory.ToString())
                        ddlStyleType.Items[i].Selected = true;
                }
            }
            AjaxPro.Utility.RegisterTypeForAjax(typeof(System_Label_SetStyle));
        }
    }
Example #9
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        string id;
        if (Request.QueryString["id"] == null)
        {
            id = Request.QueryString["modelId"].ToString();
        }
        else
        {
            id = Request.QueryString["id"].ToString();
        }
        M_Style mStyle = new M_Style();
        mStyle.StyleCategoryId = int.Parse(ddlStyleType.SelectedValue.ToString());
        mStyle.Name = txtTypeName.Text.Trim();

        B_KyCommon bllCom = new B_KyCommon();
        bool flag = bllCom.CheckHas(mStyle.Name, "Name", "KyStyle");

        mStyle.Content = test.Value.Trim();
        mStyle.Type = int.Parse(id);
        B_Style bllStyle = new B_Style();
        if (btnSave.Text == "添加样式")
        {
            if (!flag)
            {
                bllStyle.AddStyle(mStyle);
                Response.Redirect(SkipPageUrl);
            }
            else
                Response.Write("<script>alert('此样式已存在')</script>");
        }
        else
        {
                mStyle.StyleID = int.Parse(Request.QueryString["StyleId"].ToString());
                bllStyle.UpadteStyle(mStyle);
                Response.Redirect(SkipPageUrl);
        }
    }
Example #10
0
    private void StyleBind()
    {
        B_Style bllStyle = new B_Style();
        ddlStyle.DataSource = bllStyle.GetAllStyle();
        ddlStyle.DataTextField = "Name";
        ddlStyle.DataValueField = "StyleID";
        ddlStyle.DataBind();

        dropStyle.DataSource = bllStyle.GetAllStyle();
        dropStyle.DataTextField = "Name";
        dropStyle.DataValueField = "StyleID";
        dropStyle.DataBind();
    }
Example #11
0
 protected void repStyle_ItemCommand(object sender, RepeaterCommandEventArgs e)
 {
     Label lbId = e.Item.FindControl("lbStyleId") as Label;
     int styleId = int.Parse(lbId.Text);
     B_Style bll_style = new B_Style();
     bll_style.Delete(styleId);
     if (Request.QueryString["parentId"] == null || Request.QueryString["parentId"].ToString().Length==0)
         StyleBind(0);
     else
         StyleBind(int.Parse(Request.QueryString["parentId"]));
 }
Example #12
0
 private void StyleCategory(int parentId)
 {
     DataTable dt;
     int styleCategoryId;
     B_Style bll = new B_Style();
     dt = bll.StyleCategory_GetList(parentId);
     repStyleCategory.DataSource = dt;
     repStyleCategory.DataBind();
     if (Request.QueryString["parentId"] == null)
     {
         styleCategoryId = 0;
     }
     else
     {
         try
         {
             styleCategoryId = int.Parse(Request.QueryString["parentId"]);
         }
         catch
         {
             styleCategoryId = 0;
         }
     }
     StyleBind(styleCategoryId);
 }
Example #13
0
 /// <summary>
 /// 绑定样式的值
 /// </summary>
 private void StyleBind(int styleId)
 {
     B_Style bll_Style = new B_Style();
     repStyle.DataSource = bll_Style.GetStyleList(styleId);
     repStyle.DataBind();
 }
Example #14
0
 private void LabelContentBind(string labelName, int cursorPage, int pageSize, ref int recordCount)
 {
     B_Style bll = new B_Style();
     repLabelContent.DataSource = bll.GetStyleNameList(labelName, cursorPage, pageSize, ref recordCount);
     repLabelContent.DataBind();
 }