示例#1
0
    protected string GetList(int KeyID)
    {
        string     jsonstr   = "[";
        SpeechSend value     = new SpeechSend();
        SpeechSend condition = new SpeechSend();

        condition.SpeechID = KeyID;
        List <SpeechSend> list = TableOperate <SpeechSend> .Select(value, condition, 0, "order by id desc");

        for (int i = 0; i < list.Count; i++)
        {
            jsonstr += "{\"ID\":" + list[i].ID + ", \"IP\":\"" + list[i].IP + "\", \"Port\":\"" + list[i].Port + "\", \"Cmd\":\"" + list[i].SendCode + "\", \"CharType\":\"" + list[i].CharType + "\", \"Protocol\":\"" + list[i].Protocol + "\"},";
        }
        jsonstr  = jsonstr.Trim(',');
        jsonstr += "]";
        return(jsonstr);
    }
示例#2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        SpeechSend condition = new SpeechSend();
        SpeechSend value     = new SpeechSend();
        string     title     = GetstringKey("name");

        SpeechID = GetIntKey("SpeechID");
        if (title != "")
        {
            condition.Title = "%" + title + "%";
            condition.AddAttach("Title", "like");
        }

        condition.SpeechID = SpeechID;

        m_tableManageList = TableOperate <SpeechSend> .SelectByPage(value, condition, "order by  id desc", PageSize, PageIndex, ref Count);

        DataBind();
        name.Value = title;
    }
示例#3
0
    protected void AddLog(string ids)
    {
        SpeechSend condition = new SpeechSend();
        SpeechSend value     = new SpeechSend();

        condition.AddConditon(" and id in(" + ids + ")");
        List <SpeechSend> list = TableOperate <SpeechSend> .Select(value, condition);

        if (list.Count > 0)
        {
            string deltitle = "";
            for (int i = 0; i < list.Count; i++)
            {
                deltitle += list[i].Title + ",";
            }
            deltitle = deltitle.TrimEnd(',');
            if (deltitle != "")
            {
                string logbrief = "管理员:【" + AdminMethod.AdminFullName + "】在" + DateTime.Now.GetDateTimeFormats('f')[0].ToString() + "删除了【" + deltitle + "】的语音指令";
                Lognet.AddLogin(logbrief);
            }
        }
    }
示例#4
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();
    }