EmpEdu.aspx.cs
上传用户:autodoor
上传日期:2022-08-04
资源大小:9973k
文件大小:9k
源码类别:

.net编程

开发平台:

Others

  1. using System;
  2. using System.Collections;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Web;
  7. using System.Web.SessionState;
  8. using System.Web.UI;
  9. using System.Web.UI.WebControls;
  10. using System.Web.UI.HtmlControls;
  11. using qminoa.BLL;
  12. using qminoa.Common;
  13. using qminoa.Common.Data;
  14. namespace qminoa.Webs.MR
  15. {
  16. public class EmpMr33 : qminoa.Webs.PageBase
  17. {
  18. protected System.Web.UI.WebControls.Label lblLast;
  19. protected System.Web.UI.WebControls.Label lblEmpID;
  20. protected System.Web.UI.WebControls.ValidationSummary ValidationSummary1;
  21. protected System.Web.UI.WebControls.Label lblErr;
  22. protected System.Web.UI.WebControls.ImageButton cmdExit;
  23. protected System.Web.UI.WebControls.ImageButton cmdSaveExi;
  24. protected System.Web.UI.WebControls.ImageButton cmdSaveCon;
  25. protected System.Web.UI.WebControls.RangeValidator RangeValidator2;
  26. protected System.Web.UI.WebControls.RangeValidator RangeValidator1;
  27. protected System.Web.UI.WebControls.LinkButton cmdQuli4;
  28. protected System.Web.UI.WebControls.LinkButton cmdQuli3;
  29. protected System.Web.UI.WebControls.LinkButton cmdQuli2;
  30. protected System.Web.UI.WebControls.LinkButton cmdQuli1;
  31. protected System.Web.UI.WebControls.LinkButton cmdSpecial2;
  32. protected System.Web.UI.WebControls.LinkButton cmdSpecial1;
  33. protected System.Web.UI.WebControls.LinkButton cmdUniver2;
  34. protected System.Web.UI.WebControls.LinkButton cmdUniver1;
  35. protected System.Web.UI.WebControls.TextBox txtQuli4;
  36. protected System.Web.UI.WebControls.TextBox txtQuli2;
  37. protected System.Web.UI.WebControls.TextBox txtQuli3;
  38. protected System.Web.UI.WebControls.TextBox txtQuli1;
  39. protected System.Web.UI.WebControls.DropDownList dropEduCat2;
  40. protected System.Web.UI.WebControls.TextBox txtGerTime2;
  41. protected System.Web.UI.WebControls.TextBox txtSpecial2;
  42. protected System.Web.UI.WebControls.TextBox txtSchool2;
  43. protected System.Web.UI.WebControls.Label Label5;
  44. protected System.Web.UI.WebControls.Label Label6;
  45. protected System.Web.UI.WebControls.DropDownList dropEduCat1;
  46. protected System.Web.UI.WebControls.Label Label4;
  47. protected System.Web.UI.WebControls.TextBox txtGerTime1;
  48. protected System.Web.UI.WebControls.Label Label3;
  49. protected System.Web.UI.WebControls.TextBox txtSpecial1;
  50. protected System.Web.UI.WebControls.TextBox txtSchool1;
  51. protected System.Web.UI.WebControls.TextBox txtEduNote;
  52. protected System.Web.UI.WebControls.Label Label13;
  53. protected System.Web.UI.WebControls.ImageButton cmdMr36;
  54. protected System.Web.UI.WebControls.ImageButton cmdMr35;
  55. protected System.Web.UI.WebControls.ImageButton cmdMr34;
  56. protected System.Web.UI.WebControls.ImageButton cmdMr33;
  57. protected System.Web.UI.WebControls.ImageButton cmdMr32;
  58. protected System.Web.UI.WebControls.ImageButton cmdMR31;
  59. protected System.Web.UI.WebControls.ImageButton cmdMr3;
  60. private void Page_Load(object sender, System.EventArgs e)
  61. {
  62. this.PageBegin("人员管理",true);
  63. if(Page.IsPostBack)
  64. {
  65. return;
  66. }
  67. DataBind();
  68. FillPage();
  69. }
  70. private void FillPage()
  71. {
  72. int empID;
  73. if(lblEmpID.Text==string.Empty)
  74. {
  75. empID = Convert.ToInt16(Request.QueryString["PARAM_EMPID"]);
  76. lblEmpID.Text = empID.ToString();
  77. }
  78. else
  79. {
  80. empID = Convert.ToInt16(lblEmpID.Text,10);
  81. }
  82. DataTable empTB = (new EmpSystem()).GetEmpTB_By_EmpID(empID);
  83. DataRow row = empTB.Rows[0];
  84. txtSchool1.Text = row[EmpBaseData.SCHOOL1_FIELD].ToString();
  85. txtSpecial1.Text = row[EmpBaseData.SPECIAL1_FIELD].ToString();
  86. if(row[EmpBaseData.GERTIME1_FIELD]!=DBNull.Value)
  87. {
  88. txtGerTime1.Text = ((DateTime)row[EmpBaseData.GERTIME1_FIELD]).ToString("d");
  89. }
  90. txtSchool2.Text = row[EmpBaseData.SCHOOL2_FIELD].ToString();
  91. txtSpecial2.Text = row[EmpBaseData.SPECIAL2_FIELD].ToString();
  92. if(row[EmpBaseData.GERTIME2_FIELD]!=DBNull.Value)
  93. {
  94. txtGerTime2.Text = ((DateTime)row[EmpBaseData.GERTIME2_FIELD]).ToString("d");
  95. }
  96. dropEduCat1.SelectedIndex = -1;
  97. foreach(ListItem item in dropEduCat1.Items)
  98. {
  99. if(item.Text==row[EmpBaseData.EDUCAT1_FIELD].ToString())
  100. item.Selected =true;
  101. }
  102. dropEduCat2.SelectedIndex = -1;
  103. foreach(ListItem item in dropEduCat2.Items)
  104. {
  105. if(item.Text==row[EmpBaseData.EDUCAT2_FIELD].ToString())
  106. item.Selected =true;
  107. }
  108. txtQuli1.Text = row[EmpBaseData.QULI1_FIELD].ToString();
  109. txtQuli2.Text = row[EmpBaseData.QULI2_FIELD].ToString();
  110. txtQuli3.Text = row[EmpBaseData.QULI3_FIELD].ToString();
  111. txtQuli4.Text = row[EmpBaseData.QULI4_FIELD].ToString();
  112. txtEduNote.Text = row[EmpBaseData.EDUNOTE_FIELD].ToString();
  113. }
  114. private bool SaveEmpInf()
  115. {
  116. if(this.EmpRightCode  >= 3)
  117. {
  118. EmpBaseData empData = new EmpBaseData();
  119. DataTable table = empData.Tables[EmpBaseData.EMP_TABLE_NAME];
  120. DataRow row = table.NewRow();
  121. table.Rows.Add(row);
  122. table.AcceptChanges();
  123. row[EmpBaseData.EMPID_FIELD] = Convert.ToInt16(lblEmpID.Text,10);
  124. row[EmpBaseData.SCHOOL1_FIELD] = txtSchool1.Text;
  125. row[EmpBaseData.SPECIAL1_FIELD] = txtSpecial1.Text;
  126. if(txtGerTime1.Text!=string.Empty)
  127. {
  128. row[EmpBaseData.GERTIME1_FIELD] = txtGerTime1.Text;
  129. }
  130. row[EmpBaseData.EDUCAT1_FIELD] = dropEduCat1.SelectedItem.Text;
  131. row[EmpBaseData.SCHOOL2_FIELD] = txtSchool2.Text;
  132. row[EmpBaseData.SPECIAL2_FIELD] = txtSpecial2.Text;
  133. if(txtGerTime2.Text!=string.Empty)
  134. {
  135. row[EmpBaseData.GERTIME2_FIELD] = txtGerTime2.Text;
  136. }
  137. row[EmpBaseData.EDUCAT2_FIELD] = dropEduCat2.SelectedItem.Text;
  138. row[EmpBaseData.QULI1_FIELD] = txtQuli1.Text;
  139. row[EmpBaseData.QULI2_FIELD] = txtQuli2.Text;
  140. row[EmpBaseData.QULI3_FIELD] = txtQuli3.Text;
  141. row[EmpBaseData.QULI4_FIELD] = txtQuli4.Text;
  142. row[EmpBaseData.EDUNOTE_FIELD] = txtEduNote.Text;
  143. return (new EmpSystem()).UpdateEmpEduInf(empData);
  144. }
  145. else
  146. {
  147. JScript.Alert("您没有权限进行此操作!");
  148. return false;
  149. }
  150. }
  151. #region Web Form Designer generated code
  152. override protected void OnInit(EventArgs e)
  153. {
  154. //
  155. // CODEGEN:该调用是 ASP.NET Web 窗体设计器所必需的。
  156. //
  157. InitializeComponent();
  158. base.OnInit(e);
  159. }
  160. /// <summary>
  161. /// 设计器支持所需的方法 - 不要使用代码编辑器修改
  162. /// 此方法的内容。
  163. /// </summary>
  164. private void InitializeComponent()
  165. {    
  166. this.cmdMr3.Click += new System.Web.UI.ImageClickEventHandler(this.cmdMr3_Click);
  167. this.cmdMR31.Click += new System.Web.UI.ImageClickEventHandler(this.cmdMR31_Click);
  168. this.cmdMr32.Click += new System.Web.UI.ImageClickEventHandler(this.cmdMr32_Click);
  169. this.cmdMr33.Click += new System.Web.UI.ImageClickEventHandler(this.cmdMr33_Click);
  170. this.cmdMr34.Click += new System.Web.UI.ImageClickEventHandler(this.cmdMr34_Click);
  171. this.cmdMr35.Click += new System.Web.UI.ImageClickEventHandler(this.cmdMr35_Click);
  172. this.cmdMr36.Click += new System.Web.UI.ImageClickEventHandler(this.cmdMr36_Click);
  173. this.cmdSaveCon.Click += new System.Web.UI.ImageClickEventHandler(this.cmdSaveCon_Click);
  174. this.cmdSaveExi.Click += new System.Web.UI.ImageClickEventHandler(this.cmdSaveExi_Click);
  175. this.cmdExit.Click += new System.Web.UI.ImageClickEventHandler(this.cmdExit_Click);
  176. this.Load += new System.EventHandler(this.Page_Load);
  177. }
  178. #endregion
  179. private void cmdSaveExi_Click(object sender, System.Web.UI.ImageClickEventArgs e)
  180. {
  181. SaveEmpInf();
  182. Response.Redirect("EmpInf.aspx",false);
  183. }
  184. private void cmdSaveCon_Click(object sender, System.Web.UI.ImageClickEventArgs e)
  185. {
  186. if(!SaveEmpInf())
  187. JScript.Alert("操作失败!");
  188. else
  189. JScript.Alert("操作成功!");
  190. }
  191. private void cmdMr3_Click(object sender, System.Web.UI.ImageClickEventArgs e)
  192. {
  193. if(!SaveEmpInf())
  194. JScript.Alert("操作失败!");
  195. else
  196. Response.Redirect("EmpInf.aspx",false);
  197. }
  198. private void cmdMR31_Click(object sender, System.Web.UI.ImageClickEventArgs e)
  199. {
  200. SaveEmpInf();
  201. Response.Redirect("EmpPers.aspx?PARAM_EMPID="+Request.QueryString["PARAM_EMPID"].ToString(),false);
  202. }
  203. private void cmdMr32_Click(object sender, System.Web.UI.ImageClickEventArgs e)
  204. {
  205. SaveEmpInf();
  206. Response.Redirect("EmpWelInf.aspx?PARAM_EMPID="+Request.QueryString["PARAM_EMPID"].ToString(),false);
  207. }
  208. private void cmdMr34_Click(object sender, System.Web.UI.ImageClickEventArgs e)
  209. {
  210. SaveEmpInf();
  211. Response.Redirect("EmpVisaInf.aspx?PARAM_EMPID="+Request.QueryString["PARAM_EMPID"].ToString(),false);
  212. }
  213. private void cmdMr33_Click(object sender, System.Web.UI.ImageClickEventArgs e)
  214. {
  215. }
  216. private void cmdExit_Click(object sender, System.Web.UI.ImageClickEventArgs e)
  217. {
  218. Response.Redirect("EmpInf.aspx?PARAM_EMPID="+Request.QueryString["PARAM_EMPID"].ToString(),false);
  219. }
  220. private void cmdMr35_Click(object sender, System.Web.UI.ImageClickEventArgs e)
  221. {
  222. SaveEmpInf();
  223. Response.Redirect("EmpArcInf.aspx?PARAM_EMPID="+Request.QueryString["PARAM_EMPID"].ToString(),false);
  224. }
  225. private void cmdMr36_Click(object sender, System.Web.UI.ImageClickEventArgs e)
  226. {
  227. SaveEmpInf();
  228. Response.Redirect("EmpContInf.aspx?PARAM_EMPID="+Request.QueryString["PARAM_EMPID"].ToString(),false);
  229. }
  230. }
  231. }