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); } } }
protected int IsIns(string filePath) { string json = "{\"type\":\"select\", \"file\":\"" + filePath + "\",\"id\":0}"; json = json.Replace("\\", "/"); string url = string.Format("http://127.0.0.1:5478/?json={0}", HttpUtility.UrlEncode(json)); string str = HttpHelp.Get(url); JsonData DataList = JsonMapper.ToObject(str); string state = DataList["state"].ToString(); if (state == "true") { int FaceID = (int)DataList["returnid"]; if (FaceID > 0) { Face condition = new Face(); condition.ID = FaceID; Face user = TableOperate <Face> .GetRowData(condition); if (user.UserinfoID > 0) { return(user.UserinfoID); } } } return(0); }
protected void Page_Load(object sender, EventArgs e) { Light v = new Light(); Light condition = new Light(); if (string.IsNullOrEmpty(this.Request["seviceID"])) { return; } int SeviceID = Convert.ToInt32(this.Request["seviceID"]); string sn = RequestString.NoHTML(Convert.ToString(this.Request["sn"])); if (!SysConfig.IsTrueSn(SeviceID, sn)) { string error = "加密不正确"; Response.Write(error); return; } condition.ExhibitionID = SeviceID; condition.State = 1; List <Light> m_lightList = TableOperate <Light> .Select(v, condition, 0, " order by OrderID asc "); string json = "{\"list\":["; for (int i = 0; i < m_lightList.Count; i++) { json += "{\"id\":" + m_lightList[i].ID + ", \"name\":\"" + m_lightList[i].Title + "\", \"AreaID\":" + m_lightList[i].AreaID + ", \"state\":" + m_lightList[i].State + ", \"SwitchIP\":\"" + m_lightList[i].SwitchIP + "\", \"SwitchPort\":" + m_lightList[i].SwitchPort + ", \"SwitchIndex\":" + m_lightList[i].SwitchIndex + ", \"SwitchGroup\":" + m_lightList[i].SwitchGroup + "},"; } json = json.Trim(','); json += "]}"; Response.Write(json); }
public static List <ModeChannel> MySelectByParentID(int ParentID) { List <ModeChannel> channelData = new List <ModeChannel>(); List <int> idList = new List <int>(); //查询数据 ModeChannel value = new ModeChannel(); ModeChannel conditon = new ModeChannel(); if (ParentID > 0) { conditon.Path = "%~" + ParentID + "~%"; conditon.AddAttach("Path", "like"); } List <ModeChannel> oldTypeData = TableOperate <ModeChannel> .Select(value, conditon, 0, " order by ParentID, Depth, OrderID DESC, ID DESC "); for (int i = 0; i < oldTypeData.Count; i++) { ModeChannel typeObj = oldTypeData[i]; if (typeObj.Depth == 0) //深度为0,直接添加 { channelData.Insert(0, typeObj); idList.Insert(0, typeObj.ID); } else { int pArentIndex = idList.IndexOf(typeObj.ParentID); //查找上及目录所在位置! channelData.Insert(pArentIndex + 1, typeObj); idList.Insert(pArentIndex + 1, typeObj.ID); //将数据插入上级目录之后 } } return(channelData); }
/// <summary> /// 添加栏目 /// </summary> public static int Insert(ModeChannel channel) { if (channel.ParentID == 0) { channel.Depth = 0; channel.ParentID = 0; channel.Path = "0~"; channel.NamePath = "所有栏目~"; channel.AddInsert("RootID", "IDENT_CURRENT('ModeChannel')"); } else { ModeChannel condition = new ModeChannel(); condition.ID = channel.ParentID; ModeChannel pArentChannel = TableOperate <ModeChannel> .GetRowData(condition); string path = Convert.ToString(pArentChannel.Path) + channel.ParentID + "~"; string namePath = Convert.ToString(pArentChannel.NamePath) + Convert.ToString(pArentChannel.Name) + "~"; channel.Depth = pArentChannel.Depth + 1; channel.Path = path; channel.RootID = pArentChannel.RootID; channel.NamePath = namePath; } return(TableOperate <ModeChannel> .InsertReturnID(channel)); }
/// <summary> /// 添加栏目 /// </summary> public static int Insert(Exhibition channel) { if (channel.ParentID == 0) { channel.Depth = 0; channel.ParentID = 0; channel.Path = "0~"; channel.NamePath = "所有栏目~"; channel.AddInsert("RootID", "IDENT_CURRENT('Exhibition')"); } else { Exhibition condition = new Exhibition(); condition.ID = channel.ParentID; Exhibition parentChannel = TableOperate <Exhibition> .GetRowData(condition); string path = Convert.ToString(parentChannel.Path) + channel.ParentID + "~"; string namePath = Convert.ToString(parentChannel.NamePath) + Convert.ToString(parentChannel.Name) + "~"; channel.Depth = parentChannel.Depth + 1; channel.Path = path; channel.RootID = parentChannel.RootID; channel.NamePath = namePath; } return(TableOperate <Exhibition> .InsertReturnID(channel)); }
protected void Page_Load(object sender, EventArgs e) { int id = GetIntKey("iD"); if (id > 0) { News condition = new News(); condition.ID = id; News news = TableOperate <News> .GetRowData(condition); if (news.ID > 0 && news.FileType != 2) { Result result = new Result(); string file = news.Files; //文件路径 if (news.FileType == 4) //4是图片下载1是视频 { file = news.Files1; } Down(news.Title, "/UploadFiles/" + file); } else { Result result = new Result(); result.isOk = true; result.msg = "网页不支持下载请点击浏览!"; Response.ContentType = "text/json"; Response.Write(new JavaScriptSerializer().Serialize(result)); Response.End(); } } }
public static int GetZuJIanCount(string name) { Projector condition = new Projector(); string sqlStr = "SELECT Count(OBJECT_ID(N'[" + name + "]'))"; return(Convert.ToInt32(TableOperate <Projector> .GetOneValue(sqlStr, condition))); }
public static List <Exhibition> SelectByParentID(int parentID) { List <Exhibition> channelData = new List <Exhibition>(); List <int> idList = new List <int>(); //查询数据 Exhibition value = new Exhibition(); Exhibition conditon = new Exhibition(); if (parentID > 0) { conditon.Path = "%~" + parentID + "~%"; conditon.AddAttach("Path", "like"); } List <Exhibition> oldTypeData = TableOperate <Exhibition> .Select(value, conditon, 0, " order by ParentID, Depth, ID DESC "); for (int i = 0; i < oldTypeData.Count; i++) { Exhibition typeObj = oldTypeData[i]; if (typeObj.Depth == 0) //深度为0,直接添加 { channelData.Insert(0, typeObj); idList.Insert(0, typeObj.ID); } else { int parentIndex = idList.IndexOf(typeObj.ParentID); //查找上及目录所在位置! channelData.Insert(parentIndex + 1, typeObj); idList.Insert(parentIndex + 1, typeObj.ID); //将数据插入上级目录之后 } } return(channelData); }
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(); }
private void GetParam(HttpContext context) { HttpRequest requset = context.Request; var ID = int.Parse(requset["ID"]); var X = double.Parse(requset["X"]); var Y = double.Parse(requset["Y"]); View_Light view_Light = new View_Light(); View_Light V = new View_Light(); V.ID = ID; view_Light.ID = ID; view_Light.X = X; view_Light.Y = Y; View_Light hot = TableOperate <View_Light> .GetRowData(V);//查询是否存在 if (hot.ID > 0) { int mes = TableOperate <View_Light> .Update(view_Light); if (mes > 0) { Response.Write("\"errcode\":\"0\",\"msg\":\"ok\""); } else { Response.Write("\"errcode\":\"1\",\"msg\":\"false\""); } } }
protected void Page_Load(object sender, EventArgs e) { View_Device condition = new View_Device(); View_Device value = new View_Device(); TypeID = GetIntKey("tid"); AreaID = GetIntKey("AreaID"); if (AreaID != 0) { condition.AreaID = AreaID; } string title = GetstringKey("name"); if (title != "") { condition.Name = "%" + title + "%"; condition.AddAttach("Name", "like"); } condition.ExhibitionID = AdminMethod.ExhibitionID; condition.TypeID = TypeID; m_tableManageList = TableOperate <View_Device> .SelectByPage(value, condition, "order by OrderID asc", PageSize, PageIndex, ref Count); tid.Value = TypeID + ""; name.Value = title; DataBind(); }
public static GlobalConfig GetWebStates() { GlobalConfig config = new GlobalConfig(); config.ID = 1; return(TableOperate <GlobalConfig> .GetRowData(config)); }
protected void Page_Load(object sender, EventArgs e) { Result result = new Result(); JavaScriptSerializer js = new JavaScriptSerializer(); try { if (!string.IsNullOrEmpty(this.Request["all"])) { Del(); string sql = " Delete FaceLog where ID>0 "; int id = TableOperate <FaceLog> .Execute(sql); if (id > 0) { result.isOk = true; } else { result.msg = "删除失败"; } } } catch (Exception ex) { result.isOk = false; result.msg = ex.ToString(); } Response.ContentType = "text/json"; Response.Write(js.Serialize(result)); Response.End(); }
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); }
protected News GetShare(int ID) { News condition = new News(); condition.ID = ID; return(TableOperate <News> .GetRowData(condition)); }
/// <summary> /// 获取所有子类id序列,例如 1,3,4,5,6 /// </summary> /// <param name="id">要查询频道的id</param> /// <returns></returns> public static string GetChildID(int id) { ModeChannel value = new ModeChannel(); value.ID = 0; ModeChannel conditon = new ModeChannel(); conditon.Path = "%~" + id + "~%"; conditon.AddAttach("Path", "like"); if (AdminMethod.ExhibitionID != 0) { conditon.ExhibitionID = AdminMethod.ExhibitionID; } List <ModeChannel> childChannelList = TableOperate <ModeChannel> .Select(value, conditon); string idStr = ""; for (int i = 0; i < childChannelList.Count; i++) { idStr += childChannelList[i].ID + ","; } idStr = idStr.Trim(','); return(idStr); }
public static int GetTableCount(string name) { Projector condition = new Projector(); string sqlStr = "SELECT count(*) FROM sys.objects WHERE object_id = OBJECT_ID(N'" + name + "') AND type in (N'U')"; return(Convert.ToInt32(TableOperate <Projector> .GetOneValue(sqlStr, condition))); }
protected void Page_Load(object sender, EventArgs e) { Result result = new Result(); JavaScriptSerializer js = new JavaScriptSerializer(); try { if (!string.IsNullOrEmpty(this.Request["checkshop"])) { string checkshop = Convert.ToString(this.Request["checkshop"]); checkshop = RequestString.NoHTML(checkshop); string sql = " update Userinfo set State=1 WHERE id in (" + checkshop + ") "; int id = TableOperate <Userinfo> .Execute(sql); if (id > 0) { result.isOk = true; } else { result.msg = "设置失败"; } } } catch (Exception ex) { result.isOk = false; result.msg = ex.ToString(); } Response.ContentType = "text/json"; Response.Write(js.Serialize(result)); Response.End(); }
protected void Page_Load(object sender, EventArgs e) { if (!string.IsNullOrEmpty(Request["ip"])) { string IP = Convert.ToString(Request["ip"]); Pclist condition = new Pclist(); condition.IP = IP; Pclist pc = TableOperate <Pclist> .GetRowData(condition); if (pc.ID > 0) { Update(pc); if (!string.IsNullOrEmpty(Request["v"])) { int version = Convert.ToInt32(Request["v"]); if (pc.Version != version) { Json = "{\"NowVersion\": " + pc.Version + ",\"list\": ["; List <News> list = NewsList(pc.ID); for (int i = 0; i < list.Count; i++) { string File = PicSwitch(list[i].Files, list[i].FileType); Json += "{\"Title\": \"" + list[i].Title + "\",\"Id\": " + list[i].ID + ",\"File\": \"" + File + "\",\"Word\": \"" + list[i].PicWord + "\",\"Json\": " + DellNull(list[i].JsonStr) + ",\"Tag\": \"" + list[i].ModeID + "\",\"Isjz\": " + list[i].Isjz + ",\"FileType\": " + list[i].FileType + ",\"Ispingbao\": " + list[i].IsPingBao + "},"; } Json = Json.Trim(','); Json += "]}"; } } } } Response.Write(Json.Replace(" ", "")); }
protected void Page_Load(object sender, EventArgs e) { if (string.IsNullOrEmpty(this.Request["seviceID"])) { return; } if (string.IsNullOrEmpty(this.Request["sn"])) { return; } int SeviceID = Convert.ToInt32(this.Request["seviceID"]); string sn = RequestString.NoHTML(Convert.ToString(this.Request["sn"])); if (!SysConfig.IsTrueSn(SeviceID, sn)) { string error = "加密不正确"; Response.Write(error); return; } Area v = new Area(); Area condition = new Area(); condition.ExhibitionID = SeviceID; List <Area> m_lightList = TableOperate <Area> .Select(v, condition, 0, " order by OrderID asc "); string json = "{\"list\":["; for (int i = 0; i < m_lightList.Count; i++) { json += "{\"id\":" + m_lightList[i].ID + ", \"name\":\"" + m_lightList[i].AreaName + "\"},"; } json = json.Trim(','); json += "]}"; Response.Write(json); }
public void DeleteFace(int ID) { Face condition = new Face(); condition.UserinfoID = ID; TableOperate <Face> .Delete(condition); }
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(); }
protected void Page_Load(object sender, EventArgs e) { if (string.IsNullOrEmpty(this.Request["seviceID"])) { return; } if (string.IsNullOrEmpty(this.Request["sn"])) { return; } int SeviceID = Convert.ToInt32(this.Request["seviceID"]); string sn = RequestString.NoHTML(Convert.ToString(this.Request["sn"])); if (!SysConfig.IsTrueSn(SeviceID, sn)) { string error = "{\"state\":\"false\", \"msg\":\"加密错误\"}"; Response.Write(error); return; } else { string act = Convert.ToString(Request["act"]); int rootID = 0; if (!string.IsNullOrEmpty(this.Request["rootID"])) { rootID = Convert.ToInt32(Request["rootID"]); } int typeid = 0; if (!string.IsNullOrEmpty(this.Request["typeid"])) { typeid = Convert.ToInt32(Request["typeid"]); } List <QuestionType> Typelist = QusetionProvider.SelectByRootID(rootID); string json = "{\"Typelist\":["; for (int i = 0; i < Typelist.Count; i++) { json += "{\"ID\":" + Typelist[i].ID + ", \"Name\":\"" + Typelist[i].Name + "\", \"ParentID\":\"" + Typelist[i].ParentID + "\", \"Depth\":\"" + Typelist[i].Depth + "\", \"RootID\":\"" + Typelist[i].RootID + "\"},"; } json = json.Trim(','); json += "],"; View_Question condition = new View_Question(); condition.ExhibitionID = SeviceID; if (typeid != 0) { condition.TypeID = typeid; } View_Question value = new View_Question(); List <View_Question> list = TableOperate <View_Question> .Select(value, condition, 0, "order by OrderID asc"); json += "\"list\":["; for (int i = 0; i < list.Count; i++) { json += "{\"ID\":" + list[i].ID + ", \"Title\":\"" + list[i].Title + "\", \"Files\":\"UploadFiles/" + list[i].Files + "\", \"Brief\":\"" + list[i].Brief + "\", \"TypeID\":\"" + list[i].TypeID + "\",\"OptionList\":" + GetOption(list[i]) + "},"; } json = json.Trim(','); json += "]}"; Response.Write(json); } }
protected void Update(int OldID) { News condition = new News(); condition.ID = OldID; condition.IsShare = 0; TableOperate <News> .Update(condition); }
/// <summary> /// 获取管理员最后登录 /// </summary> /// <returns></returns> public static List <Admin_User> GetMyUser() { Admin_User condition = new Admin_User(); Admin_User value = new Admin_User(); condition.ExhibitionID = AdminMethod.ExhibitionID; return(TableOperate <Admin_User> .Select(value, condition, 5, "order by LastLoginTime desc")); }
public static List <ReserveDate> GetRevDate() { ReserveDate condition = new ReserveDate(); ReserveDate value = new ReserveDate(); condition.ExhibitionID = AdminMethod.ExhibitionID; return(TableOperate <ReserveDate> .Select(value, condition, 0, "order by OrderID asc")); }
protected void DeleteNews(string checkshop) { News condition = new News(); condition.AddConditon(" and PcID in(" + checkshop + ")"); condition.TypeID = 0;//0是个人展厅 1 是资源池 TableOperate <News> .Delete(condition); }
protected void Deleteone(int ID) { News condition = new News(); condition.PcID = ID; condition.TypeID = 0;//0是个人展厅 1 是资源池 TableOperate <News> .Delete(condition); }
private void Up(int id) { Userinfo condition = new Userinfo(); condition.ID = id; condition.LastModifyTime = DateTime.Now; TableOperate <Userinfo> .Update(condition); }