using BizCom; using Castle.ActiveRecord; using System; using System.Collections.Generic; using System.Data; using System.Linq; using System.Reflection; using System.Text; using System.Threading.Tasks; using System.Web; using System.Web.SessionState; namespace SiteCore.Handler { public partial class sync { public void get_expert() { DataStruct dStruct = GetStruct(); List lw = new List(); string key = GetPostString("key"); if (key.Length > 0) lw.Add(string.Format("name like '%{0}%'", key)); dStruct.Order = "id desc"; dStruct.MainWhere = string.Join(" and ", lw.ToArray()); DataTable dt = WebCache.GetData("s_expert", dStruct); writeGridJson(dStruct.TotalCount, Utils.Serialization.JsonString.DataTable2MiniAjaxJson(dt)); } public void del_expert() { if(UrlParmsCheck("eid")) { int eid = GetInt("eid"); SExpert.Del(eid); returnSuccessMsg("删除成功"); } } public void save_expert() { if (UrlPostParmsCheck("name,type,duites,intro")) { int eid = GetPostInt("eid"); string name = GetPostString("name"); int type = GetPostInt("type"); string imgs = GetPostString("imgs"); string duites = GetPostString("duites"); string intro = GetPostString("intro"); SExpert entity = null; if (eid > 0) entity = SExpert.Get(eid); else entity = new SExpert(); if (imgs.Length > 0) { entity.headImg = imgs.Split(',')[0]; entity.Imgs = imgs; } entity.Name = name; entity.ExType = type; entity.Duties = duites; entity.Intro = intro; if (eid > 0) entity.Update(); else { entity.AddTime = DateTime.Now; entity.Create(); } returnSuccessMsg("保存成功!"); } } } }