auditDailyManagementContent.aspx.cs 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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. using OA2014.publicCode;
  8. using DAL;
  9. using Models;
  10. namespace OA2014.users
  11. {
  12. public partial class auditDailyManagementContent : SessionCode
  13. {
  14. protected void Page_Load(object sender, EventArgs e)
  15. {
  16. if (!IsPostBack)
  17. {
  18. bindText();
  19. }
  20. }
  21. void bindText()
  22. {
  23. if (Request.QueryString["id"] != null)
  24. {
  25. DailyManagementService dms = new DailyManagementService();
  26. DailyManagement dm = dms.GetDailyManagementByID(Convert.ToInt32(Request.QueryString["id"]));
  27. if (dm != null)
  28. {
  29. txtDailyDate.Text = dm.DailyDate;
  30. txtWorkTitle.Text = dm.WorkTitle;
  31. txtWorkHours.Text = dm.WorkHours;
  32. txtCompletionRate.Text = dm.CompletionRate;
  33. txtWorkContent.Text = dm.WorkContent;
  34. }
  35. }
  36. }
  37. /// <summary>
  38. /// 保存事件
  39. /// </summary>
  40. /// <param name="sender"></param>
  41. /// <param name="e"></param>
  42. protected void btnSave_Click(object sender, EventArgs e)
  43. {
  44. DailyManagementService dms = new DailyManagementService();
  45. DailyManagement dm = new DailyManagement();
  46. if (Request.QueryString["id"] != null)
  47. if (dms.updateAuditDailyManagement(Convert.ToInt32(Request.QueryString["id"])))
  48. Response.Redirect("auditDailyManagement.aspx");
  49. else
  50. PublicCode.GetAlertMsg(this, GetType(), PublicCode.AlertMsgOne);
  51. }
  52. /// <summary>
  53. /// 返回事件
  54. /// </summary>
  55. /// <param name="sender"></param>
  56. /// <param name="e"></param>
  57. protected void btnBack_Click(object sender, EventArgs e)
  58. {
  59. Response.Redirect("auditDailyManagement.aspx");
  60. }
  61. }
  62. }