//更新管理员 public bool Updates(SiteGroupCms.Entity.Admin obj) { using (DbOperHandler _doh = new Common().Doh()) { _doh.Reset(); _doh.ConditionExpress = "uid=@id"; _doh.AddConditionParameter("@id", obj.Id); _doh.AddFieldItem("truename", obj.TrueName); _doh.AddFieldItem("deptid", obj.DeptId); _doh.AddFieldItem("sex", obj.Sex); _doh.AddFieldItem("job", obj.Job); _doh.AddFieldItem("email", obj.Email); _doh.AddFieldItem("telphone", obj.Telphone); _doh.AddFieldItem("mobilephone", obj.MobilePhone); _doh.AddFieldItem("imgurl", obj.Imgurl); _doh.AddFieldItem("sort", obj.Sort); int _update = _doh.Update("yy_personinfo"); //更新user表 _doh.Reset(); _doh.ConditionExpress = "id=@id"; _doh.AddConditionParameter("@id", obj.Id); _doh.AddFieldItem("password", obj.Password); _doh.AddFieldItem("roleid", obj.RoleId); _doh.AddFieldItem("siteid", obj.SiteId); _doh.AddFieldItem("catalogid", obj.Catalogid); int _update2 = _doh.Update("yy_userinfo"); return(_update + _update2 == 2); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { Admin_Load("1", "json"); _admin = (SiteGroupCms.Entity.Admin)Session["admin"]; where += "siteid=" + _admin.CurrentSite; } if (Request.Form["sortname"] != null && Request.Form["sortname"] != "state") { sortname = Request.Form["sortname"]; } if (Request.Form["sortorder"] != null && Request.Form["sortorder"] != "") { sortorder = Request.Form["sortorder"]; } if (Request.Form["page"] != null && Request.Form["page"] != "") { currentpage = Validator.StrToInt(Request.Form["page"], 1); } if (Request.Form["pagesize"] != null && Request.Form["pagesize"] != "") { pagesize = Validator.StrToInt(Request.Form["pagesize"], 1); } logdal.GetListJSON(currentpage, pagesize, where, ref _response); Response.Write(_response); }
/// <summary> /// 得到列表JSON数据 /// </summary> /// <param name="_thispage">当前页码</param> /// <param name="_pagesize">每页记录条数</param> /// <param name="_wherestr">搜索条件</param> /// <param name="_jsonstr">返回值</param> public void GetListJSON(int _thispage, int _pagesize, string _wherestr, ref string _jsonstr, string ordercol, string ordertype) { SiteGroupCms.Entity.Admin _admin = new SiteGroupCms.Entity.Admin(); AdminDal _adminobj = new AdminDal(); CatalogDal catadalobj = new CatalogDal(); using (DbOperHandler _doh = new Common().Doh()) { _doh.Reset(); _doh.ConditionExpress = _wherestr; string sqlStr = ""; int _countnum = _doh.Count("yy_templateinfo"); sqlStr = SiteGroupCms.Utils.SqlHelp.GetSql("*", "yy_templateinfo", ordercol, _pagesize, _thispage, ordertype, _wherestr); _doh.Reset(); _doh.SqlCmd = sqlStr; DataTable dt = _doh.GetDataTable(); DataTable dt2 = new DataTable(); DataColumn col = new DataColumn("id", System.Type.GetType("System.String")); DataColumn col2 = new DataColumn("type", System.Type.GetType("System.String")); DataColumn col3 = new DataColumn("title", System.Type.GetType("System.String")); DataColumn col4 = new DataColumn("source", System.Type.GetType("System.String")); DataColumn col5 = new DataColumn("addtime", System.Type.GetType("System.String")); DataColumn col6 = new DataColumn("filename", System.Type.GetType("System.String")); dt2.Columns.Add(col); dt2.Columns.Add(col2); dt2.Columns.Add(col3); dt2.Columns.Add(col4); dt2.Columns.Add(col5); dt2.Columns.Add(col6); for (int i = 0; i < dt.Rows.Count; i++) { DataRow dr = dt2.NewRow(); dr["id"] = dt.Rows[i]["id"]; dr["title"] = dt.Rows[i]["title"]; dr["source"] = dt.Rows[i]["source"]; if (dt.Rows[i]["type"].ToString() == "1") { dr["type"] = "系统首页"; } else if (dt.Rows[i]["type"].ToString() == "2") { dr["type"] = "栏目页"; } else if (dt.Rows[i]["type"].ToString() == "3") { dr["type"] = "内容页"; } else { dr["type"] = "公共页"; } dr["addtime"] = String.Format("{0:g}", SiteGroupCms.Utils.Validator.StrToDate(dt.Rows[i]["addtime"].ToString(), DateTime.Now)); dr["filename"] = dt.Rows[i]["filename"]; dt2.Rows.Add(dr); } _jsonstr = SiteGroupCms.Utils.dtHelp.DT2JSON(dt2, _countnum); dt.Clear(); dt.Dispose(); } }
protected void getpersoninfo() { SiteGroupCms.Dal.AdminDal admindal = new SiteGroupCms.Dal.AdminDal(); SiteGroupCms.Entity.Admin admin = new SiteGroupCms.Entity.Admin(); SiteGroupCms.Dal.RoleDal roledal = new SiteGroupCms.Dal.RoleDal(); if (id == "0") { admin = admindal.GetEntity(_admin.Id.ToString()); } else { admin = admindal.GetEntity(id); } SiteGroupCms.Entity.Role role = roledal.GetEntity(admin.RoleId); if (admin != null) { _response += "{\"IsError\":false,\"Message\":\"加载成功\",\"Data\":{\"userid\":" + admin.Id + ","; _response += "\"username\":" + SiteGroupCms.Utils.fastJSON.JSON.WriteString(admin.UserName) + ",\"truename\":" + SiteGroupCms.Utils.fastJSON.JSON.WriteString(admin.TrueName) + ","; _response += "\"depttitle_val\":\"" + admin.DeptId + "\",\"sextitle_val\":\"" + admin.Sex + "\",\"job\":" + SiteGroupCms.Utils.fastJSON.JSON.WriteString(admin.Job) + ","; _response += "\"email\":" + SiteGroupCms.Utils.fastJSON.JSON.WriteString(admin.Email) + ",\"telphone\":\"" + admin.Telphone + "\",\"mobilephone\":\"" + admin.MobilePhone + "\","; _response += "\"sitetitle_val\":\"" + admin.SiteId + "\",\"roletitle_val\":\"" + admin.RoleId + "\",\"rights\":\"" + role.Righttitle + "\","; _response += "\"sort\":" + admin.Sort + ",\"imglist\":\"" + admin.Imgurl + "\",\"imgtitlelist\":\"" + admin.Imgurl + "\""; _response += "}}"; } Response.Write(_response); }
private void getsiteinfo() { SiteGroupCms.Dal.AdminDal admindal = new SiteGroupCms.Dal.AdminDal(); SiteGroupCms.Entity.Admin admin = new SiteGroupCms.Entity.Admin(); SiteGroupCms.Dal.RoleDal roledal = new SiteGroupCms.Dal.RoleDal(); SiteGroupCms.Entity.Site site = new SiteGroupCms.Entity.Site(); SiteGroupCms.Dal.SiteDal sitedal = new SiteGroupCms.Dal.SiteDal(); if (id == "0")//站点id { site = (SiteGroupCms.Entity.Site)Session["site"]; } else { site = sitedal.GetEntity(Str2Int(id)); } SiteGroupCms.Entity.Role role = roledal.GetEntity(admin.RoleId); if (site != null) { _response += "{\"IsError\":false,\"Message\":\"加载成功\",\"Data\":{\"siteid\":" + site.ID + ","; _response += "\"title\":" + SiteGroupCms.Utils.fastJSON.JSON.WriteString(site.Title) + ",\"webtitle\":" + SiteGroupCms.Utils.fastJSON.JSON.WriteString(site.WebTitle) + ",\"iswork_val\":\"" + site.IsWork + "\","; _response += "\"location\":\"" + site.Location + "\",\"domain\":" + SiteGroupCms.Utils.fastJSON.JSON.WriteString(site.Domain) + ",\"keywords\":" + SiteGroupCms.Utils.fastJSON.JSON.WriteString(site.Keyword) + ","; _response += "\"description\":" + SiteGroupCms.Utils.fastJSON.JSON.WriteString(site.Description) + ",\"ftpserver\":\"" + site.FtpServer + "\",\"ftpport\":\"" + site.FtpPort + "\","; _response += "\"ftpuser\":\"" + site.FtpUser + "\",\"ftppwd\":" + SiteGroupCms.Utils.fastJSON.JSON.WriteString(site.FtpPwd) + ",\"ftpdir\":\"" + site.FtpDir + "\","; _response += "\"indextemplate_val\":\"" + site.Indextemplate + "\",\"listtemplate_val\":\"" + site.Listtemplate + "\",\"contenttemplate_val\":\"" + site.Contenttemplate + "\","; _response += "\"emailserver\":\"" + site.EmailServer + "\",\"emailuser\":\"" + site.EmailUser + "\",\"emailpwd\":" + SiteGroupCms.Utils.fastJSON.JSON.WriteString(site.EmailPwd); _response += "}}"; } Response.Write(_response); }
private void loadmenu() { //登录后取权限判断 SiteGroupCms.Entity.Admin admin = (SiteGroupCms.Entity.Admin)Session["admin"]; if (admin.Rights.Contains("3,")) { q3.Visible = true; } if (admin.Rights.Contains("4,")) { q4.Visible = true; } if (admin.Rights.Contains("6,")) { q6.Visible = true; } if (admin.Rights.Contains("7,")) { q7.Visible = true; q71.Visible = true; } if (admin.Rights.Contains("8,")) { q8.Visible = true; } if (admin.Rights.Contains("9,")) { q9.Visible = true; changesites.Visible = true; } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { Admin_Load("1", "json"); _admin = ((SiteGroupCms.Entity.Admin)Session["admin"]); } method = Request.QueryString["method"]; description = Request.Form["description"]; dirname = Request.Form["dirname"]; contenttemplate = Request.Form["contenttemplate_val"]; listtemplate = Request.Form["listtemplate_val"]; catalogid = Request.Form["fathercatalog_val"]; isshare = Request.Form["isshare"]; keywords = Request.Form["keywords"]; title = Request.Form["title"]; id = Request.QueryString["id"]; switch (method) { case "add": addcatalog(); break; case "update": updatecatalog(); break; case "delete": deletecatalog(); break; } Response.Write(_response); }
public string getcataloglist(string siteid) { string str = "{\"catalog\":["; SiteGroupCms.Entity.Catalog catalog = new SiteGroupCms.Entity.Catalog(); using (DbOperHandler _doh = new Common().Doh()) { _doh.Reset(); _doh.SqlCmd = "SELECT * FROM [yy_cataloginfo] WHERE [siteid]=" + siteid; DataTable dt = _doh.GetDataTable(); if (dt.Rows.Count > 0) { for (int i = 0; i < dt.Rows.Count; i++) { SiteGroupCms.Entity.Admin _admin = ((SiteGroupCms.Entity.Admin)HttpContext.Current.Session["admin"]); if (_admin.Catalogid == "" || _admin.Catalogid.IndexOf(dt.Rows[i]["id"].ToString() + ",") >= 0)//超级管理或者包含该栏目则显示 { str += "{\"id\":\"" + dt.Rows[i]["id"].ToString() + "\",\"title\":\"" + dt.Rows[i]["title"].ToString() + "\"},"; } } } } return(str.Remove(str.Length - 1, 1) + "]}"); }
/// <summary> ///转换当前站点 /// </summary> private void changesite() { SiteGroupCms.Entity.Admin _admin = (SiteGroupCms.Entity.Admin)Session["admin"]; _admin.CurrentSite = Convert.ToInt32(_siteid); Session["admin"] = _admin; this._response = JsonResult(1, "切换成功"); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { Admin_Load("1", "json"); _admin = (SiteGroupCms.Entity.Admin)HttpContext.Current.Session["admin"]; site = (SiteGroupCms.Entity.Site)HttpContext.Current.Session["site"]; } method = Request.QueryString["method"]; title = Request.Form["title"]; temcontent = Request.Form["temcontent"]; type = Request.Form["type_val"]; filename = Request.Form["filename"]; source = Request.Form["source"]; id = Request.Form["id"]; switch (method) { case "add": addtemplate(); break; case "update": updatetemplate(); break; case "delete": deletetemplate(); break; } Response.Write(_response); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { Admin_Load("1", "json"); _admin = (SiteGroupCms.Entity.Admin)HttpContext.Current.Session["admin"]; } Response.Write(catalogdal.getcataloglist(_admin.CurrentSite.ToString())); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { Admin_Load("", "html"); _admin = (SiteGroupCms.Entity.Admin)HttpContext.Current.Session["admin"]; loadmenu(); loadsite(); } }
private void loadmenu() { //登录后取权限判断 SiteGroupCms.Entity.Admin admin = (SiteGroupCms.Entity.Admin)Session["admin"]; if (admin.Rights.Contains("2")) { q2.Visible = true; } if (admin.Rights.Contains("3,")) { q3.Visible = true; } if (admin.Rights.Contains("4,")) { q4.Visible = true; } if (admin.Rights.Contains("6,")) { q6.Visible = true; } if (admin.Rights.Contains("7,")) { q7.Visible = true; q71.Visible = true; } if (admin.Rights.Contains("8,")) //站务管理权限 { q8.Visible = true; //对文件管理进行初始化 /****************************************************************************************************************/ long spaceCapacity = 1000000000; //用户存储空间大小; SiteGroupCms.Utils.DirFile.CreateDir("/sites/" + site.Location + "/templates/atts"); string userSpaceHomeDir = System.Web.HttpContext.Current.Server.MapPath("/sites/" + site.Location + "/templates/atts"); //用户存储空间主目录 //声明以下几个变量; long spaceUsed = 0; //已使用的空间大小; int fsObjCount = 0; //用户空间内的文件和文件夹总数; int fileCount = 0; //用户空间内的文件总数; //计算出已使用的空间大小; spaceUsed = FSManager.Components.API.GetSpaceUsed(userSpaceHomeDir, ref fsObjCount, ref fileCount); //将数据保存到cookie中,以便文件管理模块的各个页面使用; FSManager.Components.API.Prepare(admin.UserName, userSpaceHomeDir, spaceCapacity, spaceUsed, fsObjCount, fileCount); /****************************************************************************************************************/ } if (admin.Rights.Contains("9,")) { q9.Visible = true; } if (admin.Rights.Contains("10,")) { q10.Visible = true; } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { Admin_Load("", "html"); _admin = (SiteGroupCms.Entity.Admin)HttpContext.Current.Session["admin"]; site = (SiteGroupCms.Entity.Site)HttpContext.Current.Session["site"]; loadmenu(); //loadsite(); weburl = "/sites/" + site.Location + "/pub/index.html"; } }
//发布消息 public int addmessage(string title, string content) { //向这个站点的所有用户发一条消息 SiteGroupCms.Entity.Admin _admin = (SiteGroupCms.Entity.Admin)System.Web.HttpContext.Current.Session["admin"]; DataTable dt = new SiteGroupCms.Dal.AdminDal().GetDT("1=1"); for (int i = 0; i < dt.Rows.Count; i++) { addonemessage(_admin.Id.ToString(), dt.Rows[i]["id"].ToString(), title, content); } return(dt.Rows.Count); }
public void SaveLog(int _type) { SiteGroupCms.Entity.Admin currentadmin = (SiteGroupCms.Entity.Admin)HttpContext.Current.Session["admin"]; using (DbOperHandler _doh = new Common().Doh()) { _doh.Reset(); _doh.AddFieldItem("douserid", currentadmin.Id); _doh.AddFieldItem("dotype", _type); _doh.AddFieldItem("doip", IPHelp.ClientIP); _doh.AddFieldItem("siteid", currentadmin.CurrentSite); _doh.Insert("yy_loginfo"); } }
public bool addfavorite(string favoriteid) { using (DbOperHandler _doh = new Common().Doh()) { SiteGroupCms.Entity.Admin _admin = (SiteGroupCms.Entity.Admin)HttpContext.Current.Session["admin"]; _doh.Reset(); _doh.AddFieldItem("favoriteid", favoriteid); _doh.AddFieldItem("userid", _admin.Id); int _insert = _doh.Insert("yy_favoritelistinfo"); return(_insert >= 1); } }
protected void Page_Load(object sender, EventArgs e) { view = Request.QueryString["view"]; idfield = Request.QueryString["idfield"]; textfield = Request.QueryString["textfield"]; type = Request.QueryString["type"]; if (!IsPostBack) { Admin_Load("", "json"); _admin = ((SiteGroupCms.Entity.Admin)Session["admin"]); } loadlist(); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { Admin_Load("", "json"); _admin = (SiteGroupCms.Entity.Admin)Session["admin"]; span0.InnerHtml = articledal.getcount("isdel!=1 and siteid=" + _admin.CurrentSite); Span1.InnerHtml = articledal.getcount("isdel!=1 and siteid=" + _admin.CurrentSite + " and ispassed!=1"); Span2.InnerHtml = articledal.getcount("isdel!=1 and siteid=" + _admin.CurrentSite + " and ispublish!=1"); Span3.InnerHtml = articledal.getcount("isdel=1 and siteid=" + _admin.CurrentSite); Span4.InnerHtml = articledal.getcount("isdel!=1 and siteid=" + _admin.CurrentSite + " and isshare=1"); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { Admin_Load("1", "json"); _admin = (SiteGroupCms.Entity.Admin)Session["admin"]; } if (Request.QueryString["type"] != null && Request.QueryString["type"] != "") { type = Request.QueryString["type"]; } if (Request.QueryString["id"] != null && Request.QueryString["id"] != "") { nid = Request.QueryString["id"]; } if (Request.Form["sortname"] != null && Request.Form["sortname"] != "state") { sortname = Request.Form["sortname"]; } if (Request.Form["sortorder"] != null && Request.Form["sortorder"] != "") { sortorder = Request.Form["sortorder"]; } if (Request.Form["page"] != null && Request.Form["page"] != "") { currentpage = Validator.StrToInt(Request.Form["page"], 1); } if (Request.Form["pagesize"] != null && Request.Form["pagesize"] != "") { pagesize = Validator.StrToInt(Request.Form["pagesize"], 1); } where = Request.Form["where"]; switch (type) { case "list": Messagedal.GetListJSON(currentpage, pagesize, "userid=" + _admin.Id, ref _response, sortname, sortorder); Response.Write(_response); break; case "detail": Message = Messagedal.GetEntity(nid); Messagedal.updateread(nid, 1); _response += "{"; _response += "\"Total\":1"; _response += ",\"Rows\":[{"; _response += "\"content\":\"" + Message.Content; _response += "\"}]}"; Response.Write(_response); break; } }
private SiteGroupCms.Entity.Catalogtree getTree(string _siteid, string _classid, bool _includechild) { SiteGroupCms.Entity.Catalogtree _tree = new SiteGroupCms.Entity.Catalogtree(); SiteGroupCms.Entity.Site _site = new SiteGroupCms.Dal.SiteDal().GetEntity(Str2Int(_siteid)); if (_site == null) { return(null); } if (_classid == "0")//表示从根节点开始 { _tree.Id = _site.ID.ToString(); _tree.Name = _site.Title; } else { SiteGroupCms.Entity.Catalog _catalog = new SiteGroupCms.Dal.CatalogDal().GetEntity(_classid); SiteGroupCms.Entity.Admin _admin = (SiteGroupCms.Entity.Admin)HttpContext.Current.Session["admin"]; if (_admin.Catalogid.Trim() == "" || ((_admin.Catalogid.IndexOf(_catalog.ID + ",") >= 0) && (_catalog.Father == 0)) || _catalog.Father != 0) //超级管理或者包含该栏目则显示 { _tree.Id = _catalog.ID.ToString(); _tree.Name = _catalog.Title; } } _tree.HasChild = HasChild(_classid); List <SiteGroupCms.Entity.Catalogtree> subtree = new List <SiteGroupCms.Entity.Catalogtree>(); if (_includechild) { using (DbOperHandler _doh = new Common().Doh()) { _doh.Reset(); _doh.SqlCmd = "SELECT id FROM [yy_cataloginfo] WHERE [siteid]=" + _siteid + " AND [fatherid]=" + _classid + " order by sort desc"; DataTable dtClass = _doh.GetDataTable(); for (int i = 0; i < dtClass.Rows.Count; i++) { string _subclassid = dtClass.Rows[i]["Id"].ToString(); SiteGroupCms.Entity.Admin _admin = (SiteGroupCms.Entity.Admin)HttpContext.Current.Session["admin"]; if (_admin.Catalogid == "" || _admin.Catalogid.IndexOf(_subclassid + ",") >= 0 || _classid != "0")//超级管理或者包含该栏目则显示 { subtree.Add(getTree(_siteid, _subclassid, _includechild)); } } dtClass.Clear(); dtClass.Dispose(); } } _tree.SubChild = subtree; return(_tree); }
public bool addfavorite(SiteGroupCms.Entity.Favorite obj) { using (DbOperHandler _doh = new Common().Doh()) { SiteGroupCms.Entity.Admin _admin = (SiteGroupCms.Entity.Admin)HttpContext.Current.Session["admin"]; _doh.Reset(); _doh.AddFieldItem("title", obj.Title); _doh.AddFieldItem("content", obj.Content); _doh.AddFieldItem("url", obj.Content); _doh.AddFieldItem("content", obj.Content); _doh.AddFieldItem("description", obj.Content); int _insert = _doh.Insert("yy_roleinfo"); return(_insert >= 1); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { Admin_Load("1", "json"); _admin = ((SiteGroupCms.Entity.Admin)Session["admin"]); } method = Request.QueryString["methods"]; id = Request.QueryString["id"] == "" ? Request.Form["userid"] : Request.QueryString["id"]; ids = Request.Form["ids"]; password = Request.Form["password"]; truename = Request.Form["truename"]; deptid = Request.Form["depttitle_val"]; sex = Request.Form["sextitle_val"]; job = Request.Form["job"]; email = Request.Form["email"]; telphone = Request.Form["telphone"]; username = Request.Form["username"]; mobilephone = Request.Form["mobilephone"]; method = Request.QueryString["method"]; siteid = Request.Form["sitetitle_val"]; roleid = Request.Form["roletitle_val"]; imglist = Request.Form["imglist"]; sort = Str2Int(Request.Form["sort"]); switch (method) { case "add": adduser(); break; case "update": updateuser(); break; case "delete": deleteuser(); break; case "lock": lockuser(); break; case "unlock": unlockuser(); break; } Response.Write(_response); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { Admin_Load("", "json"); _admin = ((SiteGroupCms.Entity.Admin)Session["admin"]); if (_admin.Rights.Contains("7,"))//如果包含用户管理权则出现栏目权限信息 { loadcatalog(); } else { catalogs = ""; } } }
public int AddAdmin(SiteGroupCms.Entity.Admin obj) { // 先检查是否存在同样的username 相同的登录名 先添加到user表 在添加到person表 using (DbOperHandler _doh = new Common().Doh()) { _doh.Reset(); _doh.SqlCmd = "select * from yy_userinfo where username='******'"; if (_doh.GetDataTable().Rows.Count > 0) { return(-1);//已经存在该用户名了 } _doh.Reset(); _doh.AddFieldItem("username", obj.UserName); _doh.AddFieldItem("password", obj.Password); _doh.AddFieldItem("roleid", obj.RoleId); _doh.AddFieldItem("siteid", obj.SiteId); _doh.AddFieldItem("catalogid", obj.Catalogid); int _insert = _doh.Insert("yy_userinfo"); if (_insert > 0)//前面插入成功 { _doh.Reset(); _doh.AddFieldItem("uid", _insert); _doh.AddFieldItem("truename", obj.TrueName); _doh.AddFieldItem("deptid", obj.DeptId); _doh.AddFieldItem("sex", obj.Sex); _doh.AddFieldItem("job", obj.Job); _doh.AddFieldItem("email", obj.Email); _doh.AddFieldItem("telphone", obj.Telphone); _doh.AddFieldItem("mobilephone", obj.MobilePhone); _doh.AddFieldItem("imgurl", obj.Imgurl); if (_doh.Insert("yy_personinfo") > 0) { return(_insert); } else //常态下不让直行,可回滚操作 否则会导致user表和person表不一致 { return(0); } } else { return(0); } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { Admin_Load("1", "json"); _admin = ((SiteGroupCms.Entity.Admin)Session["admin"]); } method = Request.QueryString["method"]; id = Request.QueryString["id"] == "" ? Request.Form["userid"] : Request.QueryString["id"]; title = Request.Form["title"]; webtitle = Request.Form["webtitle"]; location = Request.Form["location"]; domain = Request.Form["domain"]; iswork = Request.Form["iswork_val"]; keywords = Request.Form["keywords"]; description = Request.Form["description"]; indextemplate = Request.Form["indextemplate_val"]; listtemplate = Request.Form["listtemplate_val"]; contenttemplate = Request.Form["contenttemplate_val"]; ftpserver = Request.Form["ftpserver"]; ftpuser = Request.Form["ftpuser"]; ftppwd = Request.Form["ftppwd"]; ftpport = Request.Form["ftpport"]; ftpdir = Request.Form["ftpdir"]; mailserver = Request.Form["emailserver"]; mailuser = Request.Form["emailuser"]; mailpwd = Request.Form["emailpwd"]; switch (method) { case "add": addsite(); break; case "update": updatesite(); break; case "delete": deletesite(); break; } Response.Write(_response); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { Admin_Load("1", "json"); _admin = ((SiteGroupCms.Entity.Admin)Session["admin"]); } id = Request.QueryString["id"] == "" ? Request.Form["userid"] : Request.QueryString["id"]; ids = Request.Form["ids"]; method = Request.QueryString["method"]; title = Request.Form["title"]; content = Request.Form["content"]; switch (method) { case "add": addmessage(); break; } Response.Write(_response); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { Admin_Load("1", "json"); _admin = ((SiteGroupCms.Entity.Admin)Session["admin"]); } method = Request.QueryString["method"]; addtime = Request.Form["addtime"]; artid = Request.Form["artid"]; attslist = Request.Form["attslist"]; attstitlelist = Request.Form["attstitlelist"]; catalogid = Request.Form["catalogid"]; color = Request.Form["color"]; content = Request.Form["content1"]; abstraction = Request.Form["abstract"]; imglist = Request.Form["imglist"]; imgtitlelist = Request.Form["imgtitlelist"]; isppt = Request.Form["isppt"]; isrecommend = Request.Form["isrecommend"]; isroll = Request.Form["isroll"]; isshare = Request.Form["isshare"]; keywords = Request.Form["keywords"]; linkurl = Request.Form["linkurl"]; source = Request.Form["source"]; subtitle = Request.Form["subtitle"]; title = Request.Form["title"]; clickcount = Str2Int(Request.Form["clickcount"]); switch (method) { case "add": addarticle(); break; case "update": updatearicle(); break; } Response.Write(_response); }
/// <summary> /// 得到列表JSON数据 /// </summary> /// <param name="_thispage">当前页码</param> /// <param name="_pagesize">每页记录条数</param> /// <param name="_wherestr">搜索条件</param> /// <param name="_jsonstr">返回值</param> public void GetListJSON(int _thispage, int _pagesize, string _wherestr, ref string _jsonstr, string ordercol, string ordertype) { SiteGroupCms.Entity.Admin _admin = new SiteGroupCms.Entity.Admin(); AdminDal _adminobj = new AdminDal(); using (DbOperHandler _doh = new Common().Doh()) { _doh.Reset(); _doh.ConditionExpress = _wherestr; string sqlStr = ""; int _countnum = _doh.Count("yy_deptinfo"); sqlStr = SiteGroupCms.Utils.SqlHelp.GetSql("*", "yy_deptinfo", ordercol, _pagesize, _thispage, ordertype, _wherestr); _doh.Reset(); _doh.SqlCmd = sqlStr; DataTable dt = _doh.GetDataTable(); DataTable dt2 = new DataTable(); DataColumn col = new DataColumn("id", System.Type.GetType("System.String")); DataColumn col2 = new DataColumn("name", System.Type.GetType("System.String")); DataColumn col3 = new DataColumn("TotalNum", System.Type.GetType("System.String")); DataColumn col4 = new DataColumn("description", System.Type.GetType("System.String")); dt2.Columns.Add(col); dt2.Columns.Add(col2); dt2.Columns.Add(col3); dt2.Columns.Add(col4); SiteGroupCms.Dal.AdminDal Admindal = new SiteGroupCms.Dal.AdminDal(); for (int i = 0; i < dt.Rows.Count; i++) { DataRow dr = dt2.NewRow(); dr["id"] = dt.Rows[i]["id"]; dr["name"] = dt.Rows[i]["dept"]; dr["description"] = dt.Rows[i]["description"]; dr["TotalNum"] = Admindal.GetDeptNum(dt.Rows[i]["id"].ToString()).ToString(); dt2.Rows.Add(dr); } _jsonstr = SiteGroupCms.Utils.dtHelp.DT2JSON(dt2, _countnum); dt.Clear(); dt.Dispose(); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { Admin_Load("1", "json"); SiteGroupCms.Entity.Admin _admin = (SiteGroupCms.Entity.Admin)Session["admin"]; SiteGroupCms.Entity.Catalogtree tree = new SiteGroupCms.Dal.CatalogDal().GetClassTree(_admin.CurrentSite.ToString(), "0", true); // if(type=="notincludeshare") // Response.Write("[" + SiteGroupCms.Dal.Treejson.tree2json(tree, true) + "]"); // else // Response.Write("[" + SiteGroupCms.Dal.Treejson.tree2json(tree, true) + ",{text:'共享文档库',url:'22',id:'0'}]"); //以下代码解决ie中不可更新栏目的问题,不保留缓存 Response.Buffer = true; Response.ExpiresAbsolute = System.DateTime.Now.AddMonths(-120); Response.Expires = 0; Response.CacheControl = "no-cache"; Response.AddHeader("pragma", "no=cache"); Response.Write("[" + SiteGroupCms.Dal.Treejson.tree2json(tree, true) + "]"); } }