piyuexiu.aspx.cs
上传用户:lishan0805
上传日期:2019-12-08
资源大小:12048k
文件大小:3k
源码类别:

OA系统

开发平台:

C#

  1. using System;
  2. using System.Data;
  3. using System.Configuration;
  4. using System.Collections;
  5. using System.Web;
  6. using System.Web.Security;
  7. using System.Web.UI;
  8. using System.Web.UI.WebControls;
  9. using System.Web.UI.WebControls.WebParts;
  10. using System.Web.UI.HtmlControls;
  11. using COM.OA.Entity;
  12. using COM.OA.BLL;
  13. using System.Collections.Generic;
  14. public partial class qs_rizhi_piyuedelete : System.Web.UI.Page
  15. {
  16.     protected void Page_Load(object sender, EventArgs e)
  17.     {
  18.         if (!IsPostBack)
  19.         {
  20.             users loginuser = Session["loginuser"] as users;
  21.             int uidd = loginuser.u_id;
  22.             string where5 = "op_u_id='{0}'";
  23.             where5 = string.Format(where5, uidd);
  24.             IList<operate> listop = operateBLL.Select(where5);
  25.             operate op = listop[0];
  26.             int quanxian = op.op_pop_id;
  27.             if (loginuser == null)
  28.             {
  29.                 this.Response.Write(string.Format(GetRedirect.ALLREDIRECT, "../login.aspx"));
  30.                 return;
  31.             }
  32.             else if (quanxian < 1)
  33.             {
  34.                 this.Response.Write(string.Format(GetRedirect.WINALERT, "您不是经理没有批阅条件"));
  35.                 this.Response.Write(string.Format(GetRedirect.REDIRECT, "rizhipiyue.aspx"));
  36.             }
  37.             else
  38.             {
  39.                 string id = this.Request.QueryString["w_id"];
  40.                 int wid = Int32.Parse(id);
  41.                 worklog wl = worklogBLL.Select(wid);
  42.                 //发送人ID
  43.                 int uid = wl.w_u_id;
  44.                 users us = usersBLL.Select(uid);
  45.                 //批阅人ID
  46.                 int pid = wl.w_readerid;
  47.                 users up = usersBLL.Select(pid);
  48.                 this.txtUname.Text = us.u_username;
  49.                 this.txtBiaoTi.Text = wl.w_title;
  50.                 this.txtNeiRong.Text = wl.w_content;
  51.                 this.txtPeiId.Text = up.u_username;
  52.             }
  53.         }
  54.     }
  55.     protected void btXiuGai_Click(object sender, EventArgs e)
  56.     {
  57.         string pname = this.txtPeiId.Text;
  58.         string where = "u_username='{0}'";
  59.         //根据姓名查部门ID
  60.         where = string.Format(where, pname);
  61.         IList<users> list = usersBLL.Select(where);
  62.         users us = list[0];
  63.         int pid = us.u_id;
  64.         string peineirong = this.ftbXiuNR.Text;
  65.         DateTime ptime = DateTime.Now;
  66.         string wwid = this.Request.QueryString["w_id"];
  67.         int w_id = Int32.Parse(wwid);
  68.         worklog wl = worklogBLL.Select(w_id);
  69.         //重新封装
  70.         worklog wll = new worklog();
  71.         wll.w_id = wl.w_id;
  72.         wll.w_title = wl.w_title;
  73.         wll.w_clicks = wl.w_clicks;
  74.         wll.w_content = wl.w_content;
  75.         wll.w_sendtime = wl.w_sendtime;
  76.         //讨论后再定
  77.         wll.w_state = wl.w_state;
  78.         wll.w_u_id = wl.w_u_id;
  79.         wll.w_readerid = pid;
  80.         wll.w_readcontent = peineirong;
  81.         wll.w_readtime = ptime;
  82.         worklogBLL.Update(wll);
  83.         this.Response.Redirect("rizhipiyue.aspx");
  84.     }
  85.    
  86. }