Пример #1
0
 protected void DeleteFile(List <News> list)
 {
     for (int i = 0; i < list.Count; i++)
     {
         CloudSQL.DeleteOldFile(list[i]);
     }
 }
Пример #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);
            }
        }
    }
Пример #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);
    }
Пример #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);
            }
        }
    }
Пример #5
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();
    }
Пример #6
0
    protected void Page_Load(object sender, EventArgs e)
    {
        int count = CloudSQL.GetMsg().Count;

        if (count > 0)
        {
            MsgCount = count + "";
        }
        View_PCList condition = new View_PCList();
        View_PCList value     = new View_PCList();

        condition.ExhibitionID = AdminMethod.ExhibitionID;
        m_tableManageList      = TableOperate <View_PCList> .Select(value, condition);

        DataBind();
    }
Пример #7
0
    protected void Page_Load(object sender, EventArgs e)
    {
        Result result           = new Result();
        JavaScriptSerializer js = new JavaScriptSerializer();

        try
        {
            int    ID        = GetIntKey("id");
            Device condition = new Device();
            condition.ID = ID;
            Device light = TableOperate <Device> .GetRowData(condition);

            if (light.ID > 0)
            {
                Device newlight = new Device();

                newlight = light;
                // newlight.NoID();2020/08/17
                newlight.Name         = light.Name + "-复制";
                newlight.AddTime      = DateTime.Now;
                newlight.AddID        = AdminMethod.AdminID;
                newlight.ExhibitionID = AdminMethod.ExhibitionID;
                newlight.OrderID      = CloudSQL.GetNowTime();
                int Sid = TableOperate <Device> .InsertReturnID(newlight);

                if (Sid > 0)
                {
                    result.isOk = true;
                }
            }
        }
        catch (Exception ex)
        {
            result.isOk = false;
            result.msg  = ex.ToString();
        }

        Response.ContentType = "text/json";
        Response.Write(js.Serialize(result));
        Response.End();
    }
Пример #8
0
    /// <summary>
    /// 分享到资源池
    /// </summary>
    /// <param name="news"></param>
    /// <returns></returns>
    protected int Insert(News news)
    {
        if (news.IsShare == 1)
        {
            return(0);
        }
        //public void NoID()
        //{
        //    iD_initialized = false;
        //}
        News newNews = new News();

        newNews = news;
        newNews.NoID();
        newNews.ShareTime = DateTime.Now;
        newNews.TypeID    = 1;
        newNews.AddID     = AdminMethod.AdminID;
        newNews.OldID     = news.ID;
        newNews.OrderID   = CloudSQL.GetNowTime();
        int _ID = TableOperate <News> .InsertReturnID(newNews);

        return(_ID);
    }
Пример #9
0
    protected void Page_Load(object sender, EventArgs e)
    {
        string action = GetstringKey("action");

        bool isUp = false;


        string ID = Request["ID"];

        View_News condition = new View_News();
        View_News v         = new View_News();

        if (string.IsNullOrEmpty(ID))
        {
            Response.Write("");
            return;
        }

        condition.ID = Convert.ToInt32(ID);
        View_News myView = TableOperate <View_News> .GetRowData(v, condition);

        if (myView.ID == 0)
        {
            Response.Write("");
            return;
        }

        View_News condition2 = new View_News();
        View_News V2         = new View_News();

        condition2.AddConditon(" and ID<>'" + condition.ID + "'");
        condition2.PcID = myView.PcID;
        string strOrder = string.Empty;

        condition2.OrderID = myView.OrderID;
        if (action == "up")
        {
            //向上,现在是时间越早越在上面
            condition2.AddAttach("OrderID", "<");
            strOrder = " order by OrderID  DESC"; //时间从大到小
        }
        else
        {
            condition2.AddAttach("OrderID", ">");
            strOrder = " order by OrderID ASC";
        }


        List <View_News> desOrderMdl = TableOperate <View_News> .Select(V2, condition2, 1, strOrder);

        if (desOrderMdl.Count != 1)
        {
            Response.Write("");
            return;
        }


        News conditionU = new News();

        conditionU.ID      = myView.ID;
        conditionU.OrderID = desOrderMdl[0].OrderID;
        TableOperate <News> .Update(conditionU);

        News conditionU2 = new News();

        conditionU2.ID      = desOrderMdl[0].ID;
        conditionU2.OrderID = myView.OrderID;
        TableOperate <News> .Update(conditionU2);

        CloudSQL.UpdataVesion(myView.PcID);
        Response.StatusCode = 200;
        Response.Write(conditionU2.ID);
    }
Пример #10
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"]);
                Light condition = new Light();
                condition.ID = _iD;
                news         = TableOperate <Light> .GetRowData(condition);

                iD.Value    = Convert.ToString(news.ID);
                State.Value = Convert.ToString(news.State); //
            }
            DataBind();
        }
        else
        {
            Result result         = new Result();
            string logbrief       = "";
            Light  newChannelNews = new Light();
            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 <Light> .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 <Light> .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();
    }
Пример #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();
    }