protected void ImageButtonLogin_Click(object sender, ImageClickEventArgs e) { OrgConfigBLL orgConfigBLL = new OrgConfigBLL(); OrgConfig orgConfig = orgConfigBLL.GetOrgConfig(); if (ddlOrg.SelectedValue != orgConfig.OrgID.ToString()) { SessionSet.PageMessage = "当前所选单位与数据库中标识单位不一致,请核对后重新选择!"; return; } System.Xml.XmlDocument doc = new System.Xml.XmlDocument(); doc.Load(Server.MapPath("web.config")); System.Xml.XmlNode node; node = doc.SelectSingleNode("//appSettings/add[@key='StationID']"); node.Attributes["value"].Value = ddlOrg.SelectedValue; doc.Save(Server.MapPath("web.config")); if (Request.QueryString.Get("Type") == "teacher") { Response.Redirect("LoginTeacher.aspx"); } else { Response.Redirect("Login.aspx"); } }
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(); } } }
public static void Start() { if (PrjPub.IsCreateSnapShot()) { RefreshData(null, null); } if (_timer == null) { OrgConfigBLL objBll = new OrgConfigBLL(); RailExam.Model.OrgConfig obj = objBll.GetOrgConfig(); long timer = obj.Hour * 60 * 60 * 1000; //long timer = obj.Hour*60*1000; _timer = new System.Timers.Timer(timer); _timer.Elapsed += new ElapsedEventHandler(RefreshData); _timer.AutoReset = true; _timer.Enabled = true; } }