Example #1
0
        private void skinTextBox1_Leave(object sender, EventArgs e) //动态头像
        {
            LibraryBLL.user check = new LibraryBLL.user();
            try
            {
                b = check.image(user.Text);
            }
            catch
            {
                head.BackgroundImage = null;
                return;
            }
            if (b.Length > 0)
            {
                byte[] ima = b;
                try
                {
                    head.BackgroundImage = LibraryBLL.drawimag.headima(ima, head.Width, head.Height);
                }
                catch
                {
                    head.BackgroundImage = null;

                    return;
                }
            }
        }
Example #2
0
        private void userInfoSure_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)//上传修改更新
        {
            string nameChange, phonechange, qqchange, personalSignChange;

            nameChange         = userNameChange.Text;
            phonechange        = phoneChange.Text;
            qqchange           = qqChange.Text;
            personalSignChange = personalSign.Text;
            LibraryBLL.user operate = new LibraryBLL.user();
            try
            {
                operate.userInfochange(nameChange, phonechange, qqchange, personalSignChange, stu_name);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
                return;
            }
            MessageBox.Show("更改成功");
            userNameChange.Visible = false; userNameChange.WaterText = "";
            phoneChange.Visible    = false; phoneChange.WaterText = "";
            qqChange.Visible       = false; qqChange.WaterText = "";
            userInfoSure.Visible   = false;
            userInfoCancle.Visible = false;
            personalSign.ReadOnly  = true; personalSign.WaterText = "";
            landusershow();
        }
Example #3
0
        private void deletuser_Click(object sender, EventArgs e)//删除用户
        {
            int a = 0; ArrayList name = new ArrayList();

            for (int i = 0; i < userinfolist.RowCount; i++)
            {
                string           b;
                DataGridViewCell checkbox = (DataGridViewCell)this.userinfolist.Rows[i].Cells[0];
                if ((string)checkbox.Value == "True")
                {
                    b = userinfolist.Rows[i].Cells[2].Value.ToString();
                    name.Add(b);
                }
            }
            if (MessageBox.Show("确定删除" + name.Count + "条数据吗?", "提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Asterisk) == DialogResult.OK)
            {
                LibraryBLL.user user = new LibraryBLL.user();
                try
                {
                    a = user.userdelete(name);
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                    return;
                }
                userinfoshow();
                MessageBox.Show("已经删除" + a + "条数据");
            }
        }
Example #4
0
        private Image img(string name) //传输头像
        {
            byte[]          b; Image image;
            LibraryBLL.user check = new LibraryBLL.user();
            try
            {
                b = check.image(name);
            }
            catch
            {
                image = null;
                return(image);
            }
            if (b.Length > 0)
            {
                try
                {
                    byte[] ima = b;
                    image = LibraryBLL.drawimag.headima(ima, head.Width, head.Height);
                }
                catch
                {
                    image = null;
                    return(image);
                }

                return(image);
            }
            else
            {
                image = null;
                return(image);
            }
        }
Example #5
0
        public void landuserpicshow() //用户头像显示
        {
            byte[]          b;
            LibraryBLL.user check = new LibraryBLL.user();
            try
            {
                b = check.image(username.Text);
            }
            catch
            {
                head.BackgroundImage = null;
                return;
            }
            if (b.Length > 0)
            {
                try
                {
                    byte[] ima = b;
                    head.BackgroundImage = LibraryBLL.drawimag.headima(ima, head.Width, head.Height);
                }
                catch
                {
                    head.BackgroundImage = null;

                    return;
                }
            }
        }
Example #6
0
 private void UImain_FormClosing(object sender, FormClosingEventArgs e)
 {
     LibraryBLL.user levelchange = new LibraryBLL.user();
     try
     {
         levelchange.offline(stu_name);
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
         e.Cancel = true;
     }
 }
Example #7
0
        private void landing_Click(object sender, EventArgs e) //登陆页面
        {
            SqlDataReader landing;

            try
            {
                landing = LibraryBLL.user.land(user.Text, password.Text);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
                return;
            }
            if (landing["level"].ToString().Trim() == "True") //判断登陆权限
            {
                level = true;
            }
            else
            {
                level = false;
            }

            user.Visible = password.Visible = login.Visible = btnlanding.Visible = false; //按键隐藏

            head.Left = (this.Width - head.Width) / 2;                                    //头像居中

            userParam            = new LibraryModel.user_Param();
            userParam.HeadImg    = head.BackgroundImage;
            userParam.level      = level;
            userParam.stuname    = landing["student_name"].ToString().Trim();
            userParam.lastonline = landing["onlinedate"].ToString();
            if (landing["online"].ToString().Trim() == "True")
            {
                MessageBox.Show("用户在线,过后重试");
            }
            timer = System.DateTime.Now.ToString();
            LibraryBLL.user levelchange = new LibraryBLL.user();
            try
            {
                levelchange.online(timer, user.Text);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
                return;
            }
            System.Threading.ThreadPool.QueueUserWorkItem(new System.Threading.WaitCallback(GetLog), user.SkinTxt.Text);
        }
Example #8
0
        private void 登出ToolStripMenuItem_Click(object sender, EventArgs e)//登出
        {
            LibraryBLL.user levelchange = new LibraryBLL.user();
            try
            {
                levelchange.offline(stu_name);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            UIlanding landing = new UIlanding();

            this.Hide();
            landing.Show();
        }
Example #9
0
 private void sure_Click(object sender, EventArgs e)
 {
     if (Pwd != rePwd)
     {
         if (MessageBox.Show("两次密码不同,请重新输入") == DialogResult.OK)
         {
             this.password.Focus();
             return;
         }
     }
     if (!setphoto)
     {
         if (MessageBox.Show("未设置头像") == DialogResult.OK)
         {
             return;
         }
     }
     try
     {
         LibraryBLL.user.check(userid.Text);
     }
     catch
     {
         if (MessageBox.Show("名字已被注册,请重新输入") == DialogResult.OK)
         {
             return;
         }
     }
     byte[]          road      = ESBasic.Helpers.ImageHelper.Convert(this.head.BackgroundImage);
     LibraryBLL.user userlogin = new LibraryBLL.user();
     try
     {
         userlogin.userlogincheck(userid.Text, stuname.Text, stuid.Text, courage.Text, qq.Text, phone.Text, road, password.Text);
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
         return;
     }
     if (MessageBox.Show("注册成功") == DialogResult.OK)
     {
         UImain uimain = new UImain();
         this.Hide();
         uimain.Focus();
         uimain.userinfoshow();
     }
 }
Example #10
0
        private void sure_Click(object sender, EventArgs e)
        {
            byte[]          road   = ESBasic.Helpers.ImageHelper.Convert(this.headchanged.BackgroundImage);
            LibraryBLL.user change = new LibraryBLL.user();
            try
            {
                change.headchange(name, road);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
                return;
            }
            k = true;
            UImain main = new UImain();

            this.Hide();
            main.Focus();
        }
Example #11
0
        private void userinfolist_CellContentClick(object sender, DataGridViewCellEventArgs e)//权限变更
        {
            DataGridViewColumn column = userinfolist.Columns[e.ColumnIndex];
            int i = userinfolist.CurrentRow.Index;

            if (column is DataGridViewButtonColumn)
            {
                string          s           = userinfolist.Rows[i].Cells[2].Value.ToString();
                string          b           = userinfolist.Rows[i].Cells[8].Value.ToString();
                LibraryBLL.user levelchange = new LibraryBLL.user();
                try
                {
                    levelchange.levelchange(s, b);
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                    return;
                }
                MessageBox.Show("权限更新成功");
                userinfoshow();
            }
        }