private void FrmMain_Load(object sender, EventArgs e) { this.timeSystemn.Enabled = true; BLL.userInfo bllUserInfo = new BLL.userInfo(); List <Model.userInfo> muer = bllUserInfo.GetModelList(""); foreach (Model.userInfo m in muer) { if (m.userState != 2) { loginno++; } } this.notifyIcon1.Visible = true; this.Top = 0; this.Left = Screen.PrimaryScreen.Bounds.Width - this.Width; showMyinfo(); this.txtshuoshuo.Visible = false; getFriendList(); this.tmPicker.Enabled = true; this.pictureBox22.Image = this.imageList2.Images[this._user.userState - 1]; getGroupList(); getrecentfriend(); BLL.groupu bll = new BLL.groupu(); List <Model.groupu> mgroup = bll.GetModelList("groupuserID =" + this._user.userID); if (mgroup.Count() < 1) { this.btnAddmember.Visible = false; this.button2.Visible = false; } }
private void cmbUser_SelectedIndexChanged(object sender, EventArgs e) { BLL.userInfo blluser = new BLL.userInfo(); int id = Convert.ToInt32(this.cmbUser.Text); Model.userInfo bll = blluser.GetModel(id); FrmMain frm = new FrmMain(); this.pictureBox1.Image = frm.imageList1.Images[Convert.ToInt32(bll.userHeadImage)]; this.picLogin.Image = frm.imageList2.Images[0]; foreach (string s in userInfo) { string[] res = s.Split(' '); if (res[0] == this.cmbUser.Text) { this.textBox1.Text = res[1]; } } textBox1.Text = pwds[cmbUser.SelectedIndex].ToString(); int station = stations[cmbUser.SelectedIndex]; _station = station; int isRememberPwd = isRememberPwds[cmbUser.SelectedIndex]; if (isRememberPwd > 0) { this.cbPassword.Checked = true; } else { this.cbPassword.Checked = false; } }
public void ShowMsg(Model.groupMessage msg, bool isSendFromME) { BLL.userInfo bll = new BLL.userInfo(); Model.userInfo mu = bll.GetModel(msg.senderID); int startPos = this.txtinfo.Text.Length; string title = ""; Color fColor = Color.Black; if (isSendFromME) { title = mu.userName + msg.sendTime.ToLongTimeString() + "\r\n\t"; fColor = Color.Red; } else { title = this._me.userName + msg.sendTime.ToLongTimeString() + "\r\n\t"; fColor = Color.Blue;; } int titlelen = title.Length; this.txtinfo.AppendText(title); this.txtinfo.SelectionStart = startPos; this.txtinfo.SelectionLength = titlelen; this.txtinfo.SelectionColor = fColor; startPos = this.txtinfo.Text.Length; string comment = msg.messageContent + "\r\n"; int commentlen = comment.Length; this.txtinfo.AppendText(comment); this.txtinfo.SelectionStart = startPos; this.txtinfo.SelectionLength = commentlen; this.txtinfo.SelectionColor = Color.Black; }
private void updateshuoshuo() { BLL.userInfo blluserinfo = new BLL.userInfo(); this._user.userShuoshuo = this.txtshuoshuo.Text; blluserinfo.Update(this._user); showMyinfo(); this.lblshuoshuo.Visible = true; this.txtshuoshuo.Visible = false; }
private void FrmMain_FormClosed(object sender, FormClosedEventArgs e) { this._frm.Dispose(); BLL.userInfo bllUserInfo = new BLL.userInfo(); Model.userInfo user = bllUserInfo.GetModel(this._user.userID); user.userID = this._user.userID; user.userState = 2; bllUserInfo.Update(user); }
private void FrmAddUser_Load(object sender, EventArgs e) { BLL.userInfo blluser = new BLL.userInfo(); List <Model.userInfo> mu = blluser.GetModelList(""); int userid = 0; userid = 10001 + mu.Count; this.Text = "您的ID为" + userid.ToString(); }
public void ShowList() { BLL.userInfo bllUserInfo = new BLL.userInfo(); List <Model.userInfo> users = bllUserInfo.GetModelList("1=1"); this.cmbUser.Items.Clear(); foreach (Model.userInfo u in users) { this.cmbUser.Items.Add(u.userID); } }
private void button2_Click(object sender, EventArgs e) { label9.Text = ""; string acctype = comboBox1.Text; decimal opennnum = numericUpDown1.Value; string pwd = textBox5.Text; Model.cardinfo model = new Model.cardinfo(); model.cardID = ""; model.curType = "RMB"; model.customerID = CustomerID; model.IsReportLoss = false; model.savingType = acctype; model.openDate = DateTime.Now; model.openMoney = opennnum; model.balance = opennnum; model.pass = pwd; bool openOK; if (CustomerID != 0)//身份证已注册 { BLL.cardinfo bll = new BLL.cardinfo(); openOK = bll.Add(model, out CardID); } else { string name = textBox2.Text; string pid = textBox1.Text; string tel = textBox3.Text; string add = textBox4.Text; Model.userInfo modelU = new Model.userInfo(); modelU.customerID = 0; modelU.customerName = name; modelU.pID = pid; modelU.telephone = tel; modelU.address = add; BLL.userInfo bllU = new BLL.userInfo(); CustomerID = bllU.Add(modelU); model.customerID = CustomerID; BLL.cardinfo bll = new BLL.cardinfo(); openOK = bll.Add(model, out CardID); } if (openOK) { label9.Text = "注册成功,卡号是:" + CardID + ",请前去登录!"; Clipboard.SetText(CardID);//剪贴板 } else { label9.Text = "注册失败,下次再来!"; } }
private void FrmShowMSG_Load(object sender, EventArgs e) { FrmMain frm = new FrmMain(); BLL.userInfo bll = new BLL.userInfo(); _user = bll.GetModel(this._frmr.senderID); this.picImageHead.Image = frm.imageList1.Images[Convert.ToInt32(_user.userHeadImage)]; this.lblName.Text = _user.userName; this.lblID.Text = _user.userID.ToString(); this.textBox1.Text = this._frmr.ValidationInfo; }
private void CreateFrmMain(int id) { BLL.userInfo bllUserInfo = new BLL.userInfo(); Model.userInfo user = bllUserInfo.GetModel(id); FrmMain frm = new FrmMain(user, this); user.userState = 1; bllUserInfo.Update(user); frm.Show(); this._isHide = false; this.Hide(); }
private void getmessage() { this.Width = 640; this.pnHistory.Controls.Clear(); this.pnHistory.Visible = true; BLL.messsageInfo bllmess = new BLL.messsageInfo(); List <Model.messsageInfo> lmess = bllmess.GetModelList("receiverID='" + this._friend.userID + "'or senderID='" + this._friend.userID + "'"); int index = 0; foreach (Model.messsageInfo mess in lmess) { BLL.userInfo blluser = new BLL.userInfo(); Model.userInfo username = blluser.GetModel(mess.senderID); UCMessageHistory uc = new UCMessageHistory(); if (mess.receiverID == this._friend.userID) { uc.Ucid = mess.messageID; uc.Top = uc.Height * index; uc.Username = username.userName; uc.Time = mess.sendTime; uc.Message = mess.messageContent; uc.BackColor = Color.Beige; uc.Me = false; uc.IsChosed = false; uc.MouseClick += new MouseEventHandler(uc_MouseClick); listmessage.Add(uc); chouseed.Add(uc); uc.MouseMove += new MouseEventHandler(uc_MouseMove); pnHistory.Controls.Add(uc); index++; } else { uc.Ucid = mess.messageID; uc.Top = uc.Height * index; uc.Username = username.userName; uc.Time = mess.sendTime; uc.Message = mess.messageContent; uc.BackColor = Color.Beige; uc.Me = true; uc.IsChosed = false; listmessage.Add(uc); chouseed.Add(uc); uc.MouseMove += new MouseEventHandler(uc_MouseMove); uc.MouseClick += new MouseEventHandler(uc_MouseClick); pnHistory.Controls.Add(uc); index++; } } }
private void btnTest_Click(object sender, EventArgs e) { LoginToMain(); string userID = this.cmbUser.Text; int isAutoLogin = 0; int isRemmenberPwd = 0; BLL.userInfo bllUserInfo = new BLL.userInfo(); Model.userInfo user = bllUserInfo.GetModel(Convert.ToInt32(userID)); string pwd = " "; // int userState=this. ///获取登录时间 DateTime LoginTime = DateTime.Now; if (cbPassword.Checked) { pwd = user.userPWD; } if (cbPassword.Checked) { isRemmenberPwd = 1; } if (cbLogin.Checked) { isAutoLogin = 1; } StreamReader sr = new StreamReader(mainPath + "record.txt"); Boolean flag = false; while (sr.Peek() > -1) { string tmp = sr.ReadLine(); string[] str = tmp.Split('-'); if (user.userID.ToString() == str[0]) { sr.Close(); updateRecord(user.userID.ToString(), pwd, isAutoLogin, isRemmenberPwd, _station, LoginTime); flag = true; break; } } if (!flag) { sr.Close(); recordSuccessUser(user.userID.ToString(), pwd, isAutoLogin, isRemmenberPwd, _station, LoginTime); } }
private void toolStripMenuItem5_Click(object sender, EventArgs e) { BLL.userInfo bllUser = new BLL.userInfo(); Model.userInfo mu = new Model.userInfo(); mu.userID = this._user.userID; mu.userState = 2; mu.userBirthDay = this._user.userBirthDay; mu.userDescription = this._user.userDescription; mu.userHeadImage = this._user.userHeadImage; mu.userName = this._user.userName; mu.userPWD = this._user.userPWD; mu.userSex = this._user.userSex; mu.userShuoshuo = this._user.userShuoshuo; this.pictureBox22.Image = this.imageList2.Images[1]; bllUser.Update(mu); }
private void btnOK_Click(object sender, EventArgs e) { this.Ylblname.Text = ""; this.Ylblpassword.Text = ""; this.Ylblsex.Text = ""; this.Ylblbirthday.Text = ""; this.Ylblshuoshuo.Text = ""; if (this.txtName.Text == "") { this.Ylblname.Text = "*昵称不能为空"; return; } if (this.txtPassword.Text == "") { this.Ylblpassword.Text = "*密码不能为空"; return; } if (this.cmbSex.Text == "") { this.Ylblsex.Text = "*性别不能为空"; return; } if (this.dtpBirthday.Value >= BLL.NormalOperation.getServerTime()) { this.Ylblbirthday.Text = "*时间输入不正确!"; } if (this.txtShuoshuo.Text == "") { this.Ylblshuoshuo.Text = "*说说不能为空!"; return; } BLL.userInfo blluser = new BLL.userInfo(); Model.userInfo m = new Model.userInfo(); m.userBirthDay = this.dtpBirthday.Value; m.userDescription = this.txtDescription.Text; m.userHeadImage = Convert.ToString("1"); m.userName = this.txtName.Text; m.userPWD = this.txtPassword.Text; m.userSex = this.cmbSex.Text; m.userShuoshuo = this.txtShuoshuo.Text; m.userState = 2; blluser.Add(m); MessageBox.Show("注册成功!"); this.Close(); this._frm.ShowList(); }
private void RefreshList() { int mn = 0; BLL.userInfo bllUserInfo = new BLL.userInfo(); List <Model.userInfo> muer = bllUserInfo.GetModelList(""); foreach (Model.userInfo m in muer) { if (m.userState != 2 && m.userState != 3) { mn++; } } if (mn != loginno) { loginno = mn; this.panel1.Controls.Clear(); getFriendList(); } }
private void btnOK_Click(object sender, EventArgs e) { string username = this.txtName.Text; int newindex = Convert.ToInt32(this.cmbImage.Text) - 1; if (username == "") { return; } this._user.userBirthDay = this.dtpbirthday.Value; this._user.userDescription = this.txtdescription.Text; this._user.userHeadImage = newindex.ToString(); this._user.userName = username; this._user.userSex = this.cmbSex.Text; BLL.userInfo blluserinfo = new BLL.userInfo(); blluserinfo.Update(this._user); this._frm.changeHeadImage(newindex); this._frm.changename(username); MessageBox.Show("修改成功!!"); this.Dispose(); }
private void getrecentfriend() { FileStream fs = new FileStream(Application.StartupPath + "\\" + "friend.txt", FileMode.Open, FileAccess.Read); StreamReader sr = new StreamReader(fs); int index = 0; while (sr.Peek() > -1) { string tmp = sr.ReadLine(); string[] res = tmp.Split(' '); foreach (Model.friendInfo fri in myFriends) { if (this._user.userID == Convert.ToInt32(res[0]) && res[1] == fri.friendID.ToString()) { BLL.friendInfo bllfrq = new BLL.friendInfo(); List <Model.friendInfo> bllfq = bllfrq.GetModelList("userid=" + _user.userID + "and friendid=" + Convert.ToInt32(res[1]) + ""); UCFriendInfo ucRecentfriend = new UCFriendInfo(_user, this); BLL.userInfo frueser = new BLL.userInfo(); Model.userInfo u = frueser.GetModel(bllfq[0].friendID); ucRecentfriend.Top = ucRecentfriend.Height * index; ucRecentfriend.UserName = bllfq[0].friendName; ucRecentfriend.NickName = bllfq[0].friendName; ucRecentfriend.UserShuoshuo = u.userShuoshuo; ucRecentfriend.FriendInfo = u; ucRecentfriend.HeadImage = this.imageList1.Images[Convert.ToInt32(u.userHeadImage)]; this.pnrecentfriend.Controls.Add(ucRecentfriend); ucRecentfriend.MouseClick += new MouseEventHandler(ucf_MouseClick); //ucRecentfriend.MouseLeave += new EventHandler(ucf_MouseLeave); //ucRecentfriend.myDBClick += new UCFriendInfo.delDBClick(ucf_myDBClick); //ucRecentfriend.MouseEnter += new EventHandler(ucf_MouseEnter); index++; } } } sr.Close(); fs.Close(); }
private void FrmGroupTalk_Load(object sender, EventArgs e) { this.textBox2.Text = this._uc.Groupannouncement; FrmMain frm = new FrmMain(); BLL.groupu bll = new BLL.groupu(); List <Model.groupu> mylist = bll.GetModelList("groupID=" + this._uc.GroupID); int index = 0; foreach (Model.groupu mg in mylist) { BLL.userInfo bu = new BLL.userInfo(); Model.userInfo mu = bu.GetModel(mg.groupfriendID); UCGroup ucg1 = new UCGroup(); ucg1.Top = ucg1.Height * index; ucg1.Id1 = mg.groupfriendID; ucg1.HeadImage = frm.imageList1.Images[Convert.ToInt32(mu.userHeadImage)]; ucg1.Username = mu.userName; luc.Add(ucg1); this.panel1.Controls.Add(ucg1); index++; } }
private void LoginToMain() { string userID = this.cmbUser.Text; string userPWD = this.textBox1.Text; if (userID == "" || userPWD == "") { return; } BLL.userInfo bllUserInfo = new BLL.userInfo(); Model.userInfo user = bllUserInfo.GetModel(Convert.ToInt32(userID)); if (userPWD != user.userPWD) { return; } user.userID = Convert.ToInt32(userID); user.userState = temp; bllUserInfo.Update(user); FrmMain frm = new FrmMain(user, this); frm.Show(); this.Hide(); }
private void GetFriend() { int i = 0; FrmMain frm = new FrmMain(); this.panel1.Controls.Clear(); BLL.userInfo bll = new BLL.userInfo(); List <Model.userInfo> muser = bll.GetModelList("userID like'%" + this.txtsearch.Text + "%'"); int indext = 0; foreach (Model.userInfo m in muser) { foreach (Model.groupu mg in groupfriend) { if (m.userID == mg.groupfriendID) { i++; } } if (i != 0) { UCGroup ucg = new UCGroup(); ucg.Top = ucg.Height * indext; ucg.Id1 = m.userID; ucg.Username = m.userName; ucg.IsChouse = false; ucg.HeadImage = frm.imageList1.Images[Convert.ToInt32(m.userHeadImage)]; ucg.Headimageindex = Convert.ToInt32(m.userHeadImage); ucg.MouseDoubleClick += new MouseEventHandler(ucg_MouseDoubleClick); indext++; uc.Add(ucg); this.panel1.Controls.Add(ucg); } i = 0; } }
private void button1_Click(object sender, EventArgs e) { label8.Text = ""; textBox2.Text = ""; textBox3.Text = ""; textBox4.Text = ""; string pid = textBox1.Text; BLL.userInfo bll = new BLL.userInfo(); Model.userInfo model = bll.GetModel(pid); if (model != null) { textBox2.Text = model.customerName; textBox3.Text = model.telephone; textBox4.Text = model.address; CustomerID = model.customerID; label8.Text = "老客户,基本信息不用重填"; } else { label8.Text = "新客户,请填基本信息"; } }
public void getFriendList() { BLL.friendInfo bllFriend = new BLL.friendInfo(); myFriends = bllFriend.GetModelList("userID =" + this._user.userID.ToString()); int index = 0; ucflFriend.Clear(); foreach (Model.friendInfo f in myFriends) { UCFriendInfo ucF = new UCFriendInfo(); RelFriendToFrmTalk ft = new RelFriendToFrmTalk(); BLL.userInfo bllUserInfo = new BLL.userInfo(); Model.userInfo friend = bllUserInfo.GetModel(f.friendID); if (friend.userState != 2 && friend.userState != 3) { ucF.Top = ucF.Height * index; ucF.HeadImage = this.imageList1.Images[Convert.ToInt32(friend.userHeadImage)]; ucF.UserName = f.friendName; ucF.myDBClick += new UCFriendInfo.delDBClick(ucF_myDBClick); ucF.MouseClick += new MouseEventHandler(ucF_MouseClick); ucF.FriendInfo = friend; ucF.NickName = f.friendName; ucF.UserShuoshuo = friend.userShuoshuo; ucF.FID = f.ID; if (ucF.UserShuoshuo.Length >= 10) { ucF.UserShuoshuo = ucF.UserShuoshuo.Substring(0, 10) + "..."; } this.panel1.Controls.Add(ucF); index++; ft.FriendId = f.friendID; ft.IsOpenTalkForm = false; ft.Frm = null; tbFriendTalkInfo.Add(ft); ucF.UserID = f.friendID; ucflFriend.Add(ucF); } } foreach (Model.friendInfo f in myFriends) { UCFriendInfo ucF = new UCFriendInfo(); RelFriendToFrmTalk ft = new RelFriendToFrmTalk(); BLL.userInfo bllUserInfo = new BLL.userInfo(); Model.userInfo friend = bllUserInfo.GetModel(f.friendID); if (friend.userState == 2 || friend.userState == 3) { ucF.Top = ucF.Height * index; ucF.HeadImage = this.imageList1.Images[Convert.ToInt32(friend.userHeadImage) + 110]; ucF.UserName = f.friendName; ucF.myDBClick += new UCFriendInfo.delDBClick(ucF_myDBClick); ucF.MouseClick += new MouseEventHandler(ucF_MouseClick); ucF.FriendInfo = friend; ucF.NickName = f.friendName; ucF.UserShuoshuo = friend.userShuoshuo; ucF.FID = f.ID; if (ucF.UserShuoshuo.Length >= 10) { ucF.UserShuoshuo = ucF.UserShuoshuo.Substring(0, 10) + "..."; } this.panel1.Controls.Add(ucF); index++; ft.FriendId = f.friendID; ft.IsOpenTalkForm = false; ft.Frm = null; tbFriendTalkInfo.Add(ft); ucF.UserID = f.friendID; ucflFriend.Add(ucF); } } }
private void btnSearch_Click_1(object sender, EventArgs e) { this.panFriend.Controls.Clear(); if (cmbFriend.Text == "按用户ID查询") { BLL.userInfo blluser = new BLL.userInfo(); List <Model.userInfo> alluser = blluser.GetModelList("userID like'%" + this.txtID.Text + "%'"); int index = 0; for (int j = 0; j < alluser.Count; j++) { int i = 0; BLL.friendInfo bll = new BLL.friendInfo(); List <Model.friendInfo> userfriend = bll.GetModelList(" userID= " + this._user.userID); List <Model.friendInfo> friend = bll.GetModelList(" userID= " + alluser[j].userID); foreach (Model.friendInfo uf in userfriend) { foreach (Model.friendInfo f in friend) { if (uf.friendID == f.friendID) { i++; } } } UCFriendSearchList uc = new UCFriendSearchList(); uc.MouseEnter += new EventHandler(uc_MouseEnter); uc.Top = j / 3 * uc.Height; uc.Left = j % 3 * uc.Width; uc.HeadImage = this._frm.imageList1.Images[Convert.ToInt16(alluser[j].userHeadImage)]; uc.UserID = alluser[j].userID; uc.UserName = alluser[j].userName; uc.Iname = this._user.userName; uc.Id = this._user.userID; uc.SameFriend = i; uc.Iimage = this._frm.imageList1.Images[Convert.ToInt16(this._user.userHeadImage)]; uc.FrmtalkIsOpen = false; ucflFriend.Add(uc); ; this.panFriend.Controls.Add(uc); index++; } } if (cmbFriend.Text == "按用户NAME查询") { BLL.userInfo blluser = new BLL.userInfo(); List <Model.userInfo> alluser = blluser.GetModelList("userName like'%" + this.txtID.Text + "%'"); int index = 0; for (int j = 0; j < alluser.Count; j++) { int i = 0; BLL.friendInfo bll = new BLL.friendInfo(); List <Model.friendInfo> userfriend = bll.GetModelList(" userID= " + this._user.userID); List <Model.friendInfo> friend = bll.GetModelList(" userID= " + alluser[j].userID); foreach (Model.friendInfo uf in userfriend) { foreach (Model.friendInfo f in friend) { if (uf.friendID == f.friendID) { i++; } } } UCFriendSearchList uc = new UCFriendSearchList(); uc.MouseEnter += new EventHandler(uc_MouseEnter); uc.Top = j / 3 * uc.Height; uc.Left = j % 3 * uc.Width; uc.HeadImage = this._frm.imageList1.Images[Convert.ToInt16(alluser[j].userHeadImage)]; uc.UserID = alluser[j].userID; uc.UserName = alluser[j].userName; uc.Id = this._user.userID; uc.Iname = this._user.userName; uc.SameFriend = i; uc.Iimage = this._frm.imageList1.Images[Convert.ToInt16(this._user.userHeadImage)]; uc.FrmtalkIsOpen = false; ucflFriend.Add(uc); this.panFriend.Controls.Add(uc); index++; } } }
private void timeSystemn_Tick(object sender, EventArgs e) { BLL.messsageInfo bmess = new BLL.messsageInfo(); List <Model.messsageInfo> mmess = bmess.GetModelList("receiverID= '" + this._user.userID + "'and messageState=20 "); foreach (Model.messsageInfo m in mmess) { BLL.messsageInfo BllMsgInfo = new BLL.messsageInfo(); Model.messsageInfo msg = new Model.messsageInfo(); msg.messageContent = m.messageContent; msg.senderID = m.senderID; msg.receiverID = m.receiverID; msg.messageState = 21; msg.sendTime = m.sendTime; msg.messageID = m.messageID; BllMsgInfo.Update(msg); BLL.userInfo bll2 = new BLL.userInfo(); Model.userInfo mfriend2 = bll2.GetModel(m.senderID); FrmimmediatelyMsg frm = new FrmimmediatelyMsg(tbFriendTalkInfo, this, this._user, mfriend2, mfriend2.userName); frm.Show(); } BLL.friendRequest bl = new BLL.friendRequest(); List <Model.friendRequest> mfrien = bl.GetModelList("senderID= '" + this._user.userID + "'and Station=2 "); foreach (Model.friendRequest m in mfrien) { FrmOkWarn sw = new FrmOkWarn(m, this); sw.Show(); Model.friendRequest mf = new Model.friendRequest(); mf.ID = m.ID; mf.NickName = m.NickName; mf.NumOfSameFriend = m.NumOfSameFriend; mf.receiveID = m.receiveID; mf.senderID = m.senderID; mf.ValidationInfo = m.ValidationInfo; mf.ValidationTime = m.ValidationTime; mf.Station = 5; bl.Update(mf); } BLL.friendRequest bll = new BLL.friendRequest(); List <Model.friendRequest> mfriend = bll.GetModelList("receiveID= '" + this._user.userID + "'and Station=1 "); foreach (Model.friendRequest m in mfriend) { SystemWarn sw = new SystemWarn(m, this); sw.Show(); Model.friendRequest mf = new Model.friendRequest(); mf.ID = m.ID; mf.NickName = m.NickName; mf.NumOfSameFriend = m.NumOfSameFriend; mf.receiveID = m.receiveID; mf.senderID = m.senderID; mf.ValidationInfo = m.ValidationInfo; mf.ValidationTime = m.ValidationTime; mf.Station = 5; bll.Update(mf); } BLL.groupu bllgroup = new BLL.groupu(); List <Model.groupu> mgroup = bllgroup.GetModelList("groupuserID=" + this._user.userID); if (mgroup.Count != 0) { int receiverID = mgroup[0].groupID; List <Model.friendRequest> mfriend2 = bll.GetModelList("receiveID= '" + receiverID + "'and Station=1 "); foreach (Model.friendRequest m in mfriend2) { FrmGroupWarn sw = new FrmGroupWarn(m, this); sw.Show(); Model.friendRequest mf = new Model.friendRequest(); mf.ID = m.ID; mf.NumOfSameFriend = m.NumOfSameFriend; mf.receiveID = m.receiveID; mf.senderID = m.senderID; mf.ValidationInfo = m.ValidationInfo; mf.ValidationTime = m.ValidationTime; mf.Station = 5; bll.Update(mf); } } }