private void IniPage() { try { string unitCode = Request.QueryString["UnitCode"]; string fullCode = DAL.EntityDAO.OBSDAO.GetUnitFullCode(unitCode); this.txtStationCode.Value = Request.QueryString["StationCode"]; this.txthUnit.Value = unitCode; this.txtUnitName.Value = BLL.SystemRule.GetUnitName(unitCode); EntityData ds1 = OBSDAO.GetStandard_UnitByCode(unitCode); //this.rblRoleLevel.SelectedValue = ds1.GetString("UnitType"); EntityData units = DAL.EntityDAO.OBSDAO.GetAllUnit(); foreach (string tempCode in fullCode.Split(new char[] { '-' })) { if (tempCode != "") { DataRow[] drsSelect = units.CurrentTable.Select(String.Format("UnitCode='{0}'", tempCode)); if (drsSelect.Length > 0) { this.sltAccessRangeUnit.Items.Add(new ListItem((string)drsSelect[0]["UnitName"], (string)drsSelect[0]["UnitCode"])); } } } units.Dispose(); BLL.PageFacade.LoadAllRoleSelect(this.sltRole, ""); } catch (Exception ex) { ApplicationLog.WriteLog(this.ToString(), ex, ""); Response.Write(Rms.Web.JavaScript.Alert(true, "加载页面错误。")); } }
private void LoadData() { string unitCode = Request["UnitCode"] + ""; try { EntityData ds = OBSDAO.GetStandard_UnitByCode(unitCode); if (ds.HasRecord()) { this.lblSortID.Text = ds.GetString("SortID"); this.lblUnitType.Text = ds.GetString("UnitType"); this.lblName.Text = ds.GetString("UnitName"); this.lblPrincipal.Text = BLL.SystemRule.GetUserName(ds.GetString("Principal")); this.lblRemark.Text = ds.GetString("Remark"); //this.lblSubjectSet.Text = BLL.SubjectRule.GetSubjectSetName(ds.GetString("SubjectSetCode")); if (ds.GetInt("SelfAccount") == 1) { this.lblSelfAccount.Text = "独立核算"; } //显示财务编码 this.lblSubjectSetDesc.Text = BLL.FinanceRule.GetFinanceSubjectSetDesc(ds.Tables["UnitSubjectSet"]); if (ds.GetString("UnitType") == "项目") { this.btnDelete.Visible = false; //this.btnModify.Visible = false; //this.trToolBar.Style["display"] = "none"; btnModify.Attributes["onclick"] = "javascript:ModifyProject(" + ds.GetString("RelaCode") + ");return false;"; EntityData projectds = ProjectDAO.GetProjectByCode(ds.GetString("RelaCode")); this.lblSubjectSet.Text = BLL.SubjectRule.GetSubjectSetName(projectds.GetString("SubjectSetCode")); } else { //如果是部门则隐掉帐套 lblSubjectsettd.Visible = false; lblSelfAccount.Visible = false; lblSubjectSet.Visible = false; tdsubjectsetdesc.ColSpan = 3; } } ds.Dispose(); EntityData childUnit = DAL.EntityDAO.OBSDAO.GetOBSUnitByParent(unitCode); this.dgListChildUnit.DataSource = childUnit; this.dgListChildUnit.DataBind(); childUnit.Dispose(); EntityData station = DAL.EntityDAO.OBSDAO.GetStationByUnitCode(unitCode); station.CurrentTable.Columns.Add("RoleLevelName"); int iCount = station.CurrentTable.Rows.Count; for (int i = 0; i < iCount; i++) { station.SetCurrentRow(i); int roleLevel = station.GetInt("RoleLevel"); station.CurrentRow["RoleLevelName"] = BLL.SystemRule.GetRoleLevelName(roleLevel); } this.dgConfig.DataSource = station; this.dgConfig.DataBind(); station.Dispose(); } catch (Exception ex) { ApplicationLog.WriteLog(this.ToString(), ex, ""); Response.Write(Rms.Web.JavaScript.Alert(true, "显示出错:" + ex.Message)); } }
private void LoadData() { string stationCode = txtStationCode.Value; string unitCode = this.txthUnit.Value; try { bool isNew = (stationCode == ""); EntityData ds = null; if (isNew) { ds = new EntityData("Standard_Station"); DataRow dr = ds.GetNewRecord(); dr["StationCode"] = DAL.EntityDAO.SystemManageDAO.GetNewSysCode("StationCode"); dr["UnitCode"] = this.txthUnit.Value; ds.AddNewRecord(dr); ds.SetCurrentRow(0); } else { ds = OBSDAO.GetStandard_StationByCode(stationCode); } //ds = OBSDAO.GetStandard_UnitByCode(unitCode); EntityData ds1 = OBSDAO.GetStandard_UnitByCode(unitCode); if (ds.HasRecord()) { this.txtStationName.Text = ds.GetString("StationName"); this.txtDescription.Text = ds.GetString("Description"); this.txthUnit.Value = ds.GetString("UnitCode"); try { switch (ds1.GetString("UnitType")) { case "项目": rblRoleLevel.SelectedValue = "0"; break; case "部门": rblRoleLevel.SelectedValue = "3"; break; default: rblRoleLevel.SelectedValue = "4"; break; } //this.rblRoleLevel.SelectedValue = ds.GetInt("RoleLevel").ToString(); //修改前 } catch {} sltAccessRangeUnit.Value = unitCode; this.sltRole.Value = ds.GetString("RoleCode"); this.sltAccessRangeUnit.Value = ds.GetString("AccessRangeUnitCode"); } this.txtUnitName.Value = BLL.SystemRule.GetUnitName(this.txthUnit.Value); //记录当前的用户代码 this.txtReturnUserCodes.Value = BLL.ConvertRule.Concat(ds.Tables["UserRole"], "UserCode", ","); this.dgList.DataSource = ds.Tables["UserRole"]; this.dgList.DataBind(); Session["StationEntityData"] = ds; ds.Dispose(); } catch (Exception ex) { ApplicationLog.WriteLog(this.ToString(), ex, ""); Response.Write(Rms.Web.JavaScript.Alert(true, "加载页面错误。")); } }