コード例 #1
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            // this page just refreshed to save permissions, now hide the layer
            if (Request.QueryString["hide"] != null && Request.QueryString["hide"].Equals("true"))
            {
                this.HideMe();
            }
            else if (Page.IsPostBack)
            {
                SetCredentials();
            }
            // on page load remove current user from session
            else if (!Page.IsPostBack)
            {
                UserController uct = new UserController();
                uct.LogoutUser();

                Session.Remove(SessionKey.LoginId);
                Session.Remove(SessionKey.GroupViewCode);
                //Session.Remove(SessionKey.UserPurpose);
                //Session.Remove(SessionKey.DatasetId);

                FormsAuthentication.SignOut();

                Response.Cookies["dsPerms"].Expires = new DateTime(2005, 1, 1);              //set date in past to remove cookie

                // get users with edit eform rights
                UserDa da = new UserDa();

                int dsId = Convert.ToInt32(Session[SessionKey.DatasetId].ToString());

                DataSet  ds = da.GetUsersWithPermission(dsId, PermissionManager.EFormEdit);
                DataView dv = ds.Tables[0].DefaultView;
                dv.Sort = "UserName";
                ClinicUsers.DataSource     = dv;
                ClinicUsers.DataValueField = "UserName";
                ClinicUsers.DataTextField  = "UserName";
                ClinicUsers.DataBind();
            }
        }