Ejemplo n.º 1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     lock (Database.lockObjectDB)
     {
         string defPwd = (String.IsNullOrEmpty(ConfigurationManager.AppSettings["DefaultUserPwd"])) ? "321" : ConfigurationManager.AppSettings["DefaultUserPwd"];
         ((TextBox)NewUserWizard.CreateUserStep.ContentTemplateContainer.FindControl("Password")).Text        = defPwd;
         ((TextBox)NewUserWizard.CreateUserStep.ContentTemplateContainer.FindControl("ConfirmPassword")).Text = defPwd;
         ServiceClass sc = new ServiceClass();
         if (!sc.UserAction(User.Identity.Name, Restrictions.UserRolesEdit))
         {
             Response.Redirect("~\\Account\\Restricted.aspx", true);
         }
         if (IsPostBack)
         {
             return;
         }
         NewUserWizard.RequireEmail = false;
         DataSet ds = new DataSet();
         Database.ExecuteQuery("select id, department from Branchs order by department", ref ds, null);
         DropDownList ddl = (DropDownList)NewUserWizard.CreateUserStep.ContentTemplateContainer.FindControl("BranchDDL");
         ddl.DataSource     = ds.Tables[0];
         ddl.DataTextField  = "department";
         ddl.DataValueField = "id";
         ddl.DataBind();
     }
 }
Ejemplo n.º 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            ServiceClass sc = new ServiceClass();

            if (!sc.UserAction(User.Identity.Name, Restrictions.UserRolesEdit))
            {
                Response.Redirect("~\\Account\\Restricted.aspx", true);
            }
            if (Page.IsPostBack)
            {
                return;
            }
            lock (Database.lockObjectDB)
            {
                DataSet ds = new DataSet();
                Database.ExecuteQuery("select RoleId, RoleName from vw_aspnet_Roles where ApplicationName = '" + Membership.ApplicationName + "' order by RoleName", ref ds, null);
                cblRoles.DataSource     = ds.Tables[0];
                cblRoles.DataTextField  = "RoleName";
                cblRoles.DataValueField = "RoleId";
                cblRoles.DataBind();
                ds.Clear();
                string UserId = Request.QueryString["id"].ToString();
                Database.ExecuteQuery(String.Format("select RoleId from V_UsersRoles where UserId='{0}'", UserId), ref ds, null);
                foreach (DataRow dr in ds.Tables[0].Rows)
                {
                    foreach (ListItem li in cblRoles.Items)
                    {
                        if (li.Value == dr["RoleId"].ToString())
                        {
                            li.Selected = true;
                        }
                    }
                }
            }
        }
Ejemplo n.º 3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     lock (Database.lockObjectDB)
     {
         ServiceClass sc = new ServiceClass();
         if (!sc.UserAction(User.Identity.Name, Restrictions.Events))
         {
             Response.Redirect("~\\Account\\Restricted.aspx", true);
         }
         if (Page.IsPostBack)
         {
             return;
         }
         LoadRepeater();
     }
 }
Ejemplo n.º 4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            ServiceClass sc = new ServiceClass();

            if (!sc.UserAction(User.Identity.Name, Restrictions.Events))
            {
                Response.Redirect("~\\Account\\Restricted.aspx", true);
            }
            if (Page.IsPostBack)
            {
                return;
            }
            DatePickerStart.FirstDayOfWeek = DatePicker.Day.Monday;
            DatePickerEnd.FirstDayOfWeek   = DatePicker.Day.Monday;
            DatePickerStart.SelectedDate   = DateTime.Now.AddDays(-7);
            DatePickerEnd.SelectedDate     = DateTime.Now;
            //LoadLog();
        }
Ejemplo n.º 5
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Page.IsPostBack)
     {
         return;
     }
     lock (Database.lockObjectDB)
     {
         ServiceClass sc = new ServiceClass();
         if (!sc.UserAction(User.Identity.Name, Restrictions.UserRolesEdit))
         {
             Response.Redirect("~\\Account\\Restricted.aspx", true);
         }
         if (Request.QueryString["mode"] == "2")
         {
             LoadData();
         }
         tbRoleName.Focus();
     }
 }
Ejemplo n.º 6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            ServiceClass sc = new ServiceClass();

            if (!sc.UserAction(User.Identity.Name, Restrictions.UserRolesEdit))
            {
                Response.Redirect("~\\Account\\Restricted.aspx", true);
            }
            if (Page.IsPostBack)
            {
                return;
            }
            lock (Database.lockObjectDB)
            {
                DataSet ds = new DataSet();
                Database.ExecuteQuery("select id, department from Branchs order by department", ref ds, null);
                BranchDDL.DataSource     = ds.Tables[0];
                BranchDDL.DataTextField  = "department";
                BranchDDL.DataValueField = "id";
                BranchDDL.DataBind();
                UserData();
            }
        }