Listp.aspx.cs 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Web;
  4. using System.Web.UI;
  5. using System.Web.UI.WebControls;
  6. using System.Data;
  7. namespace Com.Jpsoft.Hospital.Web.Module.ExamineInfo.SORIS
  8. {
  9. public partial class Listp : Com.Jpsoft.Hospital.Web.Common.BasePage
  10. {
  11. protected override void OnInit(EventArgs e)
  12. {
  13. if (!IsPostBack)
  14. {
  15. base.AutoCheckRight = false;
  16. base.CheckRightParam = Com.Jpsoft.Hospital.Web.Common.PageFuntionType.List;
  17. }
  18. base.OnInit(e);
  19. }
  20. protected void Page_Load(object sender, EventArgs e)
  21. {
  22. if (!IsPostBack)
  23. {
  24. int curpage = 1;
  25. int id = 0;
  26. AspNetPager1.CurrentPageIndex = curpage;
  27. AspNetPager1.RecordCount = AspNetPager1.PageSize * curpage;
  28. BindPageData();
  29. }
  30. }
  31. private void BindPageData()
  32. {
  33. string strWhere = " where 1=1 and IsProcess=0 ";
  34. int recordCount = 0;
  35. string strOrder = " order by PraiseTime DESC";
  36. using (IDataReader idr = Com.Jpsoft.Hospital.DAL.ts_PraiseRecord.SelectPage(AspNetPager1.CurrentPageIndex, AspNetPager1.PageSize, strWhere, strOrder))
  37. {
  38. if (idr.Read())
  39. {
  40. recordCount = Convert.ToInt32(idr["RecordCount"]);
  41. }
  42. AspNetPager1.RecordCount = recordCount;
  43. idr.NextResult();
  44. this.GridView1.DataSource = idr;
  45. this.GridView1.DataBind();
  46. }
  47. }
  48. protected void Unnamed1_Click(object sender, EventArgs e)
  49. {
  50. int uid = Convert.ToInt32(txtUID.Text);
  51. Com.Jpsoft.Hospital.BLL.ts_PraiseRecord bll = new BLL.ts_PraiseRecord();
  52. Com.Jpsoft.Hospital.Model.ts_PraiseRecord model = bll.GetModel(uid);
  53. model.UID = uid;
  54. model.Context = txtContext.Text.Trim();
  55. model.IsProcess = true;
  56. model.Linkman = txtLinkman.Text.Trim();
  57. model.Linktime = Convert.ToDateTime(txtLinktime.Text.Trim());
  58. try
  59. {
  60. bll.UpdateViews(model);
  61. Response.Write("<script>alert('处理成功!');window.location='Listp.aspx';</script>");
  62. }
  63. catch (Exception ex)
  64. {
  65. Response.Write("<script>alert('处理失败!原因:" + ex.ToString() + "');window.location='Listp.aspx';</script>");
  66. }
  67. }
  68. public string GetBoolCN(object obj)
  69. {
  70. bool bl;
  71. if (bool.TryParse(obj.ToString(), out bl))
  72. {
  73. if (bl)
  74. return "是";
  75. }
  76. return "否";
  77. }
  78. protected void AspNetPager1_PageChanged(object sender, EventArgs e)
  79. {
  80. BindPageData();
  81. }
  82. }
  83. }