EmpEdu.aspx.cs
上传用户:autodoor
上传日期:2022-08-04
资源大小:9973k
文件大小:9k
- using System;
- using System.Collections;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Web;
- using System.Web.SessionState;
- using System.Web.UI;
- using System.Web.UI.WebControls;
- using System.Web.UI.HtmlControls;
- using qminoa.BLL;
- using qminoa.Common;
- using qminoa.Common.Data;
- namespace qminoa.Webs.MR
- {
- public class EmpMr33 : qminoa.Webs.PageBase
- {
- protected System.Web.UI.WebControls.Label lblLast;
- protected System.Web.UI.WebControls.Label lblEmpID;
- protected System.Web.UI.WebControls.ValidationSummary ValidationSummary1;
- protected System.Web.UI.WebControls.Label lblErr;
- protected System.Web.UI.WebControls.ImageButton cmdExit;
- protected System.Web.UI.WebControls.ImageButton cmdSaveExi;
- protected System.Web.UI.WebControls.ImageButton cmdSaveCon;
- protected System.Web.UI.WebControls.RangeValidator RangeValidator2;
- protected System.Web.UI.WebControls.RangeValidator RangeValidator1;
- protected System.Web.UI.WebControls.LinkButton cmdQuli4;
- protected System.Web.UI.WebControls.LinkButton cmdQuli3;
- protected System.Web.UI.WebControls.LinkButton cmdQuli2;
- protected System.Web.UI.WebControls.LinkButton cmdQuli1;
- protected System.Web.UI.WebControls.LinkButton cmdSpecial2;
- protected System.Web.UI.WebControls.LinkButton cmdSpecial1;
- protected System.Web.UI.WebControls.LinkButton cmdUniver2;
- protected System.Web.UI.WebControls.LinkButton cmdUniver1;
- protected System.Web.UI.WebControls.TextBox txtQuli4;
- protected System.Web.UI.WebControls.TextBox txtQuli2;
- protected System.Web.UI.WebControls.TextBox txtQuli3;
- protected System.Web.UI.WebControls.TextBox txtQuli1;
- protected System.Web.UI.WebControls.DropDownList dropEduCat2;
- protected System.Web.UI.WebControls.TextBox txtGerTime2;
- protected System.Web.UI.WebControls.TextBox txtSpecial2;
- protected System.Web.UI.WebControls.TextBox txtSchool2;
- protected System.Web.UI.WebControls.Label Label5;
- protected System.Web.UI.WebControls.Label Label6;
- protected System.Web.UI.WebControls.DropDownList dropEduCat1;
- protected System.Web.UI.WebControls.Label Label4;
- protected System.Web.UI.WebControls.TextBox txtGerTime1;
- protected System.Web.UI.WebControls.Label Label3;
- protected System.Web.UI.WebControls.TextBox txtSpecial1;
- protected System.Web.UI.WebControls.TextBox txtSchool1;
- protected System.Web.UI.WebControls.TextBox txtEduNote;
- protected System.Web.UI.WebControls.Label Label13;
- protected System.Web.UI.WebControls.ImageButton cmdMr36;
- protected System.Web.UI.WebControls.ImageButton cmdMr35;
- protected System.Web.UI.WebControls.ImageButton cmdMr34;
- protected System.Web.UI.WebControls.ImageButton cmdMr33;
- protected System.Web.UI.WebControls.ImageButton cmdMr32;
- protected System.Web.UI.WebControls.ImageButton cmdMR31;
- protected System.Web.UI.WebControls.ImageButton cmdMr3;
-
-
- private void Page_Load(object sender, System.EventArgs e)
- {
- this.PageBegin("人员管理",true);
- if(Page.IsPostBack)
- {
- return;
- }
- DataBind();
- FillPage();
- }
- private void FillPage()
- {
- int empID;
- if(lblEmpID.Text==string.Empty)
- {
- empID = Convert.ToInt16(Request.QueryString["PARAM_EMPID"]);
- lblEmpID.Text = empID.ToString();
- }
- else
- {
- empID = Convert.ToInt16(lblEmpID.Text,10);
- }
- DataTable empTB = (new EmpSystem()).GetEmpTB_By_EmpID(empID);
- DataRow row = empTB.Rows[0];
- txtSchool1.Text = row[EmpBaseData.SCHOOL1_FIELD].ToString();
- txtSpecial1.Text = row[EmpBaseData.SPECIAL1_FIELD].ToString();
- if(row[EmpBaseData.GERTIME1_FIELD]!=DBNull.Value)
- {
- txtGerTime1.Text = ((DateTime)row[EmpBaseData.GERTIME1_FIELD]).ToString("d");
- }
- txtSchool2.Text = row[EmpBaseData.SCHOOL2_FIELD].ToString();
- txtSpecial2.Text = row[EmpBaseData.SPECIAL2_FIELD].ToString();
- if(row[EmpBaseData.GERTIME2_FIELD]!=DBNull.Value)
- {
- txtGerTime2.Text = ((DateTime)row[EmpBaseData.GERTIME2_FIELD]).ToString("d");
- }
- dropEduCat1.SelectedIndex = -1;
- foreach(ListItem item in dropEduCat1.Items)
- {
- if(item.Text==row[EmpBaseData.EDUCAT1_FIELD].ToString())
- item.Selected =true;
- }
-
- dropEduCat2.SelectedIndex = -1;
- foreach(ListItem item in dropEduCat2.Items)
- {
- if(item.Text==row[EmpBaseData.EDUCAT2_FIELD].ToString())
- item.Selected =true;
- }
- txtQuli1.Text = row[EmpBaseData.QULI1_FIELD].ToString();
- txtQuli2.Text = row[EmpBaseData.QULI2_FIELD].ToString();
- txtQuli3.Text = row[EmpBaseData.QULI3_FIELD].ToString();
- txtQuli4.Text = row[EmpBaseData.QULI4_FIELD].ToString();
- txtEduNote.Text = row[EmpBaseData.EDUNOTE_FIELD].ToString();
-
- }
- private bool SaveEmpInf()
- {
- if(this.EmpRightCode >= 3)
- {
- EmpBaseData empData = new EmpBaseData();
- DataTable table = empData.Tables[EmpBaseData.EMP_TABLE_NAME];
- DataRow row = table.NewRow();
- table.Rows.Add(row);
- table.AcceptChanges();
- row[EmpBaseData.EMPID_FIELD] = Convert.ToInt16(lblEmpID.Text,10);
- row[EmpBaseData.SCHOOL1_FIELD] = txtSchool1.Text;
- row[EmpBaseData.SPECIAL1_FIELD] = txtSpecial1.Text;
- if(txtGerTime1.Text!=string.Empty)
- {
- row[EmpBaseData.GERTIME1_FIELD] = txtGerTime1.Text;
- }
- row[EmpBaseData.EDUCAT1_FIELD] = dropEduCat1.SelectedItem.Text;
- row[EmpBaseData.SCHOOL2_FIELD] = txtSchool2.Text;
- row[EmpBaseData.SPECIAL2_FIELD] = txtSpecial2.Text;
- if(txtGerTime2.Text!=string.Empty)
- {
- row[EmpBaseData.GERTIME2_FIELD] = txtGerTime2.Text;
- }
- row[EmpBaseData.EDUCAT2_FIELD] = dropEduCat2.SelectedItem.Text;
- row[EmpBaseData.QULI1_FIELD] = txtQuli1.Text;
- row[EmpBaseData.QULI2_FIELD] = txtQuli2.Text;
- row[EmpBaseData.QULI3_FIELD] = txtQuli3.Text;
- row[EmpBaseData.QULI4_FIELD] = txtQuli4.Text;
- row[EmpBaseData.EDUNOTE_FIELD] = txtEduNote.Text;
- return (new EmpSystem()).UpdateEmpEduInf(empData);
- }
- else
- {
- JScript.Alert("您没有权限进行此操作!");
- return false;
- }
- }
- #region Web Form Designer generated code
- override protected void OnInit(EventArgs e)
- {
- //
- // CODEGEN:该调用是 ASP.NET Web 窗体设计器所必需的。
- //
- InitializeComponent();
- base.OnInit(e);
- }
-
- /// <summary>
- /// 设计器支持所需的方法 - 不要使用代码编辑器修改
- /// 此方法的内容。
- /// </summary>
- private void InitializeComponent()
- {
- this.cmdMr3.Click += new System.Web.UI.ImageClickEventHandler(this.cmdMr3_Click);
- this.cmdMR31.Click += new System.Web.UI.ImageClickEventHandler(this.cmdMR31_Click);
- this.cmdMr32.Click += new System.Web.UI.ImageClickEventHandler(this.cmdMr32_Click);
- this.cmdMr33.Click += new System.Web.UI.ImageClickEventHandler(this.cmdMr33_Click);
- this.cmdMr34.Click += new System.Web.UI.ImageClickEventHandler(this.cmdMr34_Click);
- this.cmdMr35.Click += new System.Web.UI.ImageClickEventHandler(this.cmdMr35_Click);
- this.cmdMr36.Click += new System.Web.UI.ImageClickEventHandler(this.cmdMr36_Click);
- this.cmdSaveCon.Click += new System.Web.UI.ImageClickEventHandler(this.cmdSaveCon_Click);
- this.cmdSaveExi.Click += new System.Web.UI.ImageClickEventHandler(this.cmdSaveExi_Click);
- this.cmdExit.Click += new System.Web.UI.ImageClickEventHandler(this.cmdExit_Click);
- this.Load += new System.EventHandler(this.Page_Load);
- }
- #endregion
- private void cmdSaveExi_Click(object sender, System.Web.UI.ImageClickEventArgs e)
- {
- SaveEmpInf();
- Response.Redirect("EmpInf.aspx",false);
- }
- private void cmdSaveCon_Click(object sender, System.Web.UI.ImageClickEventArgs e)
- {
- if(!SaveEmpInf())
- JScript.Alert("操作失败!");
- else
- JScript.Alert("操作成功!");
- }
- private void cmdMr3_Click(object sender, System.Web.UI.ImageClickEventArgs e)
- {
- if(!SaveEmpInf())
- JScript.Alert("操作失败!");
- else
- Response.Redirect("EmpInf.aspx",false);
- }
- private void cmdMR31_Click(object sender, System.Web.UI.ImageClickEventArgs e)
- {
- SaveEmpInf();
- Response.Redirect("EmpPers.aspx?PARAM_EMPID="+Request.QueryString["PARAM_EMPID"].ToString(),false);
- }
- private void cmdMr32_Click(object sender, System.Web.UI.ImageClickEventArgs e)
- {
- SaveEmpInf();
- Response.Redirect("EmpWelInf.aspx?PARAM_EMPID="+Request.QueryString["PARAM_EMPID"].ToString(),false);
- }
- private void cmdMr34_Click(object sender, System.Web.UI.ImageClickEventArgs e)
- {
- SaveEmpInf();
- Response.Redirect("EmpVisaInf.aspx?PARAM_EMPID="+Request.QueryString["PARAM_EMPID"].ToString(),false);
- }
- private void cmdMr33_Click(object sender, System.Web.UI.ImageClickEventArgs e)
- {
-
- }
- private void cmdExit_Click(object sender, System.Web.UI.ImageClickEventArgs e)
- {
- Response.Redirect("EmpInf.aspx?PARAM_EMPID="+Request.QueryString["PARAM_EMPID"].ToString(),false);
- }
- private void cmdMr35_Click(object sender, System.Web.UI.ImageClickEventArgs e)
- {
- SaveEmpInf();
- Response.Redirect("EmpArcInf.aspx?PARAM_EMPID="+Request.QueryString["PARAM_EMPID"].ToString(),false);
- }
- private void cmdMr36_Click(object sender, System.Web.UI.ImageClickEventArgs e)
- {
- SaveEmpInf();
- Response.Redirect("EmpContInf.aspx?PARAM_EMPID="+Request.QueryString["PARAM_EMPID"].ToString(),false);
- }
- }
- }