protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { string transferID = Request.QueryString.Get("transferID"); EmployeeTransferBLL objTransferBll = new EmployeeTransferBLL(); EmployeeTransfer obj = objTransferBll.GetEmployeeTransfer(Convert.ToInt32(transferID)); txtName.Text = obj.EmployeeName; txtWorkNo.Text = obj.WorkNo; lblOrg.Text = obj.TransferToOrgName; ViewState["EmployeeID"] = obj.EmployeeID.ToString(); OracleAccess db = new OracleAccess(); string strSql = "select * from Employee where Employee_ID=" + ViewState["EmployeeID"]; DataRow dr = db.RunSqlDataSet(strSql).Tables[0].Rows[0]; txtPostNo.Text = dr["Identity_CardNo"].ToString(); BindWorkShopStart(); BindWorkgroupStart(); OrganizationBLL objBll = new OrganizationBLL(); IList <RailExam.Model.Organization> objList = objBll.GetOrganizationsByParentID(obj.TransferToOrgID); foreach (RailExam.Model.Organization organization in objList) { ListItem item = new ListItem(); item.Value = organization.OrganizationId.ToString(); item.Text = organization.ShortName; ddlWorkshop.Items.Add(item); } } }
private void BindGrid() { EmployeeTransferBLL objBll = new EmployeeTransferBLL(); IList <EmployeeTransfer> objList = objBll.GetEmployeeTransferToByOrgID(PrjPub.CurrentLoginUser.StationOrgID); grdEntity.DataSource = objList; grdEntity.DataBind(); }
protected void btnOk_Click(object sender, EventArgs e) { OracleAccess db = new OracleAccess(); string strSql = "select * from Employee where Employee_ID=" + ViewState["EmployeeID"]; DataRow dr = db.RunSqlDataSet(strSql).Tables[0].Rows[0]; int orgID; if (ddlWorkgroup.SelectedValue != "0") { orgID = Convert.ToInt32(ddlWorkgroup.SelectedValue); } else { orgID = Convert.ToInt32(ddlWorkshop.SelectedValue); } OrganizationBLL organizationBLL = new OrganizationBLL(); EmployeeBLL objEmployeeBll = new EmployeeBLL(); IList <RailExam.Model.Employee> objView = objEmployeeBll.GetEmployeeByWhereClause("GetStationOrgID(a.Org_ID)=" + organizationBLL.GetStationOrgID(orgID) + " and Work_No='" + txtWorkNo.Text.Trim() + "'"); if (objView.Count > 0) { SessionSet.PageMessage = "该员工编码在本单位已经存在!"; return; } strSql = "update Employee " + " set Employee_Name='" + txtName.Text + "'," + "Org_ID=" + orgID + "," + "Work_No='" + txtWorkNo.Text + "'," + "identity_CardNo='" + txtPostNo.Text + "'," + "PinYin_Code='" + Pub.GetChineseSpell(txtName.Text) + "' " + " where Employee_ID=" + ViewState["EmployeeID"]; db.ExecuteNonQuery(strSql); strSql = "insert into ZJ_Employee_Work " + " values(Employee_Work_Seq.nextval, " + dr["EMPLOYEE_ID"] + ", to_char(sysdate,'yyyy-mm-dd')," + dr["org_id"] + "," + orgID + "," + dr["Post_ID"] + "," + dr["Post_ID"] + "," + "'',sysdate,'" + PrjPub.CurrentLoginUser.EmployeeName + "'," + "to_date('" + dr["Post_Date"] + "','YYYY-MM-DD HH24:MI:SS'))"; db.ExecuteNonQuery(strSql); string transferID = Request.QueryString.Get("transferID"); EmployeeTransferBLL objTransferBll = new EmployeeTransferBLL(); objTransferBll.DeleteEmployeeTransfer(Convert.ToInt32(transferID)); SystemLogBLL objLogBll = new SystemLogBLL(); objLogBll.WriteLog("将" + dr["Employee_Name"] + "调至" + lblOrg.Text); Response.Write("<script>window.returnValue='true';window.close();</script>"); }
private void BindGridEmp() { EmployeeTransferBLL objBll = new EmployeeTransferBLL(); IList <EmployeeTransfer> objList = objBll.GetEmployeeTransferToByOrgID(PrjPub.CurrentLoginUser.StationOrgID); grdEmployee.DataSource = objList; grdEmployee.DataBind(); if (objList.Count != 0) { TabStrip2.Tabs[2].Text = "职员调入提醒(" + objList.Count + ")"; } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (PrjPub.CurrentLoginUser == null) { Response.Redirect("/RailExamBao/Common/Error.aspx?error=Session过期请重新登录本系统!"); return; } if (PrjPub.HasEditRight("职员调出") && PrjPub.IsServerCenter) { HfUpdateRight.Value = "True"; } else { HfUpdateRight.Value = "False"; } if (PrjPub.HasDeleteRight("职员调出") && PrjPub.IsServerCenter) { HfDeleteRight.Value = "True"; } else { HfDeleteRight.Value = "False"; } BindGrid(); } if (Request.Form.Get("Refresh") != null && Request.Form.Get("Refresh") == "true") { BindGrid(); } if (Request.Form.Get("DeleteID") != null && Request.Form.Get("DeleteID") != "") { EmployeeTransferBLL objBll = new EmployeeTransferBLL(); objBll.DeleteEmployeeTransfer(Convert.ToInt32(Request.Form.Get("DeleteID"))); BindGrid(); } }
protected void btnOk_Click(object sender, EventArgs e) { string[] strID = hfEmployeeID.Value.Split(','); EmployeeTransferBLL objBll = new EmployeeTransferBLL(); IList <EmployeeTransfer> objList = new List <EmployeeTransfer>(); OracleAccess db = new OracleAccess(); string strSql; if (PrjPub.CurrentLoginUser.SuitRange == 1) { strSql = @"select getstationorgid(org_id) stationorgid,count(*) AdminCount, GetOrgName(getstationorgid(org_id)) stationName from system_user s left join employee e on s.employee_id=e.employee_id where role_id=123 group by getstationorgid(org_id)"; } else { strSql = @"select getstationorgid(org_id) stationorgid,count(*) AdminCount, GetOrgName(getstationorgid(org_id)) stationName from system_user s left join employee e on s.employee_id=e.employee_id where role_id=123 and getstationorgid(org_id)=" + PrjPub.CurrentLoginUser.StationOrgID + @" group by getstationorgid(org_id)"; } DataTable dtCount = db.RunSqlDataSet(strSql).Tables[0]; strSql = @"select GetStationOrgID(org_id) stationorgid,s.* from Employee a inner join system_user s on s.employee_id=a.employee_id where a.Employee_ID in (" + hfEmployeeID.Value + ")"; DataTable dtEmployee = db.RunSqlDataSet(strSql).Tables[0]; strSql = @"select a.*,b.Employee_Name from EMPLOYEE_TRANSFER a inner join Employee b on a.Employee_ID=b.Employee_ID where getstationorgid(org_id)=" + PrjPub.CurrentLoginUser.StationOrgID; DataTable dtHasTrans = db.RunSqlDataSet(strSql).Tables[0]; Hashtable htCount = new Hashtable(); int count = 0; string error = string.Empty; for (int i = 0; i < strID.Length; i++) { EmployeeTransfer objTransfer = new EmployeeTransfer(); objTransfer.EmployeeID = Convert.ToInt32(strID[i]); objTransfer.TransferToOrgID = Convert.ToInt32(ddlOrg.SelectedValue); objList.Add(objTransfer); if (strID[i] == PrjPub.CurrentLoginUser.EmployeeID.ToString()) { count++; } DataRow[] drAdmin = dtEmployee.Select("Employee_ID=" + strID[i] + " and Role_ID=123"); if (drAdmin.Length > 0) { string stationid = drAdmin[0]["StationOrgID"].ToString(); if (htCount.ContainsKey(stationid)) { int num = Convert.ToInt32(htCount[stationid]); htCount[stationid] = num + 1; } else { htCount.Add(stationid, 1); } } DataRow[] drHasTrans = dtHasTrans.Select("Employee_ID=" + strID[i]); if (drHasTrans.Length > 0) { error = "学员【" + drHasTrans[0]["Employee_Name"] + "】已经处于调出状态,不能重复调出!"; break; } } if (error != "") { ClientScript.RegisterClientScriptBlock(GetType(), "", "alert('" + error + "')", true); return; } string strMessage = ""; foreach (DataRow dr in dtCount.Rows) { string stationid = dr["stationorgid"].ToString(); if (htCount.ContainsKey(stationid)) { int nownum = Convert.ToInt32(htCount[stationid]); if (nownum == Convert.ToInt32(dr["AdminCount"].ToString())) { strMessage = "必须为" + dr["stationName"] + "至少保留一位站段管理员!"; break; } } } if (count > 0) { ClientScript.RegisterClientScriptBlock(GetType(), "", "alert('" + PrjPub.CurrentLoginUser.EmployeeName + "是当前操作人员,不能被调出!')", true); return; } if (strMessage != "") { ClientScript.RegisterClientScriptBlock(GetType(), "", "alert('" + strMessage + "')", true); return; } objBll.AddEmployeeTransfer(objList); SystemLogBLL objLogBll = new SystemLogBLL(); objLogBll.WriteLog("将部分员工调至" + ddlOrg.SelectedItem.Text); Response.Write("<script>window.returnValue='true';window.close();</script>"); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (PrjPub.CurrentLoginUser == null) { Response.Redirect("EmployeeDesktop.aspx"); return; } if (PrjPub.CurrentLoginUser.IsDangan) { Response.Redirect("DanganDesktop.aspx"); return; } if (PrjPub.HasEditRight("成绩查询")) { HfUpdateRight.Value = "True"; } else { HfUpdateRight.Value = "False"; } if (PrjPub.HasEditRight("考试监控")) { HfUpdateRightControl.Value = "True"; } else { HfUpdateRightControl.Value = "False"; } if (PrjPub.HasEditRight("培训计划")) { HfUpdateRightPlan.Value = "True"; } else { HfUpdateRightPlan.Value = "False"; } if (PrjPub.IsServerCenter) { hfNowOrgID.Value = PrjPub.CurrentLoginUser.StationOrgID.ToString(); if (PrjPub.CurrentLoginUser.IsAdmin && PrjPub.CurrentLoginUser.UseType == 0) { hfIsAdminControl.Value = "True"; } else { hfIsAdminControl.Value = "False"; } hfIsAdmin.Value = "True"; } else { hfNowOrgID.Value = ConfigurationManager.AppSettings["StationID"].ToString(); if ((PrjPub.CurrentLoginUser.IsAdmin && PrjPub.CurrentLoginUser.UseType == 0) || (PrjPub.CurrentLoginUser.IsAdmin && PrjPub.CurrentLoginUser.UseType == 1 && PrjPub.CurrentLoginUser.StationOrgID.ToString() == hfNowOrgID.Value)) { hfIsAdminControl.Value = "True"; } else { hfIsAdminControl.Value = "False"; } if ((PrjPub.CurrentLoginUser.StationOrgID.ToString() == hfNowOrgID.Value) || PrjPub.CurrentLoginUser.UseType == 0) { hfIsAdmin.Value = "True"; } else { hfIsAdmin.Value = "False"; } } lblIP.Text = Pub.GetRealIP(); SystemVersionBLL objVersionBll = new SystemVersionBLL(); if (PrjPub.IsServerCenter) { this.lblVersion.Text = objVersionBll.GetVersion().ToString("0.0"); EmployeeTransferBLL objTrasferBll = new EmployeeTransferBLL(); IList <EmployeeTransfer> objList = objTrasferBll.GetEmployeeTransferToByOrgID(PrjPub.CurrentLoginUser.StationOrgID); lblVersion.Text = lblVersion.Text + " " + "当前有" + objList.Count + "位员工需要调入"; int orgID = PrjPub.CurrentLoginUser.StationOrgID; grdEntity2Bind(orgID); BindGridEmp(); BindGrdPlan(); } else { this.lblVersion.Text = "<a href=# onclick='showVersion()' >" + objVersionBll.GetVersion().ToString("0.0") + "</a>"; } } string strRefresh = Request.Form.Get("Refresh"); if (strRefresh != null && strRefresh != "") { examsGrid.DataBind(); Grid1.DataBind(); } if (Request.Form.Get("RefreshComp") != null && Request.Form.Get("RefreshComp") == "true") { int orgID = PrjPub.CurrentLoginUser.StationOrgID; grdEntity2Bind(orgID); } if (Request.Form.Get("RefreshEmp") != null && Request.Form.Get("RefreshEmp") == "true") { BindGridEmp(); } BindGrdPlan(); BindGridUpdate(); }