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_modelsms() { int uid = getDecodeInt("uid"); if (uid == 0) { conError("找不到会员"); return; } string sql = "select typecode,(select count(0) from s_tiding where typecode=b.typecode and touserid=b.touserid and isread=0) as c,(select top 1 con from view_tiding where typecode=b.typecode and touserid=b.touserid order by atime desc) as lcon from view_tiding as b where touserid=" + uid + " group by typecode,touserid"; DataTable dt = DbHelper.DbConn.ExecuteDataset(sql).Tables[0]; conGridJson(dt.Rows.Count, Utils.Serialization.JsonString.DataTable2LowerAjaxJson(dt)); } public void get_msm() { int uid = getDecodeInt("uid"); if (uid == 0) { conError("找不到会员"); return; } string sql = "select count(0) from s_tiding where touserid="+uid+" and isread=0"; object result = DbHelper.DbConn.ExecuteScalar(sql); if (result == null) conSuccess("0"); else conSuccess(result.ToString()); //DataTable dt = DbHelper.DbConn.ExecuteDataset(sql).Tables[0]; //conGridJson(dt.Rows.Count, Utils.Serialization.JsonString.DataTable2LowerAjaxJson(dt)); } public void get_mysms() { int uid = getDecodeInt("uid"); if (uid == 0) { conError("找不到会员"); return; } string typecode = GetPostString("typecode"); DataStruct dStruct = GetPostStruct(); List lw = new List(); if(typecode.Length>0)lw.Add("typecode='" + typecode + "'"); lw.Add("touserid=" + uid); dStruct.Fileds = "id,username,userpic,tid,mainid,typecode,title,con,atime as time,isread"; dStruct.MainWhere = string.Join(" and ", lw.ToArray()); dStruct.Order = "atime desc"; DataTable dt = WebCache.GetData("view_tiding", dStruct); conGridJson(dStruct.TotalCount, Utils.Serialization.JsonString.DataTable2LowerAjaxJson(dt)); } public void read_mysms() { int uid = getDecodeInt("uid"); if (uid == 0) { conError("找不到会员"); return; } if (UrlPostParmsCheck("smsids")) { string smsIds = GetPostString("smsids"); string sql = "update s_tiding set isread=1 where touserid=" + uid + " and mainid in(" + smsIds + ")"; //STiding.ExecuteNonQuery(sql); conSuccess("消息己读"); return; } conError("错误的参数"); } public void read_ewu_sms() { int uid = getDecodeInt("uid"); if (uid == 0) { conError("找不到会员"); return; } if (UrlPostParmsCheck("mainid")) { string mainid = GetPostString("mainid"); string sql = "update s_tiding set isread=1 where mainid=" + mainid + " and touserid=" + uid; //STiding.ExecuteNonQuery(sql); conSuccess("消息己读"); return; } } public void clear_mysms() { int uid = getDecodeInt("uid"); if (uid == 0) { conError("找不到会员"); return; } if (UrlPostParmsCheck("smsids")) { string smsIds = GetPostString("smsids"); string sql = "delete from s_tiding where touserid=" + uid + " and id in(" + smsIds + ")"; //STiding.ExecuteNonQuery(sql); conSuccess("清除消息"); return; } conError("错误的参数"); } } }