app.friend.cs 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. using BizCom;
  2. using SQLData;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Data;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. namespace SiteCore.Handler
  10. {
  11. public partial class app
  12. {
  13. public void del_userfriend()
  14. {
  15. int uid = getDecodeInt("uid");
  16. if (uid == 0)
  17. {
  18. conError("找不到会员");
  19. return;
  20. }
  21. if (UrlPostParmsCheck("tuid"))
  22. {
  23. int tuid = getDecodeInt("tuid");
  24. if (tuid == 0)
  25. {
  26. conError("无法删除");
  27. return;
  28. }
  29. string sql = string.Format("delete from s_userfriend where userid={0} and userfriendid={1} ;", uid, tuid);
  30. int s = DbHelper.DbConn.ExecuteNonQuery(sql);
  31. conSuccess("已删除");
  32. return;
  33. }
  34. conError("错误的参数");
  35. }
  36. public void get_userfriend()
  37. {
  38. int uid = getDecodeInt("uid");
  39. if (uid == 0)
  40. {
  41. conError("找不到会员");
  42. return;
  43. }
  44. DataStruct dStruct = GetPostStruct();
  45. List<string> lw = new List<string>();
  46. lw.Add("userid=" + uid);
  47. dStruct.Order = "id desc";
  48. dStruct.MainWhere = string.Join(" and ", lw.ToArray());
  49. dStruct.Fileds = "id,frienduserid as fuid,sex,username";
  50. DataTable dt = WebCache.GetData("view_userfriend", dStruct);
  51. conGridJson(dStruct.TotalCount, Utils.Serialization.JsonString.DataTable2LowerAjaxJson(dt));
  52. }
  53. public void ins_userfriend()
  54. {
  55. }
  56. }
  57. }