my_form.aspx.cs
资源名称:web.rar [点击查看]
上传用户:xrffrp
上传日期:2022-03-25
资源大小:22155k
文件大小:2k
源码类别:
OA系统
开发平台:
ASP/ASPX
- using System;
- using System.Data;
- using System.Configuration;
- using System.Collections;
- using System.Web;
- using System.Web.Security;
- using System.Web.UI;
- using System.Web.UI.WebControls;
- using System.Web.UI.WebControls.WebParts;
- using System.Web.UI.HtmlControls;
- using System.Data.SqlClient;
- public partial class web_probationership_check_form : System.Web.UI.Page
- {
- protected void Page_Load(object sender, EventArgs e)
- {
- if (!IsPostBack)
- {
- this.SetBasic();
- }
- }
- protected void SetBasic()
- {
- if (Session["user"] != null)
- {
- User user = (User)Session["user"];
- LblEmpName.Text = user.Emp_name;
- if (user.IsMale)
- {
- LblSex.Text = "男";
- }
- else
- {
- LblSex.Text = "女";
- }
- LblEmpNo.Text = user.Emp_no;
- LblDepartment.Text = user.Department.Full_name;
- SqlConnection conn = dbConnection.getConnection();
- conn.Open();
- SqlCommand cmd = new SqlCommand("select active_date from OA_EMPLOYEE where id=" + user.Id, conn);
- string active = cmd.ExecuteScalar().ToString();
- LblActiveDate.Text = active;
- try
- {
- string[] days = active.Split(new char[] { '-' });
- int year = Convert.ToInt32(days[0]);
- int month = Convert.ToInt32(days[1]);
- if (month > 10)
- {
- month = month + 2 - 12;
- year++;
- }
- else
- {
- month = month + 2;
- }
- LblProbationDate.Text = year + "-" + month + "-" + days[2];
- }
- catch { }
- conn.Close();
- }
- }
- }