コード例 #1
0
ファイル: userinfo.aspx.cs プロジェクト: withercn/advali
        protected void UserInfoEdit_Click(object sender, EventArgs e)
        {
            int userid = 0;

            int.TryParse(HtmlUser.clsdes.Decrypt(Common.AdvAliCookie.GetCookieMemberId()), out userid);
            if (userid > 0)
            {
                User user = Logic.Consult.GetUser(userid);
                user.Username = Common.Util.GetPageParams("username");
                if (Common.Util.GetPageParams("password").Length >= 6 && Common.Util.GetPageParams("password").Length <= 20 && Common.Util.GetPageParams("password") == Common.Util.GetPageParams("repassword"))
                {
                    user.Password = Common.Util.Md532(Common.Util.GetPageParams("password"));
                }
                user.Inc      = Common.Util.GetPageParams("inc");
                user.Contact  = Common.Util.GetPageParams("contact");
                user.TelPhone = Common.Util.GetPageParams("tel");
                user.Mobile   = Common.Util.GetPageParams("mobile");
                user.Fax      = Common.Util.GetPageParams("fax");
                user.QQ       = Common.Util.GetPageParams("qq");
                user.Msn      = Common.Util.GetPageParams("msn");
                user.Address  = Common.Util.GetPageParams("address");
                HtmlUser.EditUser(user);
            }
            else
            {
                AdvAli.Common.MsgBox.ScriptAlert("Msg", "<p>对不起,您没有权限访问该模块!</p>", "../login.aspx", "top");
            }
        }
コード例 #2
0
ファイル: rightsedit.aspx.cs プロジェクト: withercn/advali
        protected void RightsEdit_Click(object sender, EventArgs e)
        {
            string thisrights = "";

            if (int.Parse(group.SelectedValue) != 999)
            {
                thisrights = Logic.Consult.GetGroupAdmins(int.Parse(group.SelectedValue));
            }
            else
            {
                thisrights = HttpContext.Current.Request["hid"];
                if (thisrights.Length > 0)
                {
                    thisrights = thisrights.Substring(0, thisrights.Length - 1);
                }
            }
            HtmlUser.EditUserRights(userid, int.Parse(group.SelectedValue), thisrights);
            this.BindGroupsOfAdmins();
        }
コード例 #3
0
ファイル: useredit.aspx.cs プロジェクト: withercn/advali
        protected void UserEdit_Click(object sender, EventArgs e)
        {
            int  id   = AdvAli.Common.Util.GetPageParamsAndToInt("id");
            User user = Logic.Consult.GetUser(id);

            user.Username = Common.Util.GetPageParams("username");
            if (Common.Util.GetPageParams("password").Length >= 6 && Common.Util.GetPageParams("password").Length <= 20 && Common.Util.GetPageParams("password") == Common.Util.GetPageParams("repassword"))
            {
                user.Password = Common.Util.Md532(Common.Util.GetPageParams("password"));
            }
            user.Inc      = Common.Util.GetPageParams("inc");
            user.Contact  = Common.Util.GetPageParams("contact");
            user.TelPhone = Common.Util.GetPageParams("tel");
            user.Mobile   = Common.Util.GetPageParams("mobile");
            user.Fax      = Common.Util.GetPageParams("fax");
            user.QQ       = Common.Util.GetPageParams("qq");
            user.Msn      = Common.Util.GetPageParams("msn");
            user.Address  = Common.Util.GetPageParams("address");
            HtmlUser.EditUser(user);
        }
コード例 #4
0
ファイル: password.aspx.cs プロジェクト: withercn/advali
        protected void Password_Click(object sender, EventArgs e)
        {
            int userid = 0;

            int.TryParse(HtmlUser.clsdes.Decrypt(Common.AdvAliCookie.GetCookieMemberId()), out userid);
            if (userid > 0)
            {
                if (txtPassword.Value.Trim() == txtPassword2.Value.Trim())
                {
                    HtmlUser.EditPassword(userid, txtOldPassword.Value.Trim(), txtPassword.Value.Trim());
                }
                else
                {
                    Common.MsgBox.Alert("Password", string.Format("<p>两次输入的密码不相同,请仔细检查!</p>"));
                }
            }
            else
            {
                AdvAli.Common.MsgBox.ScriptAlert("Msg", "<p>对不起,您没有权限访问该模块!</p>", "../login.aspx", "top");
            }
        }
コード例 #5
0
        protected void BaseDataBind(HtmlTable data)
        {
            string[] fields      = Fields.Split(new char[] { ',' });
            string[] fieldsname  = FieldName.Split(new char[] { ',' });
            string[] fieldswidth = FieldWidth.Split(new char[] { ',' });
            int      pageIndex   = (Common.Util.GetPageParamsAndToInt("Page") > 0) ? Common.Util.GetPageParamsAndToInt("Page") : 1;

            using (DataSet ds = Logic.Consult.GetTable((this.GetLoggedUserGroupId() >= 8 ? 0 : HtmlUser.GetLoggedMemberId()), this.DefaultTable, this.Fields, pageIndex, HtmlPager.PageSize, out recordcount))
            {
                if (AdvAli.Common.Util.CheckDataSet(ds))
                {
                    HtmlTableRow tr = new HtmlTableRow();
                    tr.Attributes.Add("class", "title");
                    HtmlTableCell htc = new HtmlTableCell();
                    htc.InnerHtml = "<span><input onclick=checkall() type=checkbox id=selall></span>";
                    htc.Width     = "30";
                    tr.Cells.Add(htc);
                    for (int i = 0; i < fieldsname.Length; i++)
                    {
                        HtmlTableCell td = new HtmlTableCell();
                        td.Width     = fieldswidth[i];
                        td.InnerHtml = fieldsname[i];
                        tr.Cells.Add(td);
                    }
                    data.Rows.Add(tr);
                    Random          ro      = new Random(DateTime.Now.Millisecond);
                    int             startid = ro.Next(1, 100);
                    HtmlInputHidden hih     = new HtmlInputHidden();
                    hih.ID    = "startid";
                    hih.Value = startid.ToString();
                    Page.Form.Controls.Add(hih);
                    HtmlInputHidden hid = new HtmlInputHidden();
                    hid.ID    = "idlist";
                    hid.Value = "";
                    Page.Form.Controls.Add(hid);
                    int runv = 0;
                    foreach (DataRow reader in ds.Tables[0].Rows)
                    {
                        tr            = new HtmlTableRow();
                        htc           = new HtmlTableCell();
                        htc.InnerHtml = "<input value=\"" + reader["id"].ToString() + "\" type=checkbox onclick=\"SetHid('" + reader["id"].ToString() + "');\" id=sel" + (startid + runv).ToString() + " />";
                        tr.Cells.Add(htc);
                        for (int i = 0; i < fields.Length; i++)
                        {
                            HtmlTableCell td = new HtmlTableCell();
                            if (string.IsNullOrEmpty(reader[i].ToString().Trim()) || string.Equals(reader[i].ToString().Trim(), "<a href=\"\" target=\"_blank\"></a>"))
                            {
                                td.InnerHtml = "无";
                            }
                            else
                            {
                                td.InnerHtml = reader[i].ToString();
                                td.Attributes.Add("title", reader[i].ToString());
                            }
                            tr.Cells.Add(td);
                        }
                        data.Rows.Add(tr);
                        runv++;
                    }
                }
            }
        }