| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374 |
- using BizCom;
- using SQLData;
- using System;
- using System.Collections.Generic;
- using System.Data;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace SiteCore.Handler
- {
- public partial class app
- {
- public void get_inst()
- {
- DataStruct dStruct = GetPostStruct();
- List<string> lw = new List<string>();
- string key = GetPostString("key");
- if (key.Length > 0) lw.Add(string.Format("name like '%{0}%'", key));
- dStruct.MainWhere = string.Join(" and ", lw.ToArray());
- dStruct.Order = "sort asc";
- dStruct.Fileds = "id,CoverImg as img,name,stars,tags,address";
- DataTable dt = WebCache.GetData("s_inst", dStruct);
- conGridJson(dStruct.TotalCount, Utils.Serialization.JsonString.DataTable2LowerAjaxJson(dt));
- }
- public void get_instinfo()
- {
- if(UrlPostParmsCheck("id"))
- {
- int id = GetPostInt("id");
- string sql = "select * from s_inst where id=" + id;
- DataTable dt = DbHelper.DbConn.ExecuteDataset(sql).Tables[0];
- conGridJson(dt.Rows.Count, Utils.Serialization.JsonString.DataTable2LowerAjaxJson(dt));
- return;
- }
- conError("错误的参数");
- }
- public void ins_inst()
- {
- UserObj uo = GetUserEntity();
- if (uo == null) return;
- int uid = uo.userid;
- if (UrlPostParmsCheck("eid,con"))
- {
- int eid = GetPostInt("eid");
- string sex = GetPostString("sex");
- string birthday = GetPostString("birthday");
- string mobile = GetPostString("mobile");
- string con = GetPostString("con");
- con = con.Replace("\r\n", "<br>").Replace("\n", "<br>");
- con = con.Replace(" ", " ");
- string images = GetPostString("images").TrimEnd(',');
- SExpertQuestion entity = new SExpertQuestion();
- entity.AddTime = DateTime.Now;
- entity.UserID = uid;
- entity.ExpertID = eid;
- entity.Sex = sex;
- entity.Mobile = mobile;
- entity.BirthDay = birthday;
- entity.Con = con;
- entity.Imgs = images;
- entity.Create();
- conSuccess("提交提问!");
- return;
- }
- conError("错误的参数");
- }
- }
- }
|