protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { OrganizationBLL objOrgBll = new OrganizationBLL(); IList <RailExam.Model.Organization> objOrgList = objOrgBll.GetOrganizationsByLevel(2); ListItem item = new ListItem(); item.Text = "--请选择--"; item.Value = "0"; ddlOrg.Items.Add(item); foreach (Organization organization in objOrgList) { if (organization.OrganizationId != 1) { item = new ListItem(); item.Text = organization.ShortName; item.Value = organization.OrganizationId.ToString(); ddlOrg.Items.Add(item); } } if (!PrjPub.IsServerCenter) { OrgConfigBLL orgConfigBLL = new OrgConfigBLL(); ddlOrg.SelectedValue = orgConfigBLL.GetOrgConfig().OrgID.ToString(); txtUserName.Focus(); } } }
private void BindOrgTree(string selectId) { OrganizationBLL organizationsBLL = new OrganizationBLL(); if (PrjPub.CurrentLoginUser.SuitRange == 1) { IList <RailExam.Model.Organization> organizations = organizationsBLL.GetOrganizationsByLevel(2); foreach (RailExam.Model.Organization organization in organizations) { if (organization.LevelNum == 1) { 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); } }
//站段树绑定 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); } }
protected void Page_Load(object sender, EventArgs e) { if (PrjPub.CurrentLoginUser == null) { Response.Redirect("/RailExamBao/Common/Error.aspx?error=Session过期请重新登录本系统!"); return; } hfNowEmployeeID.Value = PrjPub.CurrentLoginUser.EmployeeID.ToString(); if (!string.IsNullOrEmpty(hfEmployeeID.Value)) { EmployeeBLL objEmployeeBll = new EmployeeBLL(); string[] strID = hfEmployeeID.Value.Split(','); string strName = string.Empty; for (int i = 0; i < strID.Length; i++) { RailExam.Model.Employee objEmployee = objEmployeeBll.GetEmployee(Convert.ToInt32(strID[i])); if (strName == string.Empty) { strName = objEmployee.EmployeeName; } else { strName = strName + "," + objEmployee.EmployeeName; } } txtEmployee.Text = strName; } if (!IsPostBack) { ddlOrg.Items.Clear(); OrganizationBLL organizationBLL = new OrganizationBLL(); IList <RailExam.Model.Organization> organizationList = organizationBLL.GetOrganizationsByLevel(2); foreach (RailExam.Model.Organization organization in organizationList) { if (organization.OrganizationId != 1 && organization.OrganizationId != PrjPub.CurrentLoginUser.StationOrgID) { ListItem item = new ListItem(); item.Value = organization.OrganizationId.ToString(); item.Text = organization.ShortName; ddlOrg.Items.Add(item); } } } }
private void BindListBox() { OrgList.Items.Clear(); OrganizationBLL objBll = new OrganizationBLL(); IList <RailExam.Model.Organization> objList = objBll.GetOrganizationsByLevel(2); foreach (RailExam.Model.Organization organization in objList) { if (organization.LevelNum != 1) { ListItem item = new ListItem(); item.Text = organization.ShortName; item.Value = organization.OrganizationId.ToString(); OrgList.Items.Add(item); } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { //RefreshSnapShotBLL objBll = new RefreshSnapShotBLL(); //objBll.RefreshOrg(1); OrganizationBLL objOrgBll = new OrganizationBLL(); IList <RailExam.Model.Organization> objOrgList = objOrgBll.GetOrganizationsByLevel(2); foreach (Organization organization in objOrgList) { if (organization.OrganizationId != 1 && organization.OrganizationId != 32 && organization.OrganizationId != 200) { ListItem item = new ListItem(); item.Text = organization.ShortName; item.Value = organization.OrganizationId.ToString(); ddlOrg.Items.Add(item); } } } }
private void BindItemCategoryTree() { OrganizationBLL organizationsBLL = new OrganizationBLL(); IList <RailExam.Model.Organization> organizations = organizationsBLL.GetOrganizationsByLevel(2); IList <RailExam.Model.Organization> organizationsnew = new List <Organization>(); foreach (Organization organization in organizations) { if (organization.LevelNum == 2) { organizationsnew.Add(organization); } } if (organizationsnew.Count > 0) { TreeViewNode tvn = null; foreach (Organization organization in organizationsnew) { tvn = new TreeViewNode(); tvn.ID = organization.OrganizationId.ToString(); tvn.Value = organization.OrganizationId.ToString(); tvn.Text = organization.ShortName; tvn.ToolTip = organization.FullName; tvOrganization.Nodes.Add(tvn); } } tvOrganization.DataBind(); if (tvOrganization.Nodes.Count > 0) { tvOrganization.Nodes[0].Expanded = true; } }
private void BindStationStart() { ddlStation.Items.Clear(); OrganizationBLL organizationBLL = new OrganizationBLL(); ListItem i = new ListItem(); i.Text = "--ÇëÑ¡Ôñ--"; i.Value = "0"; ddlStation.Items.Add(i); IList <RailExam.Model.Organization> organizationList = organizationBLL.GetOrganizationsByLevel(2); foreach (RailExam.Model.Organization organization in organizationList) { if (organization.OrganizationId != 1) { ListItem item = new ListItem(); item.Value = organization.OrganizationId.ToString(); item.Text = organization.ShortName; ddlStation.Items.Add(item); } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { OrganizationBLL objOrgBll = new OrganizationBLL(); IList <RailExam.Model.Organization> objOrgList = objOrgBll.GetOrganizationsByLevel(2); ListItem item = new ListItem(); item.Text = "--ÇëÑ¡Ôñ--"; item.Value = "0"; ddlOrg.Items.Add(item); foreach (Organization organization in objOrgList) { if (organization.OrganizationId != 1 && organization.OrganizationId != 200) { item = new ListItem(); item.Text = organization.ShortName; item.Value = organization.OrganizationId.ToString(); ddlOrg.Items.Add(item); } } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { //if (PrjPub.IsServerCenter && PrjPub.CurrentLoginUser.SuitRange != 1) //{ // HfUpdateRight.Value = "False"; // HfDeleteRight.Value = "False"; //} //else //{ // HfUpdateRight.Value = PrjPub.HasEditRight("新增考试").ToString(); // HfDeleteRight.Value = PrjPub.HasDeleteRight("新增考试").ToString(); //} hfRailSystemID.Value = PrjPub.GetRailSystemId().ToString(); if (PrjPub.CurrentLoginUser == null) { Response.Redirect("/RailExamBao/Common/Error.aspx?error=Session过期请重新登录本系统!"); return; } if (PrjPub.CurrentLoginUser.IsAdmin && PrjPub.CurrentLoginUser.UseType == 0) { hfIsAdmin.Value = "True"; } else { hfIsAdmin.Value = "False"; } if (PrjPub.HasEditRight("新增考试") && PrjPub.IsServerCenter) { HfUpdateRight.Value = "True"; } else { HfUpdateRight.Value = "False"; } if (PrjPub.HasDeleteRight("新增考试") && PrjPub.IsServerCenter) { HfDeleteRight.Value = "True"; } else { HfDeleteRight.Value = "False"; } ListItem item = new ListItem(); item.Value = Session["StationOrgID"].ToString(); item.Text = "--请选择--"; ddlOrg.Items.Add(item); if (PrjPub.IsServerCenter && PrjPub.CurrentLoginUser.UseType == 0 && PrjPub.CurrentLoginUser.IsAdmin) { ddlOrg.Visible = true; lblOrg.Visible = true; OrganizationBLL objOrgBll = new OrganizationBLL(); IList <Organization> objList = objOrgBll.GetOrganizationsByLevel(2); foreach (Organization organization in objList) { ListItem litem = new ListItem(); litem.Value = organization.OrganizationId.ToString(); litem.Text = organization.ShortName; ddlOrg.Items.Add(litem); } } else { ddlOrg.Visible = false; lblOrg.Visible = false; } hfOrgID.Value = PrjPub.CurrentLoginUser.StationOrgID.ToString(); HfExamCategoryId.Value = Request.QueryString.Get("id"); Grid1.DataBind(); } else { string strDeleteID = Request.Form.Get("DeleteID"); if (!string.IsNullOrEmpty(strDeleteID)) { //RandomExamResultBLL reBll = new RandomExamResultBLL(); //IList<RailExam.Model.RandomExamResult> examResults = reBll.GetRandomExamResultByExamID(int.Parse(strDeleteID)); //if (examResults.Count > 0) //{ // SessionSet.PageMessage = "已有考生参加考试,该考试不能被删除!"; // Grid1.DataBind(); // return; //} DeleteData(int.Parse(strDeleteID)); Grid1.DataBind(); } if (Request.Form.Get("Refresh") == "true") { Grid1.DataBind(); } if (Request.Form.Get("OutPut") != null && Request.Form.Get("OutPut") != string.Empty) { OutputWord(Request.Form.Get("OutPut")); } if (Request.Form.Get("ResetID") != null && Request.Form.Get("ResetID") != string.Empty) { Grid1.DataBind(); } if (Request.Form.Get("arrangeID") != null && Request.Form.Get("arrangeID") != string.Empty) { string strId = Request.Form.Get("arrangeID"); RandomExamBLL objBll = new RandomExamBLL(); RailExam.Model.RandomExam objExam = objBll.GetExam(Convert.ToInt32(strId)); //if(objExam.HasPaper) //{ // SessionSet.PageMessage = "该考试已经生成试卷,不能重新安排微机教室!"; // Grid1.DataBind(); // return; //} if (!PrjPub.IsServerCenter) { Grid1.DataBind(); return; } if (PrjPub.CurrentLoginUser.RoleID != 1) { OracleAccess db = new OracleAccess(); RandomExamArrangeBLL arrangeBll = new RandomExamArrangeBLL(); IList <RandomExamArrange> arrangeList = arrangeBll.GetRandomExamArranges(Convert.ToInt32(strId)); if (arrangeList.Count == 0) { SessionSet.PageMessage = "该考试还未选择考生,不能安排微机教室!"; Grid1.DataBind(); return; } RandomExamArrange arrange = arrangeList[0]; bool hasOrg = false; string[] str = arrange.UserIds.Split(','); EmployeeBLL employeebll = new EmployeeBLL(); OrganizationBLL orgBll = new OrganizationBLL(); for (int i = 0; i < str.Length; i++) { Employee obj = employeebll.GetEmployee(Convert.ToInt32(str[i])); if (orgBll.GetStationOrgID(obj.OrgID) == PrjPub.CurrentLoginUser.StationOrgID) { hasOrg = true; break; } } if (!hasOrg) { SessionSet.PageMessage = "该考试没有本站段考生,无须安排微机教室!"; Grid1.DataBind(); return; } } Grid1.DataBind(); ClientScript.RegisterStartupScript(GetType(), "jsSelectFirstNode", @"showArrange(" + strId + ");", true); } } }
private void BindOrganizationTree(ArrayList orgidAL) { OrganizationBLL organizationBLL = new OrganizationBLL(); IList <Organization> organizationList = new List <Organization>(); if (PrjPub.CurrentLoginUser.SuitRange == 1) { organizationList = organizationBLL.GetOrganizationsByLevel(2); } else { //if (string.IsNullOrEmpty(Request.QueryString.Get("id"))) //{ // organizationList = organizationBLL.GetOrganizations(PrjPub.CurrentLoginUser.StationOrgID); //} //else //{ // string strSql = "select a.* from (" // + "select b.Org_ID,b.Level_Num,b.Order_Index from Book_Range_Org a " // + "inner join Org b on a.Org_ID=b.Org_ID " // + " where Book_ID=" + Request.QueryString.Get("id") // + " and GetStationOrgID(a.org_id) <> " + PrjPub.CurrentLoginUser.StationOrgID // + " union " // + " select Org_ID,Level_Num,Order_Index " // + " from Org where GetStationOrgID(org_id)=" + PrjPub.CurrentLoginUser.StationOrgID // + ") a order by Level_Num,Order_Index"; // OracleAccess db = new OracleAccess(); // DataSet ds = db.RunSqlDataSet(strSql); // foreach (DataRow dr in ds.Tables[0].Rows) // { // Organization organization = organizationBLL.GetOrganization(Convert.ToInt32(dr["Org_ID"])); // organizationList.Add(organization); // } //} //string strSql = "select Org_ID,Level_Num,Order_Index from Org where Rail_System_ID=" + // PrjPub.CurrentLoginUser.RailSystemID + " and level_num=2 order by Level_Num,Order_Index"; string strSql = "select Org_ID,Level_Num,Order_Index from Org where Org_ID=" + PrjPub.CurrentLoginUser.StationOrgID; OracleAccess db = new OracleAccess(); DataSet ds = db.RunSqlDataSet(strSql); foreach (DataRow dr in ds.Tables[0].Rows) { Organization organization = organizationBLL.GetOrganization(Convert.ToInt32(dr["Org_ID"])); organizationList.Add(organization); } } if (organizationList.Count > 0) { TreeViewNode tvn = null; foreach (Organization organization in organizationList) { if (!organization.IsEffect) { continue; } tvn = new TreeViewNode(); tvn.ID = organization.OrganizationId.ToString(); tvn.Value = organization.OrganizationId.ToString(); tvn.Text = organization.ShortName; tvn.ToolTip = organization.FullName; tvn.ShowCheckBox = true; if (orgidAL.Count > 0) { if (orgidAL.IndexOf(organization.OrganizationId) != -1) { tvn.Checked = true; } } if (PrjPub.CurrentLoginUser.SuitRange == 1) { if (organization.ParentId == 0) { tvOrg.Nodes.Add(tvn); } else { try { tvOrg.FindNodeById(organization.ParentId.ToString()).Nodes.Add(tvn); } catch { tvOrg.Nodes.Clear(); SessionSet.PageMessage = "数据错误!"; return; } } } else { if (organization.ParentId == 1) { tvOrg.Nodes.Add(tvn); } else { try { tvOrg.FindNodeById(organization.ParentId.ToString()).Nodes.Add(tvn); } catch { tvOrg.Nodes.Clear(); SessionSet.PageMessage = "数据错误!"; return; } } } } } tvOrg.DataBind(); //tvOrg.ExpandAll(); if (tvOrg.Nodes.Count > 0) { tvOrg.Nodes[0].Expanded = true; } }
private void BindOrgTree() { OrganizationBLL organizationBLL = new OrganizationBLL(); int railSystemID = PrjPub.GetRailSystemId(); if ((PrjPub.CurrentLoginUser.SuitRange == 1 || railSystemID != 0) && PrjPub.IsServerCenter) { IList <RailExam.Model.Organization> organizationList = organizationBLL.GetOrganizationsByLevel(2); string strOwnIDs = string.Empty; if (railSystemID != 0) { IList <RailExam.Model.Organization> organizationList1 = organizationBLL.GetOrganizations(PrjPub.CurrentLoginUser.StationOrgID); foreach (RailExam.Model.Organization organization in organizationList1) { strOwnIDs += strOwnIDs == string.Empty ? organization.OrganizationId.ToString() : "," + organization.OrganizationId; } } if (organizationList.Count > 0) { TreeViewNode tvn = null; foreach (Organization organization in organizationList) { 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; } tvn = new TreeViewNode(); tvn.ID = organization.OrganizationId.ToString(); tvn.Value = organization.OrganizationId.ToString(); tvn.Text = organization.ShortName; tvn.ToolTip = organization.FullName; if (organization.ParentId == 0) { tvView.Nodes.Add(tvn); } else { try { tvView.FindNodeById(organization.ParentId.ToString()).Nodes.Add(tvn); } catch { tvView.Nodes.Clear(); SessionSet.PageMessage = "Êý¾Ý´íÎó£¡"; return; } } } } if (tvView.Nodes.Count > 0) { tvView.Nodes[0].Expanded = true; } } else { string strOrgID; if (PrjPub.IsServerCenter) { strOrgID = PrjPub.CurrentLoginUser.StationOrgID.ToString(); } else { strOrgID = ConfigurationManager.AppSettings["StationID"].ToString(); } int stationID = organizationBLL.GetStationOrgID(Convert.ToInt32(strOrgID)); RailExam.Model.Organization organization = organizationBLL.GetOrganization(stationID); TreeViewNode tvn = null; tvn = new TreeViewNode(); tvn.ID = organization.OrganizationId.ToString(); tvn.Value = organization.IdPath.ToString(); tvn.Text = organization.ShortName; tvn.ToolTip = organization.FullName; tvView.Nodes.Add(tvn); } tvView.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { //if (PrjPub.IsWuhan()) //{ // Grid1.Columns[3].HeaderText = "员工编码"; // lblTitle.Text = "员工编码"; //} //else //{ // Grid1.Columns[3].HeaderText = "工资编号"; // lblTitle.Text = "工资编号"; //} lblTitle.Text = "员工编码"; BindEmptyGrid1(); string strId = Request.QueryString.Get("id"); if (strId != null && strId != "") { RandomExamArrangeBLL eaBll = new RandomExamArrangeBLL(); IList <RailExam.Model.RandomExamArrange> ExamArranges = eaBll.GetRandomExamArranges(int.Parse(strId)); if (ExamArranges.Count > 0) { ViewState["UpdateMode"] = 1; } else { ViewState["UpdateMode"] = 0; } } OrganizationBLL objOrgBll = new OrganizationBLL(); IList <RailExam.Model.Organization> objOrgList = objOrgBll.GetOrganizationsByLevel(2); ListItem item = new ListItem(); item.Text = "--请选择--"; item.Value = "0"; ddlOrg.Items.Add(item); foreach (Organization organization in objOrgList) { if (organization.OrganizationId != 1) { item = new ListItem(); item.Text = organization.ShortName; item.Value = organization.OrganizationId.ToString(); ddlOrg.Items.Add(item); } } string strType = Request.QueryString.Get("type"); if (strType != null && strType != "") { btnOK.Visible = true; btnClose.Visible = true; btnInput.Visible = false; ViewState["title"] = "选择学员"; if (PrjPub.CurrentLoginUser.SuitRange == 0) { ddlOrg.SelectedValue = PrjPub.CurrentLoginUser.StationOrgID.ToString(); ddlOrg.Enabled = false; } } else { btnOK.Visible = false; btnClose.Visible = true; btnInput.Visible = true; ViewState["title"] = "单个添加考生"; } ViewState["StartRow"] = 0; ViewState["EndRow"] = Grid1.PageSize; ViewState["EmploySortField"] = "nlssort(a.employee_name,'NLS_SORT=SCHINESE_PINYIN_M')"; } }
private void BindItemCategoryTree() { OrganizationBLL organizationsBLL = new OrganizationBLL(); int railSystemID = 0; string strOwnIDs = string.Empty; if (PrjPub.CurrentLoginUser != null || PrjPub.CurrentStudent != null) { railSystemID = PrjPub.GetRailSystemId(); 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; } } } if (Request.QueryString.Get("Type") == "Station") { IList <RailExam.Model.Organization> organizations = organizationsBLL.GetOrganizationsByLevel(2); foreach (RailExam.Model.Organization organization in organizations) { if (!organization.IsEffect) { continue; } 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; tvOrganization.Nodes.Add(tvNode); } } else if (Request.QueryString.Get("Type") == "Online") { IList <RailExam.Model.Organization> organizations = organizationsBLL.GetOrganizations(); IList <RailExam.Model.Organization> organizationList = new List <Organization>(); foreach (Organization organization in organizations) { if (!organization.IsEffect) { continue; } organizationList.Add(organization); } Pub.BuildComponentArtTreeView(tvOrganization, (IList)organizationList, "OrganizationId", "ParentId", "ShortName", "FullName", "OrganizationId", null, null, null); } else { if (PrjPub.IsServerCenter && PrjPub.CurrentLoginUser.SuitRange == 1) { IList <RailExam.Model.Organization> organizations = organizationsBLL.GetOrganizations(); foreach (RailExam.Model.Organization organization in organizations) { if (!organization.IsEffect) { continue; } if (organization.LevelNum != 1) { if ((organization.IdPath + "/").IndexOf("/1/") >= 0 && railSystemID != 0 && railSystemID != organization.RailSystemID) { continue; } if (strOwnIDs != string.Empty && (organization.IdPath + "/").IndexOf("/1/") < 0 && ("," + strOwnIDs + ",").IndexOf("," + organization.OrganizationId + ",") < 0) { continue; } } TreeViewNode tvn = new TreeViewNode(); tvn.ID = organization.OrganizationId.ToString(); tvn.Value = organization.OrganizationId.ToString(); tvn.Text = organization.ShortName; tvn.ToolTip = organization.FullName; if (organization.ParentId == 0) { tvn.Expanded = true; tvOrganization.Nodes.Add(tvn); continue; } try { tvOrganization.FindNodeById(organization.ParentId.ToString()).Nodes.Add(tvn); } catch { tvOrganization.Nodes.Clear(); SessionSet.PageMessage = "数据错误!"; return; } } } else { string strOrgID; if (PrjPub.IsServerCenter) { if (!string.IsNullOrEmpty(Request.QueryString.Get("OrgID"))) { strOrgID = Request.QueryString.Get("OrgID"); } else { strOrgID = PrjPub.CurrentLoginUser.StationOrgID.ToString(); } } else { strOrgID = ConfigurationManager.AppSettings["StationID"].ToString(); } int stationID = organizationsBLL.GetStationOrgID(Convert.ToInt32(strOrgID)); IList <RailExam.Model.Organization> organizationList = organizationsBLL.GetOrganizations(stationID); if (organizationList.Count > 0) { TreeViewNode tvn = null; foreach (RailExam.Model.Organization organization in organizationList) { if (!organization.IsEffect) { continue; } tvn = new TreeViewNode(); tvn.ID = organization.OrganizationId.ToString(); tvn.Value = organization.IdPath.ToString(); tvn.Text = organization.ShortName; tvn.ToolTip = organization.FullName; if (organization.ParentId == 1) { tvOrganization.Nodes.Add(tvn); } else { try { tvOrganization.FindNodeById(organization.ParentId.ToString()).Nodes.Add(tvn); } catch { tvOrganization.Nodes.Clear(); SessionSet.PageMessage = "数据错误!"; return; } } } } tvOrganization.DataBind(); } if (tvOrganization.Nodes.Count > 0) { tvOrganization.Nodes[0].Expanded = true; } } if (tvOrganization.Nodes.Count > 0) { tvOrganization.Nodes[0].Expanded = true; } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (!(PrjPub.HasEditRight("微机教室信息") && PrjPub.IsServerCenter)) { btnSave.Enabled = false; } ViewState["ComputerDetailType"] = Request.QueryString.Get("Type"); //0--预览,1--编辑,2--新增 ViewState["ComputerDetailID"] = Request.QueryString.Get("ID"); //if (!string.IsNullOrEmpty(Request.QueryString.Get("OrgID"))) //{ // ddlSelectOrg.SelectedValue = Request.QueryString.Get("OrgID"); //} OrganizationBLL orgBll = new OrganizationBLL(); IList <Organization> orgList = orgBll.GetOrganizationsByLevel(2); foreach (Organization organization in orgList) { if (organization.LevelNum == 2) { ListItem item = new ListItem(); item.Text = organization.ShortName; item.Value = organization.OrganizationId.ToString(); ddlSelectOrg.Items.Add(item); } } ddlSelectOrg.SelectedValue = PrjPub.CurrentLoginUser.StationOrgID.ToString(); int typeBool = 0; if (!string.IsNullOrEmpty(ViewState["ComputerDetailType"].ToString())) { typeBool = int.Parse(ViewState["ComputerDetailType"].ToString()); setReadOnlyControl(typeBool == 0 ? true : false); } //新增 if (typeBool == 2) { string orgID = PrjPub.CurrentLoginUser.StationOrgID.ToString(); dropServerBind(orgID); DataSet orgDs; OracleAccess ora = new OracleAccess(); orgDs = ora.RunSqlDataSet("select SHORT_NAME from org where LEVEL_NUM =2 and org_ID = " + orgID); if (orgDs.Tables.Count > 0) { if (orgDs.Tables[0].Rows.Count > 0) { txtORG.Text = getEntityString(orgDs.Tables[0].Rows[0][0]); hfOrgID.Value = orgID; hfOrgName.Value = orgDs.Tables[0].Rows[0]["Short_Name"].ToString(); } } ddlIS_EFFECT.SelectedValue = "1"; } string strSql = ""; if (ViewState["ComputerDetailID"] != null) { if (!string.IsNullOrEmpty(ViewState["ComputerDetailID"].ToString())) { DataSet orgDs; OracleAccess ora = new OracleAccess(); strSql = "select b.SHORT_NAME,a.ORG_ID, a.COMPUTER_ROOM_NAME,a.ADDRESS,a.COMPUTER_NUMBER," + "a.BAD_SEAT,a.IS_EFFECT,a.COMPUTER_SERVER_ID,a.CONTRACT_PERSON,a.CONTRACT_PHONE " + " from Computer_room a " + " inner join org b on a.org_ID = b.org_id " + " where computer_room_ID =" + ViewState["ComputerDetailID"]; orgDs = ora.RunSqlDataSet(strSql); if (orgDs.Tables.Count > 0) { loadData(orgDs.Tables[0]); } } } } else { txtORG.Text = hfOrgName.Value; } //string strRefresh = Request.Form.Get("Refresh"); if (ViewState["StrBad_SEAT"] != null) { txtBAD_SEAT.Text = ViewState["StrBad_SEAT"].ToString(); } txtBAD_SEAT.ReadOnly = true; }