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

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

                iD.Value = Convert.ToString(news.ID);
            }
            states.Value = news.States + "";
            DataBind();
        }
        else
        {
            Result  result         = new Result();
            string  logbrief       = "";
            IPWhite newChannelNews = new IPWhite();
            newChannelNews.ID = 0;
            newChannelNews.AutoForm(this.Page);
            string title = newChannelNews.IP;
            int    _iD;
            if (!string.IsNullOrEmpty(this.Request["iD"]))
            {
                _iD = Convert.ToInt32(this.Request["iD"]);
                TableOperate <IPWhite> .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 <IPWhite> .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();
    }
Esempio n. 2
0
    protected void AddLog(string ids)
    {
        News condition = new News();
        News value     = new News();

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

        if (list.Count > 0)
        {
            string deltitle = "";
            for (int i = 0; i < list.Count; i++)
            {
                CloudSQL.DeleteOldFile(list[i]);
                Update(list[i].OldID);
                deltitle += list[i].Title + ",";
            }
            deltitle = deltitle.TrimEnd(',');
            if (deltitle != "")
            {
                string logbrief = "管理员:【" + AdminMethod.AdminFullName + "】在" + DateTime.Now.GetDateTimeFormats('f')[0].ToString() + "删除了【" + deltitle + "】的云资源";
                Lognet.AddLogin(logbrief);
                Lognet.AddMailBox(logbrief);
            }
        }
    }
Esempio n. 3
0
    protected bool AddLog(string ids)
    {
        bool IsDelete  = true;
        Face condition = new Face();
        Face value     = new Face();

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

        if (list.Count > 0)
        {
            string deltitle = "";
            for (int i = 0; i < list.Count; i++)
            {
                deltitle += list[i].UserinfoID + ",";
                CloudSQL.DeleteFace(list[i].HeadImage);
                IsDelete = IsDelete && Delete(list[i].ID);
            }
            deltitle = deltitle.TrimEnd(',');
            if (deltitle != "")
            {
                string logbrief = "管理员:【" + AdminMethod.AdminFullName + "】在" + DateTime.Now.GetDateTimeFormats('f')[0].ToString() + "删除了【" + deltitle + "】的用户头像";
                Lognet.AddLogin(logbrief);
            }
        }
        return(IsDelete);
    }
Esempio n. 4
0
    protected void AddLog(string ids)
    {
        Userinfo condition = new Userinfo();
        Userinfo value     = new Userinfo();

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

        if (list.Count > 0)
        {
            string deltitle = "";
            for (int i = 0; i < list.Count; i++)
            {
                CloudSQL.DeleteFace(list[i].HeadImage);
                DeleteFace(list[i].ID);
                deltitle += list[i].Name + ",";
            }
            deltitle = deltitle.TrimEnd(',');
            if (deltitle != "")
            {
                string logbrief = "管理员:【" + AdminMethod.AdminFullName + "】在" + DateTime.Now.GetDateTimeFormats('f')[0].ToString() + "删除了【" + deltitle + "】的用户";
                Lognet.AddLogin(logbrief);
            }
        }
    }
Esempio n. 5
0
    protected void Page_Load(object sender, EventArgs e)
    {
        m_ExhibitionList = TagProvider.SelectAll();
        string action = GetstringKey("action");

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

                m_nowChild = Convert.ToString(news.Child).ToLower();
                iD.Value   = Convert.ToString(news.ID);
            }
            DataBind();
        }
        else
        {
            Result  result         = new Result();
            string  logbrief       = "";
            TagTree newChannelNews = new TagTree();
            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"]);
                TagProvider.Update(newChannelNews);
                result.msg = "编辑成功,等待返回列表";
                logbrief   = "管理员:【" + AdminMethod.AdminFullName + "】在" + DateTime.Now.GetDateTimeFormats('f')[0].ToString() + "编辑了为【" + Title + "】的资源分类";
            }
            else
            {
                newChannelNews.AddTime = DateTime.Now;
                newChannelNews.AddID   = AdminMethod.AdminID;
                _iD        = TagProvider.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. 6
0
    /// <summary>
    /// 更新最后登录时间
    /// </summary>
    /// <param name="username">用户名</param>
    public static void UpdateLoginDate(int AdminID)
    {
        Admin_User condition = new Admin_User();

        condition.ID            = AdminID;
        condition.LastLoginTime = DateTime.Now;
        TableOperate <Admin_User> .Update(condition);

        string log = "管理员:【" + AdminFullName + "】在" + DateTime.Now.GetDateTimeFormats('f')[0].ToString() + "进行登陆";

        Lognet.AddLogin(log);
    }
Esempio n. 7
0
    protected void Page_Load(object sender, EventArgs e)
    {
        int    ID     = 0;
        string action = GetstringKey("action");

        if (action == "save")
        {
            Result result         = new Result();
            string logbrief       = "";
            News   newChannelNews = new News();
            int    _ModeID        = GetIntKey("ModeID");
            int    _PCID          = GetIntKey("PCID");
            ID = GetIntKey("iD");
            if (_ModeID != 0 && _PCID != 0 && ID != 0)
            {
                newChannelNews = GetShare(ID);
                newChannelNews.NoID();
                newChannelNews.AddTime      = DateTime.Now;
                newChannelNews.AddID        = AdminMethod.AdminID;
                newChannelNews.ExhibitionID = AdminMethod.ExhibitionID;
                newChannelNews.TypeID       = 0;
                newChannelNews.IsShare      = 0;
                newChannelNews.OldID        = 0;
                newChannelNews.ModeID       = _ModeID;
                newChannelNews.PcID         = _PCID;
                newChannelNews.OrderID      = CloudSQL.GetNowTime();
                int Sid = TableOperate <News> .InsertReturnID(newChannelNews);

                if (Sid > 0)
                {
                    CloudSQL.UpdataVesion(_PCID);
                    result.isOk = true;
                    result.msg  = "资源调用成功!";
                    logbrief    = "管理员:【" + AdminMethod.AdminFullName + "】,在" + DateTime.Now.GetDateTimeFormats('f')[0].ToString() + "调用了【" + newChannelNews.Title + "】资源";
                    Lognet.AddLogin(logbrief);
                    AddUsing(Sid);
                }
                else
                {
                    result.msg = "资源调用失败!";
                }
            }
            Response.ContentType = "text/json";
            Response.Write(new JavaScriptSerializer().Serialize(result));
            Response.End();
        }
        else
        {
            ID       = GetIntKey("iD");
            iD.Value = ID + "";
        }
        DataBind();
    }
Esempio n. 8
0
    protected void AddLog(string ids)
    {
        SpeechTitle condition = new SpeechTitle();
        SpeechTitle value     = new SpeechTitle();

        condition.AddConditon(" and id in(" + ids + ")");
        List <SpeechTitle> list = TableOperate <SpeechTitle> .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);
            }
        }
    }
