Exemplo n.º 1
0
    protected void SubmitBtn_Click(object sender, EventArgs e)
    {
        MF_User    register = new MF_User();
        DESEncrypt dese     = new DESEncrypt();

        register.Username = this.txtUserName.Text;
        register.Password = dese.EncryptString(this.txtPassword.Text);
        register.Email    = this.txtEmail.Text.ToUpper();
        register.Note     = this.txtNote.Text;
        register.Name     = this.txtName.Text;
        register.Grade    = int.Parse(this.ddlGrade.SelectedValue);
        register.OPTag    = MyFramework.EDBOperationTag.AddNew;
        if (register.DB_InsertEntity())
        {
            register.FillSelf(MF_User.M_Username + "='" + register.Username + "'");
            this.CurrentUser = register;
            MF_Group group = new MF_Group();
            group.GroupName = "我的好友";
            group.UserID    = register.UserID;
            group.OPTag     = MyFramework.EDBOperationTag.AddNew;
            group.DB_InsertEntity();

            this.Page.Response.Redirect("../Default.aspx");
        }
        else
        {
            errorMessage.InnerText = "抱歉,未知错误,请稍后再试试。";
        }
    }
Exemplo n.º 2
0
    public static bool EmailisExist(string email, string userid)
    {
        MF_User register = new MF_User();

        register.UserID = -1;
        register.FillSelf(MF_User.M_Email + "='" + email.ToUpper() + "'");
        if ((register.UserID > 0) && (register.UserID.ToString() != userid))
        {
            return(true);
        }
        else
        {
            return(false);
        }
    }
Exemplo n.º 3
0
    public static bool UserNameisExist(string username)
    {
        MF_User register = new MF_User();

        register.UserID = -1;
        register.FillSelf(MF_User.M_Username + "='" + username + "'");
        if (register.UserID > 0)
        {
            return(true);
        }
        else
        {
            return(false);
        }
    }
Exemplo n.º 4
0
    protected void addBtn_Click(object sender, EventArgs e)
    {
        MF_User friend = new MF_User();

        friend.UserID = -1;
        friend.FillSelf(MF_User.M_Username + "=(" + this.txtUserName.Text + ")");
        if (friend.UserID > 0)
        {
            MF_GroupMember mgm = new MF_GroupMember();
            mgm.GroupMemberID = -1;
            mgm.FillSelf(MF_GroupMember.M_UserID + "=(" + friend.UserID.ToString() + ")");
            if (mgm.GroupMemberID > 0)
            {
                if (mgm.Status == 1)
                {
                    Response.Write("<script language=javascript>alert('" + this.txtUserName.Text + "已经是您的好友!');</script>");
                }
                else
                {
                    Response.Write("<script language=javascript>alert('" + this.txtUserName.Text + "已经被您的好友,请等待好友反馈!');</script>");
                }
            }
            else
            {
                MF_Group Group = new MF_Group();
                Group.GroupID = -1;
                Group.FillSelf(MF_Group.M_UserID + "=(" + this.CurrentUser.UserID.ToString() + ")");

                MF_GroupMember gm = new MF_GroupMember();
                gm.Status   = 2;
                gm.UserID   = friend.UserID;
                gm.UserName = friend.Username;
                gm.GroupID  = Group.GroupID;
                gm.MyID     = this.CurrentUser.UserID;
                gm.MyName   = this.CurrentUser.Username;
                gm.OPTag    = MyFramework.EDBOperationTag.AddNew;
                gm.DB_InsertEntity();
                Response.Write("<script language=javascript>alert('添加成功,等待好友反馈!');</script>");
            }
        }
        else
        {
            Response.Write("<script language=javascript>alert('请输入正确的用户名');</script>");
        }
    }
Exemplo n.º 5
0
    protected void SubmitBtn_Click(object sender, EventArgs e)
    {
        MF_User register = new MF_User();

        register.UserID   = this.CurrentUser.UserID;
        register.Username = this.CurrentUser.Username;
        register.Password = this.CurrentUser.Password;
        register.Email    = this.txtEmail.Text.ToUpper();
        register.Note     = this.txtNote.Text;
        register.Name     = this.txtName.Text;
        register.Grade    = int.Parse(this.ddlGrade.SelectedValue);
        register.OPTag    = MyFramework.EDBOperationTag.Update;
        if (register.DB_SaveEntity())
        {
            register.FillSelf(MF_User.M_Username + "='" + register.Username + "'");
            this.CurrentUser       = register;
            errorMessage.InnerText = "修改成功。";
        }
        else
        {
            errorMessage.InnerText = "抱歉,未知错误,请稍后再试试。";
        }
    }