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) { 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); } } }
protected void ddlWorkShop_SelectedIndexChanged(object sender, EventArgs e) { if (ddlWorkShop.SelectedValue == "0") { BindOrgStart(); } else { BindOrgStart(); OrganizationBLL objBll = new OrganizationBLL(); IList <RailExam.Model.Organization> objList = objBll.GetOrganizationsByParentID(Convert.ToInt32(ddlWorkShop.SelectedValue)); foreach (RailExam.Model.Organization organization in objList) { ListItem item = new ListItem(); item.Value = organization.OrganizationId.ToString(); item.Text = organization.ShortName; ddlOrg.Items.Add(item); } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { ButtonInputAll.Attributes.Add("onclick", "return confirm('加入上面列表显示的全部考生可能需要较长时间,您确认吗 ?');"); if (!string.IsNullOrEmpty(Request.QueryString.Get("selectType"))) { ButtonInputAll.Visible = false; } string strId = Request.QueryString.Get("id"); ViewState["ExamID"] = strId; if (strId != null && strId != "") { RandomExamArrangeBLL eaBll = new RandomExamArrangeBLL(); IList <RailExam.Model.RandomExamArrange> ExamArranges = eaBll.GetRandomExamArranges(int.Parse(strId)); if (ExamArranges.Count > 0) { ViewState["ChooseId"] = ExamArranges[0].UserIds; ViewState["UpdateMode"] = 1; } else { ViewState["ChooseId"] = ""; ViewState["UpdateMode"] = 0; } } BindStationStart(); BindOrgStart(); BindWorkShopStart(); BindSystemStart(); BindTypeStart(); BindPostStart(); ListItem item = new ListItem(); item.Text = "--请选择--"; item.Value = "-1"; ddlSafe.Items.Add(item); OracleAccess db = new OracleAccess(); string strSql = "select * from ZJ_Safe_Level order by Order_Index"; DataSet ds = db.RunSqlDataSet(strSql); foreach (DataRow dr in ds.Tables[0].Rows) { item = new ListItem(); item.Text = dr["Safe_Level_Name"].ToString(); item.Value = dr["Safe_Level_ID"].ToString(); ddlSafe.Items.Add(item); } if (PrjPub.CurrentLoginUser.SuitRange != 1) { ddlStation.SelectedValue = PrjPub.CurrentLoginUser.StationOrgID.ToString(); OrganizationBLL objBll = new OrganizationBLL(); IList <Organization> objList = objBll.GetOrganizationsByParentID(Convert.ToInt32(ddlStation.SelectedValue)); foreach (Organization organization in objList) { item = new ListItem(); item.Value = organization.OrganizationId.ToString(); item.Text = organization.ShortName; ddlWorkShop.Items.Add(item); } } ViewState["StartRow"] = 0; ViewState["EndRow"] = Grid1.PageSize; ViewState["EmploySortField"] = "nlssort(a.employee_name,'NLS_SORT=SCHINESE_PINYIN_M')"; RecordCount = GetCount(); //计算总页数(加上OverPage()函数防止有余数造成显示数据不完整) PageCount = RecordCount / Grid1.PageSize + OverPage(); ViewState["RecordCount"] = RecordCount; //保存总页参数到ViewState(减去ModPage()函数防止SQL语句执行时溢出查询范围,可以用存储过程分页算法来理解这句) ViewState["PageCounts"] = RecordCount / Grid1.PageSize - ModPage(); //保存一个为0的页面索引值到ViewState ViewState["PageIndex"] = 0; //保存PageCount到ViewState,跳页时判断用户输入数是否超出页码范围 ViewState["JumpPages"] = PageCount; //显示LPageCount、LRecordCount的状态 this.lbPageCount.Text = PageCount.ToString(); this.lbRecordCount.Text = RecordCount.ToString(); //判断跳页文本框失效 if (RecordCount <= Grid1.PageSize) { btnJumpPage.Enabled = false; } else { btnJumpPage.Enabled = true; } BindGrid(ViewState["EmploySortField"].ToString()); } }