Esempio n. 1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        m_ExhibitionList = ExhibitionProvider.SelectAll();
        string action = GetstringKey("action");

        if (action != "save")
        {
            if (!string.IsNullOrEmpty(this.Request["iD"]))
            {
                int        _iD       = Convert.ToInt32(this.Request["iD"]);
                Exhibition condition = new Exhibition();
                condition.ID = _iD;
                news         = TableOperate <Exhibition> .GetRowData(condition);

                m_nowChild = Convert.ToString(news.Child).ToLower();
                iD.Value   = Convert.ToString(news.ID);
            }
            DataBind();
        }
        else
        {
            Result     result         = new Result();
            string     logbrief       = "";
            Exhibition newChannelNews = new Exhibition();
            newChannelNews.ID = 0;
            newChannelNews.AutoForm(this.Page);
            string title = newChannelNews.Name;
            int    _iD;
            if (!string.IsNullOrEmpty(this.Request["iD"]))
            {
                _iD = Convert.ToInt32(this.Request["iD"]);
                ExhibitionProvider.Update(newChannelNews);
                result.msg = "编辑成功,等待返回列表";
                logbrief   = "管理员:【" + AdminMethod.AdminFullName + "】在" + DateTime.Now.GetDateTimeFormats('f')[0].ToString() + "编辑了为【" + title + "】的展厅架构";
            }
            else
            {
                newChannelNews.AddTime = DateTime.Now;
                newChannelNews.AddID   = AdminMethod.AdminID;
                _iD        = ExhibitionProvider.Insert(newChannelNews);
                result.msg = "添加成功,等待返回列表";
                logbrief   = "管理员:【" + AdminMethod.AdminFullName + "】在" + DateTime.Now.GetDateTimeFormats('f')[0].ToString() + "添加了为【" + title + "】的展厅架构";
            }

            if (_iD > 0)
            {
                result.isOk = true;
                Lognet.AddLogin(logbrief);
            }
            else
            {
                result.msg = "操作失败";
            }
            Response.ContentType = "text/json";
            Response.Write(new JavaScriptSerializer().Serialize(result));
            Response.End();
        }
        DataBind();
    }
Esempio n. 2
0
    /// <summary>
    /// 获取所有展厅
    /// </summary>
    /// <returns></returns>
    public static List <Exhibition> GetTExhibitionList()
    {
        List <Exhibition> list = ExhibitionProvider.SelectAll();

        return(list);
    }
