Esempio n. 1
0
        protected void DeleteSpeValue()
        {
            KingTop.Common.AjaxMessage msg = new KingTop.Common.AjaxMessage();
            string sId = Utils.RequestStr("id");

            try
            {
                string sSql    = string.Format("delete K_M_SpecificationValue where ID=" + sId);
                int    iCounts = SQLHelper.ExecuteNonQuery(sSql);
                if (iCounts > 0)
                {
                    msg.Code = 200;
                }
                else
                {
                    msg.Code    = 404;
                    msg.Message = "数据不存在";
                }
            }
            catch (Exception err)
            {
                msg.Code    = 500;
                msg.Message = err.Message;
            }


            ShowText(msg.ToJson());
        }
Esempio n. 2
0
        protected void RemoveItem()
        {
            KingTop.Common.AjaxMessage msg = new KingTop.Common.AjaxMessage();
            string sId = Utils.RequestStr("id");

            try
            {
                string sSql    = string.Format("update K_Category set IsDel=1 where ID=" + sId);
                int    iCounts = SQLHelper.ExecuteNonQuery(sSql);
                if (iCounts > 0)
                {
                    msg.Code = 200;
                    KingTop.Modules.BLL.Categorys bCategory = new KingTop.Modules.BLL.Categorys();
                    bCategory.SetCategoryCache();
                }
                else
                {
                    msg.Code    = 404;
                    msg.Message = "数据不存在";
                }
            }
            catch (Exception err)
            {
                msg.Code    = 500;
                msg.Message = err.Message;
            }


            ShowText(msg.ToJson());
        }
Esempio n. 3
0
        protected void GetSelect()
        {
            KingTop.Common.AjaxMessage msg = new KingTop.Common.AjaxMessage();
            string sName = Utils.RequestStr("name");

            if (string.IsNullOrEmpty(sName))
            {
                sName = "CategoryIDS";
            }
            try
            {
                KingTop.Modules.BLL.Categorys bCategory = new KingTop.Modules.BLL.Categorys();
                dt = bcategory.GetCategoryCache();
                StringBuilder sb = new StringBuilder();
                sb.Append("<span class=\"spancategory\">");
                sb.AppendFormat("<select name=\"{0}\" class=\"addcategorycss\">", sName);
                sb.Append("<option value=\"0\">请选择分类</option>");
                sb.Append(InnerCategory("0"));
                sb.Append("</select>");
                sb.Append("<a href=\"javascript:\" onclick=\"removeCategory(this)\">删除</a>");
                sb.Append("</span>");
                msg.Code    = 200;
                msg.Message = sb.ToString();
            }
            catch (Exception err)
            {
                msg.Code    = 500;
                msg.Message = err.Message;
            }
            ShowText(msg.ToJson());
        }
Esempio n. 4
0
        protected void GetSelectedList()
        {
            KingTop.Common.AjaxMessage msg = new KingTop.Common.AjaxMessage();
            string sCategoryID             = Utils.RequestStr("id");
            string sCategoryIDS            = Utils.RequestStr("ids");
            string sName = Utils.RequestStr("name");

            if (string.IsNullOrEmpty(sName))
            {
                sName = "CategoryIDS";
            }
            try
            {
                StringBuilder sb = new StringBuilder();
                if (!string.IsNullOrEmpty(sCategoryIDS) && !string.IsNullOrEmpty(sCategoryID))
                {
                    KingTop.Modules.BLL.Categorys bCategory = new Modules.BLL.Categorys();
                    dt = bcategory.GetCategoryCache();

                    string[] ids = sCategoryIDS.Split(',');
                    for (int i = 0; i < ids.Length; i++)
                    {
                        if (ids[i] != sCategoryID)
                        {
                            sb.Append("<span class=\"spancategory\">");
                            sb.AppendFormat("<select name=\"{0}\" class=\"addcategorycss\">", sName);
                            sb.Append("<option value=\"0\">请选择分类</option>");
                            sb.Append(InnerSelectCategory("0", ids[i]));
                            sb.Append("</select>");
                            sb.Append("<a href=\"javascript:\" onclick=\"removeCategory(this)\">删除</a>");
                            sb.Append("</span>");
                        }
                    }
                }
                msg.Code    = 200;
                msg.Message = sb.ToString();
            }
            catch (Exception err)
            {
                msg.Code    = 500;
                msg.Message = err.Message;
            }
            ShowText(msg.ToJson());
        }
Esempio n. 5
0
        protected void ShowIndex()
        {
            KingTop.Common.AjaxMessage msg = new KingTop.Common.AjaxMessage();
            string sId = Utils.RequestStr("id");

            try
            {
                string sStr = string.Empty;
                KingTop.Modules.BLL.Categorys bCategory = new KingTop.Modules.BLL.Categorys();
                DataTable dt = bcategory.GetCategoryCache();
                if (dt != null && dt.Rows.Count > 0)
                {
                    DataRow[] dr = dt.Select("ID=" + sId);
                    if (dr.Length > 0)
                    {
                        sStr = dr[0]["IsIndex"].ToString() == "1" ? "0" : "1";
                    }
                    string sSql    = string.Format("update K_Category set IsIndex={0} where ID={1}", sStr, sId);
                    int    iCounts = SQLHelper.ExecuteNonQuery(sSql);
                    if (iCounts > 0)
                    {
                        msg.Code = 200;
                        msg.Data = sStr;
                        bCategory.SetCategoryCache();
                    }
                    else
                    {
                        msg.Code    = 404;
                        msg.Message = "数据不存在";
                    }
                }
                else
                {
                    msg.Code    = 404;
                    msg.Message = "数据不存在";
                }
            }
            catch (Exception err)
            {
                msg.Code    = 500;
                msg.Message = err.Message;
            }
            ShowText(msg.ToJson());
        }
Esempio n. 6
0
        protected void GetCategoryList()
        {
            KingTop.Common.AjaxMessage msg = new KingTop.Common.AjaxMessage();
            string nodeCode = KingTop.Common.Utils.CheckSql(Request["NodeCode"]);

            try
            {
                msg.Code    = 200;
                msg.Message = GetList("0", nodeCode);
            }
            catch (Exception err)
            {
                msg.Code    = 500;
                msg.Message = err.Message;
            }


            ShowText(msg.ToJson());
        }