Beispiel #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        ClsAuth.check_auth_admin();

        // This is to avoid the double submission problem when refreshing a submitted page.
        if (Request["ok"] != null)
        {
            this.form1.Text = "";
            this.msg.Text   = "<font color='green'>The new user has been added.</font> <br/><br/><a href='new.aspx'>Add Another New User</a>";
            return;
        }

        this.user.retrieveRequest(this.IsPostBack, Request);
        if (this.IsPostBack)
        {
            this.form1.Text = "";
            try
            {
                this.insert();
                Response.Redirect("new.aspx?ok=1");
                //this.msg.Text = "<font color='green'>The new user has been added.</font> <br/><br/><a href='new.aspx'>Add Another New User</a>";
            }
            catch (Exception ex) {
                this.msg.Text   = "<p><font color='red'>" + ex.Message + "</font></p>";
                this.form1.Text = ShowNewForm();
            }
        }
        else
        {
            this.msg.Text   = "";
            this.form1.Text = ShowNewForm();
        }
    }
Beispiel #2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     ClsAuth.check_auth_admin();
     if (this.IsPostBack)
     {
         this.client.download_pdf(ClsUtil.getStrVal(Request["print_id"]));
     }
     ShowAtoZList();
     ShowClientList();
 }
Beispiel #3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        ClsAuth.check_auth_admin();

        ID = ClsUtil.getStrVal(Request["id"]);
        if (ID == "")
        {
            return;
        }

        this.retrieve(ID);
        this.lblProfile.Text = this.ShowViewForm();
    }
Beispiel #4
0
    protected void Page_Load(object sender, EventArgs e)
    {
        ClsAuth.check_auth_admin();

        string ID = ClsUtil.getStrVal(Request["id"]);

        this.retrieve(ID);
        this.lblProfile.Text = this.ShowViewForm();


        if (this.IsPostBack)
        {
            try
            {
                this.msg.Text = "";
                this.retrievePostVal();
                //Response.Write(this.db_old_pwd_hash + "=?=" + this.old_pwd );

                if (this.new_pwd != this.new_pwd2)
                {
                    this.msg.Text = "<p><font color='red'>New passwords not match.</font></p>";
                }
                else
                {
                    string check = check_pwd(this.new_pwd);
                    if (check != "")
                    {
                        this.msg.Text = "<p><font color='red'>" + check + ".</font></p>";
                    }
                    else
                    {
                        this.update(ID);
                        this.msg.Text = "<p><font color='green'>User password has been updated.</font> </p>";
                    }
                }
            }
            catch (Exception ex)
            {
                this.msg.Text = "<p><font color='red'>" + ex.Message + "</font></p>";
            }
        }
        else
        {
            this.msg.Text = "";
        }
    }
Beispiel #5
0
    protected void Page_Load(object sender, EventArgs e)
    {
        ClsAuth.check_auth_admin();

        string ID = ClsUtil.getStrVal(Request["id"]);

        if (ID == "")
        {
            this.msg.Text   = "Not a valid user.";
            this.form1.Text = "";
            return;
        }

        if (this.IsPostBack)
        {
            this.form1.Text = "";
            try
            {
                this.user.retrieveRequest(this.IsPostBack, Request);
                this.user.update(ID, Session["userid"].ToString());

                this.msg.Text = "<p><font color='green'>This profile has been updated.</font> </p>";
                if (ClsDB.DEBUG())
                {
                    Response.Write(this.user.strQuery());
                }
            }
            catch (Exception ex)
            {
                this.msg.Text = "<p><font color='red'>" + ex.Message + "</font></p>";
            }

            this.user.retrieveDB(ID);
            this.form1.Text = ShowEditForm();
        }
        else
        {
            this.user.retrieveDB(ID);
            this.msg.Text   = "";
            this.form1.Text = ShowEditForm();
        }
    }
Beispiel #6
0
    protected void Page_Load(object sender, EventArgs e)
    {
        ClsAuth.check_auth_admin();

        if (this.IsPostBack)
        {
            this.form1.Text = "";
            try
            {
                this.add();
                this.msg.Text = "<font color='green'>The new user has been added.</font> <br/><br/><a href='new.aspx'>Add Another New User</a>";
            }
            catch (Exception ex) {
                this.msg.Text   = "<p><font color='red'>" + ex.Message + "</font></p>";
                this.form1.Text = ShowNewForm();
            }
        }
        else
        {
            this.msg.Text   = "";
            this.form1.Text = ShowNewForm();
        }
    }
Beispiel #7
0
    protected void Page_Load(object sender, EventArgs e)
    {
        ClsAuth.check_auth_admin();

        string ID = ClsUtil.getStrVal(Request["id"]);

        if (ID == "")
        {
            this.msg.Text   = "Not a valid user.";
            this.form1.Text = "";
            return;
        }

        if (this.IsPostBack)
        {
            this.form1.Text = "";
            try
            {
                this.update(ID);
                this.msg.Text = "<p><font color='green'>This profile has been updated.</font> </p>";
            }
            catch (Exception ex)
            {
                this.msg.Text = "<p><font color='red'>" + ex.Message + "</font></p>";
            }
            //this.retrievePostVal();
            this.retrieve(ID);
            this.form1.Text = ShowEditForm();
        }
        else
        {
            this.retrieve(ID);
            this.msg.Text   = "";
            this.form1.Text = ShowEditForm();
        }
    }
Beispiel #8
0
 protected void Page_Load(object sender, EventArgs e)
 {
     ClsAuth.check_auth_admin();
     ShowList();
 }