Esempio n. 3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        m_ExhibitionList = ExhibitionProvider.SelectAll();
        string action = GetstringKey("action");

        if (action != "save")
        {
            if (!string.IsNullOrEmpty(this.Request["iD"]))
            {
                MyID = Convert.ToInt32(this.Request["iD"]);

                Admin_User condition = new Admin_User();
                if (MyID == -1)
                {
                    condition.ID = AdminMethod.AdminID;

                    states.Disabled = true;
                }
                else
                {
                    condition.ID = MyID;
                }

                news = TableOperate <Admin_User> .GetRowData(condition);

                iD.Value = Convert.ToString(news.ID);


                states.Value = Convert.ToString(news.States);
            }
            DataBind();
        }
        else
        {
            Result     result         = new Result();
            string     logbrief       = "";
            Admin_User newChannelNews = new Admin_User();
            newChannelNews.ID = 0;
            newChannelNews.AutoForm(this.Page);
            string title   = newChannelNews.Name;
            string headpic = Draw.Drawing(newChannelNews.FullName, newChannelNews.FullName + "_" + newChannelNews.Name + ".png");
            newChannelNews.HeadPic = headpic;
            string pass;
            if (!string.IsNullOrEmpty(this.Request["pass"]))
            {
                pass = Convert.ToString(this.Request["pass"]);
                pass = Md5JiaMi.JiaMi(pass);     // md5加密
            }
            else
            {
                pass = Convert.ToString(this.Request["oldpass"]);
            }
            newChannelNews.Pass = pass;
            int _iD;
            if (!string.IsNullOrEmpty(this.Request["iD"]))
            {
                _iD = Convert.ToInt32(this.Request["iD"]);
                TableOperate <Admin_User> .Update(newChannelNews);

                result.msg = "编辑成功,等待返回列表";
                logbrief   = "管理员:【" + AdminMethod.AdminFullName + "】在" + DateTime.Now.GetDateTimeFormats('f')[0].ToString() + "编辑了为【" + title + "】的管理员";
            }
            else
            {
                string name = Convert.ToString(Request["name"]);
                name = RequestString.NoHTML(name);
                if (AdminMethod.IsName(name))
                {
                    result.msg           = "用户已存在";
                    Response.ContentType = "text/json";
                    Response.Write(new JavaScriptSerializer().Serialize(result));
                    Response.End();
                    return;
                }
                else
                {
                    newChannelNews.AddTime       = DateTime.Now;
                    newChannelNews.AddID         = AdminMethod.AdminID;
                    newChannelNews.LastLoginTime = DateTime.Now;
                    _iD = TableOperate <Admin_User> .InsertReturnID(newChannelNews);

                    result.msg = "添加成功,等待返回列表";
                    logbrief   = "管理员:【" + AdminMethod.AdminFullName + "】在" + DateTime.Now.GetDateTimeFormats('f')[0].ToString() + "添加了为【" + title + "】的管理员";
                }
            }


            if (_iD > 0)
            {
                result.isOk = true;
                Lognet.AddLogin(logbrief);

                if ((newChannelNews.Manage != AdminMethod.AdminManages) && AdminMethod.AdminID == newChannelNews.ID)
                {
                    AdminMethod.UpdataManage(newChannelNews.Manage);
                }
            }
            else
            {
                result.msg = "操作失败";
            }

            Response.ContentType = "text/json";
            Response.Write(new JavaScriptSerializer().Serialize(result));
            Response.End();
        }
        DataBind();
    }
Esempio n. 4
0
    protected void Page_Load(object sender, EventArgs e)
    {
//        [{
//	"text": "父节点 1",
//	"nodes": [{
//		"text": "子节点 1",
//		"nodes": [{
//			"text": "孙子节点 1"

//        }, {
//			"text": "孙子节点 2"
//		}]
//	}, {
//		"text": "子节点 2"
//	}]
//}, {
//	"text": "父节点 2"
//}, {
//	"text": "父节点 3"
//}, {
//	"text": "父节点 4"
//}, {
//	"text": "父节点 5"
//}]
        channelList = ExhibitionProvider.SelectAll();
        string arrstr = "";

        for (int i = 0; i < channelList.Count; i++)
        {
            arrstr += channelList[i].ID + ",";
        }
        string[] arry     = arrstr.TrimEnd(',').Split(',');
        string   TreeJson = "[";
        string   JsonData = "";

        for (int i = 0; i < channelList.Count; i++)
        {
            if (channelList[i].Depth == 0)
            {
                JsonData += "{";
                JsonData += "\"text\":\"" + channelList[i].Name + "\"";
                JsonData += ",\"id\":\"" + channelList[i].ID + "\"";
                JsonData += ",\"itemid\":\"" + i + "\"";
                if (channelList[i].Child)
                {
                    JsonData += GetChild(channelList[i].ID);
                }
                JsonData += "},";
            }
            else
            {
                if (!((IList)arry).Contains(channelList[i].ParentID + ""))
                {
                    JsonData += "{";
                    JsonData += "\"text\":\"" + channelList[i].Name + "\"";
                    JsonData += ",\"id\":\"" + channelList[i].ID + "\"";
                    JsonData += "},";
                }
            }
        }
        JsonData  = JsonData.TrimEnd(',');
        TreeJson += JsonData + "]";
        Response.Write(TreeJson);
    }