/// <summary> /// 页面加载 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack && !Callback1.IsCallback) { try { EmployeeBLL employeeBLL = new EmployeeBLL(); Employee employee = employeeBLL.GetEmployee(Convert.ToInt32(PrjPub.StudentID)); hfEmployeeName.Value = employee.EmployeeName; hfEmployeID.Value = PrjPub.StudentID; hfOrgID.Value = employee.OrgID.ToString(); txtOrg.Text = employee.OrgName; hfPostID.Value = employee.PostID.ToString(); txtPost.Text = employee.PostName; ddlIsGroup.SelectedValue = employee.IsGroupLeader.ToString(); ddlTech.SelectedValue = employee.TechnicianTypeID.ToString(); } catch { Response.Redirect("/RailExamBao/Common/Error.aspx?error=超时时间已到,请重新登录"); return; } if (!PrjPub.IsShowOnline()) { Response.Redirect("/RailExamBao/Common/Error.aspx?error=您当前时间无权使用此功能"); } } }
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"; } BindTrainTypeTree(); } }
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"; } hfRole.Value = PrjPub.CurrentLoginUser.RoleID.ToString(); BindOrganizationTree(); } if (hfRefresh.Value != "") { DownloadExcel(hfRefresh.Value); } }
protected void Page_Load(object sender, EventArgs e) { //得到是否是武汉铁路局 if (PrjPub.IsWuhan()) { hfIswuhan.Value = "1"; } else { hfIswuhan.Value = "0"; } if (!IsPostBack) { BindTree(); BindTrainTypeTree(); } string str1 = Request.Form.Get("Test1"); if (str1 != null & str1 != "") { BindTree(); BindTrainTypeTree(); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (PrjPub.HasEditRight("¸¨µ¼½Ì²Ä") && PrjPub.IsServerCenter && PrjPub.CurrentLoginUser.SuitRange == 1) { HfUpdateRight.Value = "True"; } else { HfUpdateRight.Value = "False"; } BindDdl(); DateTime start = new DateTime(2000, 1, 1); DateTime end = new DateTime(2100, 12, 31); AssistBookUpdateBLL objBll = new AssistBookUpdateBLL(); IList <AssistBookUpdate> objList = objBll.GetAssistBookUpdateBySelect(0, "", "", start, end, ""); dgUpdate.DataSource = objList; dgUpdate.DataBind(); } string strRefreshGrid = Request.Form.Get("RefreshGrid"); if (strRefreshGrid != null & strRefreshGrid != "") { BindGrid(); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { //if (PrjPub.IsServerCenter && PrjPub.CurrentLoginUser.SuitRange != 1) //{ // HfUpdateRight.Value = "False"; //} //else //{ // HfUpdateRight.Value = PrjPub.HasEditRight("考试设计").ToString(); //} 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"; } BindExamCategoryTree(); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (PrjPub.CurrentLoginUser == null) { Response.Redirect("/RailExamBao/Common/Error.aspx?error=Session过期请重新登录本系统!"); return; } BindKnowledgeTree(); BindTrainTypeTree(); BindPost(); if (PrjPub.HasEditRight("教材管理") && PrjPub.IsServerCenter) //&& PrjPub.CurrentLoginUser.SuitRange == 1 { HfUpdateRight.Value = "True"; } else { HfUpdateRight.Value = "False"; } } string strRefresh = Request.Form.Get("Refresh"); if (!string.IsNullOrEmpty(strRefresh)) { BindKnowledgeTree(); BindTrainTypeTree(); BindPost(); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (PrjPub.CurrentLoginUser == null) { Response.Redirect("/RailExamBao/Common/Error.aspx?error=Session过期请重新登录本系统!"); return; } BindInformationSystem(); BindInformationLevel(); if (PrjPub.HasEditRight("资料查阅") && PrjPub.IsServerCenter) { HfUpdateRight.Value = "True"; } else { HfUpdateRight.Value = "False"; } } string strRefresh = Request.Form.Get("Refresh"); if (!string.IsNullOrEmpty(strRefresh)) { BindInformationSystem(); BindInformationLevel(); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (PrjPub.IsWuhan()) { Grid1.Columns[3].HeaderText = "Ô±¹¤±àÂë"; } else { Grid1.Columns[3].HeaderText = "¹¤×ʱàºÅ"; } string strId = Request.QueryString.Get("employeeID"); if (strId != null && strId != "") { ViewState["ChooseId"] = strId; ViewState["UpdateMode"] = 1; } else { ViewState["ChooseId"] = ""; ViewState["UpdateMode"] = 0; } BindStationStart(); BindOrgStart(); BindWorkShopStart(); BindSystemStart(); BindTypeStart(); BindPostStart(); EmployeeBLL bll = new EmployeeBLL(); RailExam.Model.Employee employee = bll.GetEmployee(Convert.ToInt32(Request.QueryString.Get("nowEmployeeID"))); OrganizationBLL orgbll = new OrganizationBLL(); int stationOrgID = orgbll.GetStationOrgID(employee.OrgID); if (stationOrgID != 200) { ddlStation.SelectedValue = stationOrgID.ToString(); OrganizationBLL objBll = new OrganizationBLL(); IList <RailExam.Model.Organization> objList = objBll.GetOrganizationsByParentID(Convert.ToInt32(ddlStation.SelectedValue)); foreach (RailExam.Model.Organization organization in objList) { ListItem item = new ListItem(); item.Value = organization.OrganizationId.ToString(); item.Text = organization.ShortName; ddlWorkShop.Items.Add(item); } ddlStation.Enabled = false; } ViewState["StartRow"] = 0; ViewState["EndRow"] = Grid1.PageSize; ViewState["EmploySortField"] = "nlssort(a.employee_name,'NLS_SORT=SCHINESE_PINYIN_M')"; BindGrid(ViewState["EmploySortField"].ToString()); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (PrjPub.CurrentLoginUser == null) { Response.Redirect("/RailExamBao/Common/Error.aspx?error=Session过期请重新登录本系统!"); return; } tvInformation.Nodes.Clear(); GenerateInformationTree(null); if (PrjPub.HasEditRight("资料领域") && PrjPub.IsServerCenter) { HfUpdateRight.Value = "True"; } else { HfUpdateRight.Value = "False"; } if (PrjPub.HasDeleteRight("资料领域") && PrjPub.IsServerCenter) { HfDeleteRight.Value = "True"; } else { HfDeleteRight.Value = "False"; } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (PrjPub.HasEditRight("站段服务器信息") && PrjPub.IsServerCenter) { HfUpdateRight.Value = "True"; } else { HfUpdateRight.Value = "False"; } if (PrjPub.HasDeleteRight("站段服务器信息") && PrjPub.IsServerCenter) { HfDeleteRight.Value = "True"; } else { HfDeleteRight.Value = "False"; } string orgID = Request.QueryString.Get("OrgID"); if (!String.IsNullOrEmpty(orgID)) { this.hfSelectOrg.Value = orgID; BindGrid(); } } }
private string GetPlanInfo() { string str = ""; int railSystemId = PrjPub.GetRailSystemId(); if (railSystemId != 0) { str = " or SPONSOR_UNIT_ID in (select Org_ID from Org where Rail_System_ID=" + railSystemId + " and level_num=2) or undertake_unit_id in (select Org_ID from Org where Rail_System_ID=" + railSystemId + " and level_num=2) "; string strSql = "select Org_ID from Org where Rail_System_ID=" + railSystemId + " and level_num=2"; OracleAccess db = new OracleAccess(); DataSet ds = db.RunSqlDataSet(strSql); foreach (DataRow dr in ds.Tables[0].Rows) { str += "or ','|| orgids||',' like '%," + dr["Org_ID"] + ",%'"; } } OracleAccess access = new OracleAccess(); string sql = string.Format("select * from zj_train_plan_view where SPONSOR_UNIT_ID={0} or UNDERTAKE_UNIT_ID={0} or ','|| orgids||',' like '%,{0},%' {1}", PrjPub.CurrentLoginUser.StationOrgID, str); return(sql); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (PrjPub.HasEditRight("课件管理") && PrjPub.IsServerCenter) { HfUpdateRight.Value = "True"; } else { HfUpdateRight.Value = "False"; } if (PrjPub.HasDeleteRight("课件管理") && PrjPub.IsServerCenter) { HfDeleteRight.Value = "True"; } else { HfDeleteRight.Value = "False"; } } BindCoursewareTypeTree(); BindTrainTypeTree(); }
private void grdEntity2Bind(int ORGID) { DataSet ds = new DataSet(); OracleAccess OrA = new OracleAccess(); if (ORGID < 0) { this.grdEntity2 = null; grdEntity2.DataBind(); } else { string str = ""; int railSystemId = PrjPub.GetRailSystemId(); if (railSystemId != 0) { str = " or APPLY_ORG_ID in (select Org_ID from Org where Rail_System_ID=" + railSystemId + " and level_num=2)"; } ds = OrA.RunSqlDataSet(string.Format("select * from computer_room_apply_two_view where APPLY_ORG_ID={0}" + str, ORGID)); grdEntity2.DataSource = ds.Tables.Count > 0 ? ds.Tables[0] : null; grdEntity2.DataBind(); } }
/// <summary> /// 获取所有站段 /// </summary> /// <returns></returns> private DataTable GetOrg() { string str = ""; if (hfOrgID.Value != "0") { str += " and getstationorgid(e.org_id)=" + hfOrgID.Value; } else { int railSystemId = PrjPub.GetRailSystemId(); if (railSystemId != 0) { str += " and (GetRailSystemId(e.org_id)=" + railSystemId + " or getstationorgid(e.org_id)=" + PrjPub.CurrentLoginUser.StationOrgID + ")"; } } OracleAccess access = new OracleAccess(); string sql = string.Format( @" select to_char(o.short_name) ,o.org_id, o.order_index from employee e inner join org o on getstationorgid(e.org_id)=o.org_id {0} group by o.short_name,o.order_index,o.org_id union select '合计',0,0 from dual order by order_index" , str); return(access.RunSqlDataSet(sql).Tables[0]); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (PrjPub.HasEditRight("考场规则")) { btnSave.Enabled = true; } else { btnSave.Enabled = false; } string strSql = "select * from System_Exam where System_Exam_ID=1"; OracleAccess db = new OracleAccess(); DataTable dt = db.RunSqlDataSet(strSql).Tables[0]; if (dt.Rows.Count == 0) { txtMesage.Text = string.Empty; txtTime.Text = string.Empty; txtNumber.Text = string.Empty; } else { txtMesage.Text = dt.Rows[0]["Exam_Message"].ToString(); txtTime.Text = dt.Rows[0]["Exam_Time"].ToString(); txtNumber.Text = dt.Rows[0]["Exam_Number"].ToString(); } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (PrjPub.IsWuhan()) { gradesGrid.Levels[0].Columns[2].HeadingText = "员工编码"; lblWorkNo.Text = "上岗证号"; } else { gradesGrid.Levels[0].Columns[2].HeadingText = "工资编号"; lblWorkNo.Text = "工资编号"; } DataSet ds = GetDataSet(); if (ds != null && ds.Tables[0].Rows.Count > 0) { gradesGrid.DataSource = ds; gradesGrid.DataBind(); } //else //{ // SessionSet.PageMessage = "数据错误!"; // return; //} } else { if (Request.Form.Get("OutPut") != null && Request.Form.Get("OutPut") != "") { OutputData(Request.Form.Get("OutPut"), Request.Form.Get("OutPutOrgID")); } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { hfID.Value = Request.QueryString.Get("classOrgID"); BindGridStudent(); string strSql = "select * from ZJ_Train_Plan_Post_Class_Org where Train_Plan_Post_Class_Org_ID= " + hfID.Value; OracleAccess db = new OracleAccess(); string strClassID = db.RunSqlDataSet(strSql).Tables[0].Rows[0]["Train_Plan_Post_Class_ID"].ToString(); HasExam.Value = IsHasExamByClassID(Convert.ToInt32(strClassID)).ToString(); if (PrjPub.HasDeleteRight("培训计划") && PrjPub.IsServerCenter) { btnDelAll.Enabled = true; grdEntity.Levels[0].Columns[10].Visible = true; } else { btnDelAll.Enabled = false; grdEntity.Levels[0].Columns[10].Visible = false; } } string strRefresh = Request.Form.Get("hfRefresh"); if (!string.IsNullOrEmpty(strRefresh)) { DownloadExcel(strRefresh); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (PrjPub.HasEditRight("职员管理") && PrjPub.IsServerCenter) { HfUpdateRight.Value = "True"; } else { HfUpdateRight.Value = "False"; } if (PrjPub.HasDeleteRight("职员管理") && PrjPub.IsServerCenter) { HfDeleteRight.Value = "True"; } else { HfDeleteRight.Value = "False"; } string strSql = @"select b.Employee_ID as EmployeeID,b.Employee_Name as EmployeeName,b.Work_No as WorkNo, GetOrgName(b.Org_ID) as OrgName,d.Post_Name as PostName,c.Role_Name as RoleName from system_user a inner join employee b on a.employee_id=b.employee_id inner join system_role c on a.Role_ID=c.Role_ID inner join Post d on b.Post_ID=d.Post_ID where GetStationOrgID(b.Org_ID)=" + Request.QueryString.Get("id") + " and a.Role_ID>0 order by a.Role_ID"; OracleAccess oa = new OracleAccess(); DataSet ds = oa.RunSqlDataSet(strSql); Grid1.DataSource = ds; Grid1.DataBind(); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { string strStationID = ConfigurationManager.AppSettings["StationID"]; if (strStationID == "200") { lblDate.Text = PrjPub.GetRailName() + "·þÎñÆ÷"; } else { OrganizationBLL orgBll = new OrganizationBLL(); Organization organization = orgBll.GetOrganization(Convert.ToInt32(strStationID)); lblDate.Text = organization.ShortName + "·þÎñÆ÷"; } string strSql = "select * from Computer_Server where Computer_Server_No='" + PrjPub.ServerNo + "'"; OracleAccess db = new OracleAccess(); DataSet ds = db.RunSqlDataSet(strSql); if (ds.Tables[0].Rows.Count > 0) { lblServerName.Text = ds.Tables[0].Rows[0]["Computer_Server_Name"].ToString(); } lblServerNo.Text = PrjPub.ServerNo.ToString(); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (PrjPub.HasEditRight("微机教室信息") && PrjPub.IsServerCenter) { HfUpdateRight.Value = "True"; } else { HfUpdateRight.Value = "False"; } if (PrjPub.HasDeleteRight("微机教室信息") && PrjPub.IsServerCenter) { HfDeleteRight.Value = "True"; } else { HfDeleteRight.Value = "False"; } //string orgid = Request.QueryString["id"]; //initComputerRoomInfo(orgid); if (PrjPub.CurrentLoginUser == null) { Response.Redirect("../Common/Error.aspx?error=Session过期请重新登录本系统!"); return; } string strQuery = Request.QueryString.Get("strQuery"); if (string.IsNullOrEmpty(strQuery)) { GetSql(); } else { string[] str = strQuery.Split('|'); if (!string.IsNullOrEmpty(str[0])) { hfSelectOrg.Value = str[0]; OrganizationBLL orgbll = new OrganizationBLL(); txtOrg.Text = orgbll.GetOrganization(Convert.ToInt32(str[0])).ShortName; } txtCOMPUTER_ROOM.Text = str[1]; txtAddress.Text = str[2]; ddl.SelectedValue = str[3]; btnQuery_Click(null, null); } hfOrgID.Value = PrjPub.CurrentLoginUser.StationOrgID.ToString(); hfRoleID.Value = PrjPub.CurrentLoginUser.RoleID.ToString(); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (PrjPub.HasEditRight("考试监控")) { HfUpdateRight.Value = "True"; } else { HfUpdateRight.Value = "False"; } if (PrjPub.IsServerCenter) { hfOrgID.Value = PrjPub.CurrentLoginUser.StationOrgID.ToString(); if (PrjPub.CurrentLoginUser.IsAdmin && PrjPub.CurrentLoginUser.SuitRange == 1) { hfIsAdmin.Value = "True"; } else { hfIsAdmin.Value = "False"; } } else { hfOrgID.Value = ConfigurationManager.AppSettings["StationID"].ToString(); if ((PrjPub.CurrentLoginUser.IsAdmin && PrjPub.CurrentLoginUser.SuitRange == 1) || (PrjPub.CurrentLoginUser.IsAdmin && PrjPub.CurrentLoginUser.StationOrgID.ToString() == hfOrgID.Value)) { hfIsAdmin.Value = "True"; } else { hfIsAdmin.Value = "False"; } } hfServerNo.Value = PrjPub.ServerNo.ToString(); } string strRefresh = Request.Form.Get("Refresh"); if (strRefresh != null && strRefresh != "") { //RandomExamBLL objBll = new RandomExamBLL(); //IList<RailExam.Model.RandomExam> objList = objBll.GetControlRandomExamsInfo(SessionSet.OrganizationID); //examsGrid.DataSource = objList; examsGrid.DataBind(); } if (Request.Form.Get("StudentInfo") != null && Request.Form.Get("StudentInfo") != "") { DownloadStudentInfoExcel(Request.Form.Get("StudentInfo")); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack && !CallBack.IsCallback) { NavBarItem parentItem = null; if (PrjPub.CurrentLoginUser == null) { CallBack.RefreshInterval = 0; return; } hfEmployeeID.Value = PrjPub.CurrentLoginUser.EmployeeID.ToString(); foreach (FunctionRight functionRight in PrjPub.CurrentLoginUser.FunctionRights) { if (PrjPub.IsWuhan()) { if (functionRight.Function.FunctionID == "0406") { continue; } } if (functionRight.Right == 0) { continue; } NavBarItem item = new NavBarItem(); item.Text = functionRight.Function.MenuName; item.Expanded = functionRight.Function.IsDefault; if (functionRight.Function.FunctionID.Length == 2) { item.SelectedLookId = "TopItemLook"; item.SubGroupCssClass = "Level2Group"; item.DefaultSubItemLookId = "Level2ItemLook"; SystemMenu.Items.Add(item); parentItem = item; } else { if (parentItem != null) { item.ClientSideCommand = "goToUrl('" + functionRight.Function.PageUrl + "');"; //item.NavigateUrl = functionRight.Function.PageUrl; //item.Target = "ContentFrame"; parentItem.Items.Add(item); } } } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { BindGrid(); hfDelete.Value = PrjPub.HasDeleteRight("培训类别").ToString(); hfUpdate.Value = PrjPub.HasEditRight("培训类别").ToString(); } }
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"; } hfOrgID.Value = PrjPub.CurrentLoginUser.StationOrgID.ToString(); HfPaperCategoryId.Value = Request.QueryString.Get("id"); } if (IsPostBack) { string strDeleteID = Request.Form.Get("DeleteID"); if (!string.IsNullOrEmpty(strDeleteID)) { DeleteData(int.Parse(strDeleteID)); Grid1.DataBind(); } if (Request.Form.Get("Refresh") == "true") { Grid1.DataBind(); } if (Request.Form.Get("OutPut") != null && Request.Form.Get("OutPut") != "") { OutputData(Request.Form.Get("OutPut")); } if (Request.Form.Get("strategyID") != null && Request.Form.Get("strategyID") != "") { DeleteStrategyData(Request.Form.Get("strategyID")); Grid1.DataBind(); } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { hfRailSystemID.Value = PrjPub.GetRailSystemId().ToString(); hfOrgID.Value = PrjPub.CurrentLoginUser.StationOrgID.ToString(); HfExamCategoryId.Value = Request.QueryString.Get("id"); Grid1.DataBind(); } }
protected void grdEntity_RowDataBoundDataRow(object sender, GridViewRowEventArgs e) { HiddenField OrgIDs = (HiddenField)e.Row.FindControl("hidOrgID"); HiddenField UnitID = (HiddenField)e.Row.FindControl("hidUnitID"); HiddenField hidMaiUnitID = (HiddenField)e.Row.FindControl("hidMaiUnitID"); System.Web.UI.HtmlControls.HtmlGenericControl spanUp = (System.Web.UI.HtmlControls.HtmlGenericControl)e.Row.FindControl("spanUp"); //上报 System.Web.UI.HtmlControls.HtmlGenericControl addPlan = (System.Web.UI.HtmlControls.HtmlGenericControl)e.Row.FindControl("add"); //修改 System.Web.UI.HtmlControls.HtmlGenericControl spanView = (System.Web.UI.HtmlControls.HtmlGenericControl)e.Row.FindControl("spanView"); //查看 LinkButton delete = (LinkButton)e.Row.FindControl("btnDelete"); if (UnitID.Value.Equals(PrjPub.CurrentLoginUser.StationOrgID.ToString())) { spanView.Visible = true; addPlan.Visible = false; delete.Visible = false; } if (hidMaiUnitID.Value.Equals(PrjPub.CurrentLoginUser.StationOrgID.ToString())) { spanView.Visible = true; addPlan.Visible = true; delete.Visible = true; } else { addPlan.Visible = false; delete.Visible = false; } string[] arrOrgs = OrgIDs.Value.Split(','); foreach (string str in arrOrgs) { if (str.Equals(PrjPub.CurrentLoginUser.StationOrgID.ToString())) { spanUp.Visible = true; break; } else { spanUp.Visible = false; } } if (!(PrjPub.HasEditRight("培训计划") && PrjPub.IsServerCenter)) { addPlan.Visible = false; } if (!(PrjPub.HasDeleteRight("培训计划") && PrjPub.IsServerCenter)) { delete.Visible = false; } }
//站段树绑定 private void BindTree() { int railSystemID = PrjPub.GetRailSystemId(); OrganizationBLL organizationsBLL = new OrganizationBLL(); if (PrjPub.CurrentLoginUser.SuitRange == 1) { string strOwnIDs = string.Empty; if (railSystemID != 0) { IList <RailExam.Model.Organization> organizationList1 = organizationsBLL.GetOrganizations(PrjPub.CurrentLoginUser.StationOrgID); foreach (RailExam.Model.Organization organization in organizationList1) { strOwnIDs += strOwnIDs == string.Empty ? organization.OrganizationId.ToString() : "," + organization.OrganizationId; } } IList <RailExam.Model.Organization> organizations = organizationsBLL.GetOrganizationsByLevel(2); foreach (RailExam.Model.Organization organization in organizations) { if (organization.LevelNum == 1) { continue; } if ((organization.IdPath + "/").IndexOf("/1/") >= 0 && organization.LevelNum != 1 && railSystemID != 0 && railSystemID != organization.RailSystemID) { continue; } if (organization.LevelNum != 1 && strOwnIDs != string.Empty && (organization.IdPath + "/").IndexOf("/1/") < 0 && ("," + strOwnIDs + ",").IndexOf("," + organization.OrganizationId + ",") < 0) { continue; } TreeViewNode tvNode = new TreeViewNode(); tvNode.ID = organization.OrganizationId.ToString(); tvNode.Text = organization.ShortName; tvView.Nodes.Add(tvNode); } } else { TreeViewNode tvNode = new TreeViewNode(); tvNode.ID = PrjPub.CurrentLoginUser.StationOrgID.ToString(); tvNode.Text = organizationsBLL.GetOrganization(PrjPub.CurrentLoginUser.StationOrgID).ShortName; tvView.Nodes.Add(tvNode); } }
/// <summary> /// 记时 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void Callback1_Callback(object sender, CallBackEventArgs e) { if (PrjPub.IsWuhan()) { return; } if (string.IsNullOrEmpty(e.Parameters[0].ToString()) || string.IsNullOrEmpty(e.Parameters[1].ToString())) { return; } DateTime starttime; DateTime endtime; try { starttime = Convert.ToDateTime(e.Parameters[0]); endtime = Convert.ToDateTime(e.Parameters[1]); } catch { return; } TimeSpan ts = endtime.Subtract(starttime); int spanLoginTime = ts.Hours * 3600 + ts.Minutes * 60 + ts.Seconds; EmployeeBLL employeeBLL = new EmployeeBLL(); Employee employyee = employeeBLL.GetEmployee(Convert.ToInt32(e.Parameters[2])); int oldLogintime = employyee.LoginTime; employyee.LoginTime = oldLogintime + spanLoginTime; SystemUserBLL systemUserBLL = new SystemUserBLL(); SystemUser loginUser = systemUserBLL.GetUserByEmployeeID(Convert.ToInt32(e.Parameters[2])); SessionSet.UserID = loginUser.UserID; SessionSet.EmployeeID = loginUser.EmployeeID; SessionSet.EmployeeName = employyee.EmployeeName; SessionSet.OrganizationID = employyee.OrgID; SessionSet.OrganizationName = employyee.OrgName; if (PrjPub.IsServerCenter) { employeeBLL.UpdateEmployee(employyee); } else { employeeBLL.UpdateEmployeeInStation(employyee); } }
protected void btnLast_Click(object sender, ImageClickEventArgs e) { string strId = Request.QueryString.Get("id"); string strStartMode = ViewState["startmode"].ToString(); string strFlag = ""; if (ViewState["mode"].ToString() == "Insert") { strFlag = "Edit"; } else if (ViewState["mode"].ToString() == "Edit") { RandomExamResultBLL reBll = new RandomExamResultBLL(); IList <RailExam.Model.RandomExamResult> examResults = reBll.GetRandomExamResultByExamID(Convert.ToInt32(strId)); if (examResults.Count > 0) { strFlag = "ReadOnly"; } else { strFlag = ViewState["mode"].ToString(); } } else { strFlag = ViewState["mode"].ToString(); } if (PrjPub.IsWuhan()) { Response.Redirect("RandomExamManageThird.aspx?startmode=" + strStartMode + "&mode=" + strFlag + "&id=" + strId); } else { string strItemType = ""; RandomExamSubjectBLL objSubjectBll = new RandomExamSubjectBLL(); IList <RandomExamSubject> objSubjectList = objSubjectBll.GetRandomExamSubjectByRandomExamId(Convert.ToInt32(strId)); foreach (RandomExamSubject subject in objSubjectList) { if (strItemType == "") { strItemType = subject.ItemTypeId.ToString(); } else { strItemType = strItemType + "|" + subject.ItemTypeId; } } Response.Redirect("/RailExamBao/RandomExamOther/RandomExamStrategyInfo.aspx?startmode=" + strStartMode + "&mode=" + strFlag + "&itemType=" + strItemType + "&id=" + strId); } }