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

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

                iD.Value       = Convert.ToString(news.ID);
                CharType.Value = news.CharType + "";
                Protocol.Value = news.Protocol + "";
            }
            DataBind();
        }
        else
        {
            Result     result         = new Result();
            string     logbrief       = "";
            SpeechSend newChannelNews = new SpeechSend();
            newChannelNews.ID = 0;
            newChannelNews.AutoForm(this.Page);
            string Title = newChannelNews.Title;
            int    _iD;
            if (!string.IsNullOrEmpty(this.Request["iD"]))
            {
                _iD = Convert.ToInt32(this.Request["iD"]);
                TableOperate <SpeechSend> .Update(newChannelNews);

                result.msg = "编辑成功,等待返回列表";
                logbrief   = "管理员:【" + AdminMethod.AdminFullName + "】在" + DateTime.Now.GetDateTimeFormats('f')[0].ToString() + "编辑了为【" + Title + "】的语音指令";
            }
            else
            {
                newChannelNews.AddTime = DateTime.Now;
                newChannelNews.AddID   = AdminMethod.AdminID;

                _iD = TableOperate <SpeechSend> .InsertReturnID(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();
    }
Exemplo n.º 2
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 = ChannelProvider.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);
    }
Exemplo n.º 3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        m_ExhibitionList = ChannelProvider.SelectAll();
        string action = GetstringKey("action");

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

                iD.Value    = Convert.ToString(news.ID);
                state.Value = Convert.ToString(news.State);
            }
            DataBind();
        }
        else
        {
            Result result         = new Result();
            string logbrief       = "";
            News   newChannelNews = new News();
            newChannelNews.ID = 0;
            newChannelNews.AutoForm(this.Page);
            newChannelNews.FileType = SysConfig.CheckPlayType(newChannelNews.Files);
            if (newChannelNews.JsonStr == "" || newChannelNews.JsonStr == null)
            {
                newChannelNews.JsonStr = "{\"type\": \"google\",\"data\": \"\"}";
            }
            string oldFiles = GetstringKey("oldFiles");
            if (oldFiles != newChannelNews.Files && newChannelNews.FileType == 4)
            {
                string piczip = CloudSQL.GetPicZip(newChannelNews.Files, news.Files1);
                newChannelNews.Files1 = piczip;
            }
            string Title = newChannelNews.Title;
            int    _iD;
            if (!string.IsNullOrEmpty(this.Request["iD"]))
            {
                _iD = Convert.ToInt32(this.Request["iD"]);
                TableOperate <News> .Update(newChannelNews);

                result.msg = "编辑成功,等待返回列表";
                logbrief   = "管理员:【" + AdminMethod.AdminFullName + "】在" + DateTime.Now.GetDateTimeFormats('f')[0].ToString() + "编辑了为【" + Title + "】的云资源";
            }
            else
            {
                newChannelNews.AddTime      = DateTime.Now;
                newChannelNews.ShareTime    = DateTime.Now;
                newChannelNews.AddID        = AdminMethod.AdminID;
                newChannelNews.ExhibitionID = AdminMethod.ExhibitionID;
                newChannelNews.TypeID       = 1;
                newChannelNews.IsShare      = 0;
                newChannelNews.OldID        = 0;
                newChannelNews.OrderID      = CloudSQL.GetNowTime();
                _iD = TableOperate <News> .InsertReturnID(newChannelNews);

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

            if (_iD > 0)
            {
                result.isOk = true;
                Lognet.AddLogin(logbrief);
                Lognet.AddMailBox(logbrief);
            }
            else
            {
                result.msg = "操作失败";
            }
            Response.ContentType = "text/json";
            Response.Write(new JavaScriptSerializer().Serialize(result));
            Response.End();
        }
        DataBind();
    }