//화면 초기 이벤트 private void SetInfo(UserDetailInfo udll) { orgName.Text = udll.GROUPNAME; rankName.Text = udll.RANKNAME; name.Text = udll.MEMBERNAME; email.Text = udll.EMAIL; tel.Text = udll.OFFICEPHONE; hp.Text = udll.HP; string _photoPath = MainProg.CConf.FtpPath + "MPhoto/"; string _fileName = udll.MEMBERID + ".jpg"; byte[] _imgByte = _cu.GetImgByte(_photoPath, MainProg.CConf.FtpUser, MainProg.CConf.FtpPass, _fileName); profileBox.Image = _cu.ByteToImage(_imgByte); profileBox.SizeMode = PictureBoxSizeMode.StretchImage; if (udll.MEMBERID.Equals(MainProg.GetUserId())) { btn_savePhoto.Visible = true; } else { btn_savePhoto.Visible = false; } }
private void btn_UserInfo_Click(object sender, EventArgs e) { UserDetailInfo udll = new UserDetailInfo(); //선택한 유저 정보 가져오기 udll = MainProg.getUserInfoByKey("MEMBERID", MainProg.GetUserId()); UserInfo uif = new UserInfo(udll); uif.Owner = this; uif.Show(); }
//사진등록 이벤트 private void btn_savePhoto_Click(object sender, EventArgs e) { OpenFileDialog ofd = new OpenFileDialog(); if (ofd.ShowDialog() == DialogResult.OK) { //File명과 확장자를 가지고 온다. string fileName = ofd.SafeFileName; //File경로와 File명을 모두 가지고 온다. string fileFullName = ofd.FileName; //File경로만 가지고 온다. string filePath = fileFullName.Replace(fileName, ""); long fws = 0; FtpWebRequest res = _cu.Connect(MainProg.GetUserId() + ".jpg", WebRequestMethods.Ftp.UploadFile, ref fws, cf.FtpPath + "MPhoto/", cf.FtpUser, cf.FtpPass); using (var stream = res.GetRequestStream()) { using (var fs = System.IO.File.OpenRead(fileFullName)) { byte[] buffer = new byte[10 * 1024 * 1024]; int read; long total = 0; if (fws == 0) { fws = new FileInfo(fileFullName).Length; } while ((read = fs.Read(buffer, 0, buffer.Length)) > 0) { stream.Write(buffer, 0, read); total += read; } } } MessageBox.Show("저장되었습니다."); UserDetailInfo udll = new UserDetailInfo(); udll.MEMBERID = MainProg.GetUserId(); udll.GROUPNAME = orgName.Text; udll.RANKNAME = rankName.Text; udll.MEMBERNAME = name.Text; udll.EMAIL = email.Text; udll.OFFICEPHONE = tel.Text; udll.HP = hp.Text; //창에 사진 바꾸기 SetInfo(udll); //메인창에 사진 바꾸기 ((MainForm)(this.Owner)).SetPhoto(udll.MEMBERID); } }
private void btn_add_Click(object sender, System.EventArgs e) { Control ctn = panel1.Controls["txtUserName"]; string userNm = ctn.Text; UserDetailInfo uie = MainProg.getUserInfoByKey("MEMBERNAME", userNm); if (uie == null || uie.MEMBERID.Equals("")) { MessageBox.Show("등록되어 있지 않은 사용자입니다."); return; } lvrcvUserList.Update(); lvrcvUserList.Items.Add(userNm); ctn.Text = ""; lvrcvUserList.EndUpdate(); }
public UserInfo(UserDetailInfo udll) { InitializeComponent(); SetInfo(udll); }
//로그인 memberid, 선택된 유저, 처리구분 kb public void RunApp(String userId, String selectUserList, String kb) { Hashtable _param = new Hashtable(); UserDetailInfo udll = new UserDetailInfo(); udll = MainProg.getUserInfoByKey("MEMBERID", userId.Substring(1)); //메세지보내기 if (kb.Equals("sendMessage")) { //MessageFormBox mfb = new MessageFormBox(userId, selectUserList, client, null); MessageFormBox mfb = new MessageFormBox(userId, selectUserList, null); mfb.Show(); } //유저정보보기 else if (kb.Equals("viewUserInfo")) { //선택한 유저 정보 가져오기 UserInfo uif = new UserInfo(udll); uif.Show(); } //채팅하기 else if (kb.Equals("sendChat")) { List <String> _ru = new List <string>(); int _personCnt = 0; if (selectUserList != null && selectUserList.Length > 0) { String[] rcvUsrId = selectUserList.Split('^'); //체크박스로 선택한 사람들 foreach (String item in rcvUsrId) { //체크안되고 선택되어진 인원 중복 제외 if (!item.Equals(userId) && item.Length > 0) { String memberId = MainProg.getUserInfoByKey("MEMBERID", item.Substring(1)).MEMBERID; if (presentSessionList.Contains(memberId)) { ++_personCnt; //유저실제아이디로 치환(SESSION_KEY값) _ru.Add(memberId); } } } //채팅 선택되어진 사람(체크박스없이) if (presentSessionList.Contains(udll.MEMBERID)) { ++_personCnt; //유저실제아이디로 치환(SESSION_KEY값) _ru.Add(udll.MEMBERID); } } else { if (presentSessionList.Contains(udll.MEMBERID)) { ++_personCnt; //유저실제아이디로 치환(SESSION_KEY값) _ru.Add(udll.MEMBERID); } } //로그인된사람이 하나도 없으면 채팅불가 if (_personCnt < 1) { MessageBox.Show("로그인 된 참여자가 존재하지 않습니다."); return; } //채팅창 만든사람 _ru.Add(_userId); //채팅창을 오픈 ChatForm cf = new ChatForm(true, null, _userId, _ru); //채팅창에 받은 메세지를 넘겨줄 수 있도록 처리(MAINFORM => CHATFORM) this.DataSendEvent += new DataPushEventHandler(cf.SetActiveValue); cf.DataSendEvent += new DataGetEventHandlder(this.DataAction); cf.Show(); } }