RoadFlow2.1 临时演示

Sort.aspx.cs 1.9KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Web;
  5. using System.Web.UI;
  6. using System.Web.UI.WebControls;
  7. namespace WebForm.Platform.Dictionary
  8. {
  9. public partial class Sort : Common.BasePage
  10. {
  11. protected List<RoadFlow.Data.Model.Dictionary> DictList = new List<RoadFlow.Data.Model.Dictionary>();
  12. protected void Page_Load(object sender, EventArgs e)
  13. {
  14. RoadFlow.Platform.Dictionary BDict = new RoadFlow.Platform.Dictionary();
  15. string id = Request.QueryString["id"];
  16. string refreshID = "";
  17. Guid dictid;
  18. if (id.IsGuid(out dictid))
  19. {
  20. var dict = BDict.Get(dictid);
  21. if (dict != null)
  22. {
  23. DictList = BDict.GetChilds(dict.ParentID);
  24. refreshID = dict.ParentID.ToString();
  25. }
  26. }
  27. if (IsPostBack)
  28. {
  29. string sortdict = Request.Form["sort"];
  30. if (sortdict.IsNullOrEmpty())
  31. {
  32. return;
  33. }
  34. string[] sortArray = sortdict.Split(',');
  35. int i = 1;
  36. foreach (string id1 in sortArray)
  37. {
  38. Guid gid;
  39. if (id1.IsGuid(out gid))
  40. {
  41. BDict.UpdateSort(gid, i++);
  42. }
  43. }
  44. BDict.RefreshCache();
  45. RoadFlow.Platform.Log.Add("保存了数据字典排序", "保存了ID为:" + id + "的同级排序", RoadFlow.Platform.Log.Types.数据字典);
  46. Page.ClientScript.RegisterStartupScript(Page.GetType(), "ok", "parent.frames[0].reLoad('" + refreshID + "');", true);
  47. DictList = BDict.GetChilds(refreshID.ToGuid());
  48. }
  49. }
  50. }
  51. }