chat 서버 기능 추가
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using arTCPService.Server;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
@@ -13,9 +14,12 @@ namespace Project
|
||||
public partial class fMain : Form
|
||||
{
|
||||
string SearchKey = string.Empty;
|
||||
arTCPService.Server.Server server;
|
||||
|
||||
public fMain()
|
||||
{
|
||||
InitializeComponent();
|
||||
server = new Server();
|
||||
this.KeyDown += (s1, e1) =>
|
||||
{
|
||||
if (e1.KeyCode == Keys.F12) btSetting.PerformClick();
|
||||
@@ -36,6 +40,35 @@ namespace Project
|
||||
|
||||
this.MouseMove += (s1, e1) => { if (DateTime.Now > Pub.LastInputTime) Pub.LastInputTime = DateTime.Now; };
|
||||
this.FormClosing += __Closing;
|
||||
this.FormClosed += FMain_FormClosed;
|
||||
this.server.ClientConnected += Server_ClientConnected;
|
||||
}
|
||||
|
||||
private void Server_ClientConnected(Receiver receiver)
|
||||
{
|
||||
this.BeginInvoke(new Action(()=> {
|
||||
var f = new Dialog.fChat(receiver);
|
||||
f.Show();
|
||||
f.Activate();
|
||||
}));
|
||||
}
|
||||
|
||||
private void FMain_FormClosed(object sender, FormClosedEventArgs e)
|
||||
{
|
||||
if (server != null)
|
||||
server.CloseChild();
|
||||
//연결종료
|
||||
//try
|
||||
//{
|
||||
// var db = new EEEntitiesMain();
|
||||
// var dr = db.EETGW_LoginInfo.Where(t => t.uid == FCOMMON.info.Login.no).FirstOrDefault();
|
||||
// if (dr != null)
|
||||
// {
|
||||
// db.EETGW_LoginInfo.Remove(dr);
|
||||
// db.SaveChanges();
|
||||
// }
|
||||
//}
|
||||
//catch { }
|
||||
}
|
||||
|
||||
private void __Closing(object sender, FormClosingEventArgs e)
|
||||
@@ -70,7 +103,7 @@ namespace Project
|
||||
Pub.init();
|
||||
|
||||
setToolbar();
|
||||
|
||||
|
||||
|
||||
_SetLang();
|
||||
if (Pub.setting.FullScreen) this.WindowState = FormWindowState.Maximized;
|
||||
@@ -91,10 +124,19 @@ namespace Project
|
||||
Update_Site();
|
||||
bw.RunWorkerAsync(); //background worker
|
||||
|
||||
|
||||
|
||||
//사용기록추적
|
||||
Pub.CheckNRegister2(Application.ProductName, "chi", Application.ProductVersion);
|
||||
Pub.CheckNRegister3(Application.ProductName, "chi", Application.ProductVersion);
|
||||
|
||||
//서버ON
|
||||
try
|
||||
{
|
||||
this.server.Start(7979);//기본 79포트로 설정한다
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine(ex.Message);
|
||||
}
|
||||
|
||||
}
|
||||
void Update_Site()
|
||||
{
|
||||
@@ -131,7 +173,7 @@ namespace Project
|
||||
this.mn_eq.Visible = FCOMMON.Util.getBit(FCOMMON.info.Login.gpermission, (int)FCOMMON.eGroupPermission.menu_equipment);
|
||||
this.mn_kuntae.Visible = FCOMMON.Util.getBit(FCOMMON.info.Login.gpermission, (int)FCOMMON.eGroupPermission.menu_workday);
|
||||
this.mn_docu.Visible = FCOMMON.Util.getBit(FCOMMON.info.Login.gpermission, (int)FCOMMON.eGroupPermission.menu_docu);
|
||||
//this.mn_logdata.Visible = FCOMMON.Util.getBit(FCOMMON.info.Login.gpermission, (int)FCOMMON.eGroupPermission.menu_logdata);
|
||||
//this.mn_logdata.Visible = FCOMMON.Util.getBit(FCOMMON.info.Login.gpermission, (int)FCOMMON.eGroupPermission.menu_logdata);
|
||||
|
||||
if (FCOMMON.info.Login.level >= 10) btDev.Visible = true;
|
||||
|
||||
@@ -157,7 +199,7 @@ namespace Project
|
||||
var menu_logdata = FCOMMON.Util.getBit(FCOMMON.info.Login.gpermission, (int)FCOMMON.eGroupPermission.menu_logdata);
|
||||
|
||||
|
||||
// Menu_Note();
|
||||
// Menu_Note();
|
||||
|
||||
//시작폼 확인
|
||||
if (Pub.setting.startForm == eFormList.NR구매관리 && menu_purchaseVisible == true)
|
||||
@@ -180,7 +222,7 @@ namespace Project
|
||||
{
|
||||
Menu_InventoryList();
|
||||
}
|
||||
else if(Pub.setting.startForm == eFormList.근태입력)
|
||||
else if (Pub.setting.startForm == eFormList.근태입력)
|
||||
{
|
||||
Menu_WorkTable();
|
||||
}
|
||||
@@ -802,10 +844,10 @@ namespace Project
|
||||
if (!ShowForm(formkey))
|
||||
AddForm(formkey, new FCM0000.fMailform());
|
||||
}
|
||||
|
||||
|
||||
private void mn_logdata_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void 임의테이블조작ToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
@@ -852,16 +894,16 @@ namespace Project
|
||||
var supplyname = cmdupdate.ExecuteScalar().ToString().Trim();
|
||||
if (supplyname != "")
|
||||
{
|
||||
cmdupdate.CommandText = "update Purchase set supply=@supply where pdate = '2019-08-01' and orderno = '210000657' and sid='" + sid + "'" ;
|
||||
cmdupdate.CommandText = "update Purchase set supply=@supply where pdate = '2019-08-01' and orderno = '210000657' and sid='" + sid + "'";
|
||||
cmdupdate.Parameters["supply"].Value = supplyname;
|
||||
if (cmdupdate.ExecuteNonQuery() > 0) sidOK = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(sidOK == false && itemname != "")
|
||||
|
||||
if (sidOK == false && itemname != "")
|
||||
{
|
||||
if(itemname == "FIBER SENSOR(반사형)")
|
||||
if (itemname == "FIBER SENSOR(반사형)")
|
||||
{
|
||||
|
||||
}
|
||||
@@ -873,12 +915,12 @@ namespace Project
|
||||
var supplyname = data.ToString().Trim();
|
||||
if (supplyname != "")
|
||||
{
|
||||
cmdupdate.CommandText = "update Purchase set supply=@supply where pdate = '2019-08-01' and orderno = '210000657' and pumname='" + itemname + "' and isnull(pumscale,'') = '"+ itemmodel +"'";
|
||||
cmdupdate.CommandText = "update Purchase set supply=@supply where pdate = '2019-08-01' and orderno = '210000657' and pumname='" + itemname + "' and isnull(pumscale,'') = '" + itemmodel + "'";
|
||||
cmdupdate.Parameters["supply"].Value = supplyname;
|
||||
var cnt1 = cmdupdate.ExecuteNonQuery();
|
||||
var cnt1 = cmdupdate.ExecuteNonQuery();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -898,28 +940,28 @@ namespace Project
|
||||
|
||||
private void sMTRepairLogToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void 메일양식ToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
string formkey = "MAILFORM";
|
||||
if (!ShowForm(formkey))
|
||||
AddForm(formkey, new FCM0000.fMailform());
|
||||
AddForm(formkey, new FCM0000.fMailform());
|
||||
}
|
||||
|
||||
private void 메일전송ToolStripMenuItem1_Click(object sender, EventArgs e)
|
||||
{
|
||||
string formkey = "AUTOMAIL";
|
||||
if (!ShowForm(formkey))
|
||||
AddForm(formkey, new FCM0000.Mail.fAutoSendSetting());
|
||||
AddForm(formkey, new FCM0000.Mail.fAutoSendSetting());
|
||||
}
|
||||
|
||||
private void 메일내역ToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
string formkey = "MAILLIST";
|
||||
if (!ShowForm(formkey))
|
||||
AddForm(formkey, new FCM0000.Mail.fMailList());
|
||||
AddForm(formkey, new FCM0000.Mail.fMailList());
|
||||
}
|
||||
|
||||
private void toolStripMenuItem5_Click(object sender, EventArgs e)
|
||||
@@ -988,7 +1030,7 @@ namespace Project
|
||||
|
||||
private void 휴가관리ToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void 근태입력ToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
|
||||
Reference in New Issue
Block a user