Esempio n. 9
0
    protected void Page_Load(object sender, EventArgs e)
    {
        Projector projectorV = new Projector();
        Projector projectorC = new Projector();

        projectorList = TableOperate <Projector> .Select(projectorV, projectorC);

        TypeID = GetIntKey("tid");
        string action = GetstringKey("action");

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

                iD.Value         = Convert.ToString(news.ID);
                State.Value      = Convert.ToString(news.State);
                deviceType.Value = Convert.ToString(news.DeviceType);
                charType.Value   = Convert.ToString(news.CharType);
                reCharType.Value = Convert.ToString(news.ReCharType);
                protocol.Value   = Convert.ToString(news.Protocol);
            }
            DataBind();
        }
        else
        {
            Result result         = new Result();
            string logbrief       = "";
            Device newChannelNews = new Device();
            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"]);
                TableOperate <Device> .Update(newChannelNews);

                result.msg = "编辑成功,等待返回列表";
                logbrief   = "管理员:【" + AdminMethod.AdminFullName + "】在" + DateTime.Now.GetDateTimeFormats('f')[0].ToString() + "编辑了为【" + Title + "】的设备";
            }
            else
            {
                newChannelNews.AddTime      = DateTime.Now;
                newChannelNews.AddID        = AdminMethod.AdminID;
                newChannelNews.ExhibitionID = AdminMethod.ExhibitionID;
                newChannelNews.OrderID      = CloudSQL.GetNowTime();
                _iD = TableOperate <Device> .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();
    }
Esempio n. 10
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. 11
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();
    }
Esempio n. 12
0
    protected void Page_Load(object sender, EventArgs e)
    {
        string action           = GetstringKey("action");
        int    ID               = GetIntKey("id");
        int    States           = GetIntKey("states");
        Result result           = new Result();
        JavaScriptSerializer js = new JavaScriptSerializer();

        if (action == "share")
        {
            News condition = new News();
            condition.ID = ID;
            News news = TableOperate <News> .GetRowData(condition);

            if (news.ID > 0)
            {
                int id = 0;
                if (States == 1)//分享
                {
                    if (news.IsShare == 1)
                    {
                        result.msg = "该资源已分享过!";
                    }
                    else
                    {
                        id = Insert(news);
                        condition.IsShare = 1;
                        result.isOk       = true;
                        result.msg        = "分享成功";
                        string logbrief = "管理员:【" + AdminMethod.AdminFullName + "】在" + DateTime.Now.GetDateTimeFormats('f')[0].ToString() + "分享了资源【" + news.Title + "】";
                        Lognet.AddLogin(logbrief);
                    }
                }
                else//取消分享
                {
                    if (news.IsShare == 1)
                    {
                        id = DeleteShare(news.ID);
                        condition.IsShare = 0;
                        result.isOk       = true;
                        result.msg        = "取消成功!";
                        string logbrief = "管理员:【" + AdminMethod.AdminFullName + "】在" + DateTime.Now.GetDateTimeFormats('f')[0].ToString() + "取消分享资源【" + news.Title + "】";
                        Lognet.AddLogin(logbrief);
                    }
                    else
                    {
                        result.msg = "该文件还未分享!";
                    }
                }
                if (id > 0)
                {
                    condition.ID = news.ID;
                    TableOperate <News> .Update(condition);
                }
                else
                {
                    result.isOk = false;
                }
            }
        }
        else if (action == "shenhe")
        {
            News condition = new News();
            condition.ID = ID;
            News news = TableOperate <News> .GetRowData(condition);

            if (news.ID > 0)
            {
                if (news.State == States)
                {
                    result.isOk = false;
                    if (States == 1)
                    {
                        result.msg = "该资源已是展示状态!";
                    }
                    else
                    {
                        result.msg = "该资源已是停用状态!";
                    }
                }
                else
                {
                    condition.State = States;
                    condition.ID    = news.ID;
                    int id = TableOperate <News> .Update(condition);

                    if (id > 0)
                    {
                        result.msg  = "操作成功!";
                        result.isOk = true;
                    }
                }
            }
        }
        Response.ContentType = "text/json";
        Response.Write(js.Serialize(result));
        Response.End();
    }