chat 서버 기능 추가

This commit is contained in:
chi
2020-11-12 13:11:04 +09:00
parent ce56a715f0
commit 1d7a24adbe
22 changed files with 659 additions and 90 deletions

View File

@@ -105,7 +105,7 @@ namespace FBS0000
fpSpread1_Sheet1.Cells[rowindex, 3].Value = item.name;
//이월잔액
var jand = qta.WorkUserJan_Yesterday_Day(FCOMMON.info.Login.gcode, item.empno, sd.ToShortDateString());
var jand = qta.WorkUserJan_Yesterday_Day(FCOMMON.info.Login.gcode, item.empno,sd.ToString("yyyy-01-01"), sd.ToShortDateString(),"999999");
var used = 0.0;
fpSpread1_Sheet1.Rows[rowindex].ResetBorder();

View File

@@ -79,6 +79,7 @@ namespace FBS0000
//일반사용자의경우에는 상태를 변경하지 못한다.
int curLevel = Math.Max(FCOMMON.info.Login.level, FCOMMON.DBM.getAuth(FCOMMON.DBM.eAuthType.holyday));
curLevel = 5;
if (curLevel >= 5)
{
//권한이 잇으므로 모든 사용자로 한다.
@@ -179,9 +180,11 @@ namespace FBS0000
var dr = this.dsMSSQL.Holyday.Rows[drindex] as dsMSSQL.HolydayRow;
this.fpSpread1.ActiveSheet.Cells[i, col_name].Value = dr.UserName;
var fistdate = dr.sdate.ToString("yyyy-01-01");
//이 사용자의 이전까지의 잔량을 가져온다
var yjand = qta.WorkUserJan_Yesterday_Day(FCOMMON.info.Login.gcode, dr.uid, dr.sdate.ToShortDateString());
var yjanh = qta.WorkUserJan_YesterDay_Time(FCOMMON.info.Login.gcode, dr.uid, dr.sdate.ToShortDateString());
var yjand = qta.WorkUserJan_Yesterday_Day(FCOMMON.info.Login.gcode, dr.uid, fistdate, dr.sdate.ToShortDateString(),dr.idx.ToString("000000"));
var yjanh = qta.WorkUserJan_YesterDay_Time(FCOMMON.info.Login.gcode, dr.uid, fistdate, dr.sdate.ToShortDateString(), dr.idx.ToString("000000"));
var jand = yjand + dr.termDr - dr.term;
var janh = yjanh + dr.DrTime - dr.CrTime;
this.fpSpread1.ActiveSheet.Cells[i, col_yjand].Value = yjand;
@@ -235,8 +238,12 @@ namespace FBS0000
fpSpread1.ActiveSheet.Cells[rowindex, col_name].Value = username;
//이 사용자의 이전까지의 잔량을 가져온다
var yjand = qta.WorkUserJan_Yesterday_Day(FCOMMON.info.Login.gcode, this.seluid, newdr.sdate.ToShortDateString());
var yjanh = qta.WorkUserJan_YesterDay_Time(FCOMMON.info.Login.gcode, seluid, newdr.sdate.ToShortDateString());
var fistdate = newdr.sdate.ToString("yyyy-01-01");
var yjand = 0;// qta.WorkUserJan_Yesterday_Day(FCOMMON.info.Login.gcode, this.seluid, fistdate, newdr.sdate.ToShortDateString(),"999999");
var yjanh = 0;// qta.WorkUserJan_YesterDay_Time(FCOMMON.info.Login.gcode, seluid, fistdate, newdr.sdate.ToShortDateString(), "999999");
//var jand = yjand + dr.termDr - dr.term;
//var janh = yjanh + dr.DrTime - dr.CrTime;
this.fpSpread1.ActiveSheet.Cells[rowindex, col_yjand].Value = yjand;
@@ -338,6 +345,7 @@ namespace FBS0000
this.dsMSSQL.Holyday.AddHolydayRow(newdr);
}
private void toolStripButton4_Click(object sender, EventArgs e)
{
if (this.cmbUser.SelectedIndex < 0)
@@ -347,7 +355,7 @@ namespace FBS0000
}
string uid = GetUIDValue();
var f = new fHolydayJobReport(tbSD.Text, tbED.Text, uid);
f.ShowDialog();
f.Show();
}
private void toolStripButton5_Click(object sender, EventArgs e)
@@ -355,7 +363,7 @@ namespace FBS0000
var sd = DateTime.Now.ToString("yyyy-MM-01");
var ed = DateTime.Parse(DateTime.Now.AddMonths(1).ToString("yyyy-MM-01")).AddDays(-1).ToShortDateString();
var f = new WorkTable(sd, ed, this.cmbGrp.Text);
f.ShowDialog();
f.Show();
}
private void toolStripButton6_Click(object sender, EventArgs e)
@@ -388,8 +396,8 @@ namespace FBS0000
var pdate = ((DateTime)cell.Value).ToString("yyyy-MM-dd");
var empno = fpSpread1.ActiveSheet.Cells[cell.Row.Index, fpSpread1.ActiveSheet.Columns["empno"].Index].Value.ToString();
var ta = new dsMSSQLTableAdapters.QueriesTableAdapter();
var jand = ta.WorkUserJan_Yesterday_Day(FCOMMON.info.Login.gcode, empno, pdate);
var janh = ta.WorkUserJan_YesterDay_Time(FCOMMON.info.Login.gcode, empno, pdate);
var jand = 0;// ta.WorkUserJan_Yesterday_Day(FCOMMON.info.Login.gcode, empno, pdate);
var janh = 0;// ta.WorkUserJan_YesterDay_Time(FCOMMON.info.Login.gcode, empno, pdate);
fpSpread1.ActiveSheet.Cells[cell.Row.Index, fpSpread1.ActiveSheet.Columns["yjand"].Index].Value = jand;
fpSpread1.ActiveSheet.Cells[cell.Row.Index, fpSpread1.ActiveSheet.Columns["yjanh"].Index].Value = janh;
@@ -411,8 +419,8 @@ namespace FBS0000
//전일잔액표시
var ta = new dsMSSQLTableAdapters.QueriesTableAdapter();
var jand = ta.WorkUserJan_Yesterday_Day(FCOMMON.info.Login.gcode, empno, pdate);
var janh = ta.WorkUserJan_YesterDay_Time(FCOMMON.info.Login.gcode, empno, pdate);
var jand = 0;// ta.WorkUserJan_Yesterday_Day(FCOMMON.info.Login.gcode, empno, pdate);
var janh = 0;// ta.WorkUserJan_YesterDay_Time(FCOMMON.info.Login.gcode, empno, pdate);
fpSpread1.ActiveSheet.Cells[cell.Row.Index, fpSpread1.ActiveSheet.Columns["yjand"].Index].Value = jand;
fpSpread1.ActiveSheet.Cells[cell.Row.Index, fpSpread1.ActiveSheet.Columns["yjanh"].Index].Value = janh;
@@ -430,8 +438,8 @@ namespace FBS0000
{
//전일잔액표시
var ta = new dsMSSQLTableAdapters.QueriesTableAdapter();
var jand = ta.WorkUserJan_Yesterday_Day(FCOMMON.info.Login.gcode, flov.dr.empno, pdate);
var janh = ta.WorkUserJan_YesterDay_Time(FCOMMON.info.Login.gcode, flov.dr.empno, pdate);
var jand = 0;// ta.WorkUserJan_Yesterday_Day(FCOMMON.info.Login.gcode, flov.dr.empno, pdate);
var janh = 0;// ta.WorkUserJan_YesterDay_Time(FCOMMON.info.Login.gcode, flov.dr.empno, pdate);
fpSpread1.ActiveSheet.Cells[cell.Row.Index, fpSpread1.ActiveSheet.Columns["yjand"].Index].Value = jand;
fpSpread1.ActiveSheet.Cells[cell.Row.Index, fpSpread1.ActiveSheet.Columns["yjanh"].Index].Value = janh;

View File

@@ -7760,19 +7760,27 @@ SELECT idx, gcode, grp, seq, grade, empno, name, wuid, wdate, indate, email FROM
this._commandCollection[1] = new global::System.Data.SqlClient.SqlCommand();
((global::System.Data.SqlClient.SqlCommand)(this._commandCollection[1])).Connection = new global::System.Data.SqlClient.SqlConnection(global::FBS0000.Properties.Settings.Default.gwcs);
((global::System.Data.SqlClient.SqlCommand)(this._commandCollection[1])).CommandText = "SELECT ISNULL(SUM(termDr), 0) - ISNULL(SUM(term), 0) AS jan\r\nFROM Holyday\r\nW" +
"HERE (gcode = @gcode) AND (uid = @uid) AND (sdate < @pdate)";
"HERE (gcode = @gcode) AND (uid = @uid) AND (CONVERT(CHAR(10), sdate, 23) >= @fi" +
"rstdate) AND (CONVERT(CHAR(10), sdate, 23) + dbo.PadLeft(idx, \'0\', 6) < @pdate +" +
" @idxlen6)";
((global::System.Data.SqlClient.SqlCommand)(this._commandCollection[1])).CommandType = global::System.Data.CommandType.Text;
((global::System.Data.SqlClient.SqlCommand)(this._commandCollection[1])).Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@gcode", global::System.Data.SqlDbType.VarChar, 10, global::System.Data.ParameterDirection.Input, 0, 0, "gcode", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
((global::System.Data.SqlClient.SqlCommand)(this._commandCollection[1])).Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@uid", global::System.Data.SqlDbType.VarChar, 20, global::System.Data.ParameterDirection.Input, 0, 0, "uid", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
((global::System.Data.SqlClient.SqlCommand)(this._commandCollection[1])).Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@pdate", global::System.Data.SqlDbType.Date, 3, global::System.Data.ParameterDirection.Input, 0, 0, "sdate", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
((global::System.Data.SqlClient.SqlCommand)(this._commandCollection[1])).Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@firstdate", global::System.Data.SqlDbType.VarChar, 1024, global::System.Data.ParameterDirection.Input, 0, 0, "", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
((global::System.Data.SqlClient.SqlCommand)(this._commandCollection[1])).Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@pdate", global::System.Data.SqlDbType.VarChar, 1024, global::System.Data.ParameterDirection.Input, 0, 0, "", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
((global::System.Data.SqlClient.SqlCommand)(this._commandCollection[1])).Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@idxlen6", global::System.Data.SqlDbType.VarChar, 1024, global::System.Data.ParameterDirection.Input, 0, 0, "", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
this._commandCollection[2] = new global::System.Data.SqlClient.SqlCommand();
((global::System.Data.SqlClient.SqlCommand)(this._commandCollection[2])).Connection = new global::System.Data.SqlClient.SqlConnection(global::FBS0000.Properties.Settings.Default.gwcs);
((global::System.Data.SqlClient.SqlCommand)(this._commandCollection[2])).CommandText = "SELECT ISNULL(SUM(DrTime), 0) - ISNULL(SUM(CrTime), 0) AS jan\r\nFROM Holyday\r" +
"\nWHERE (gcode = @gcode) AND (uid = @uid) AND (sdate < @pdate)";
"\nWHERE (gcode = @gcode) AND (uid = @uid) AND (CONVERT(CHAR(10), sdate, 23) >= @" +
"firstdate) AND (CONVERT(CHAR(10), sdate, 23) + dbo.PadLeft(idx, \'0\', 6) < @pdate" +
" + @idxlen6)";
((global::System.Data.SqlClient.SqlCommand)(this._commandCollection[2])).CommandType = global::System.Data.CommandType.Text;
((global::System.Data.SqlClient.SqlCommand)(this._commandCollection[2])).Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@gcode", global::System.Data.SqlDbType.VarChar, 10, global::System.Data.ParameterDirection.Input, 0, 0, "gcode", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
((global::System.Data.SqlClient.SqlCommand)(this._commandCollection[2])).Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@uid", global::System.Data.SqlDbType.VarChar, 20, global::System.Data.ParameterDirection.Input, 0, 0, "uid", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
((global::System.Data.SqlClient.SqlCommand)(this._commandCollection[2])).Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@pdate", global::System.Data.SqlDbType.Date, 3, global::System.Data.ParameterDirection.Input, 0, 0, "sdate", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
((global::System.Data.SqlClient.SqlCommand)(this._commandCollection[2])).Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@firstdate", global::System.Data.SqlDbType.VarChar, 1024, global::System.Data.ParameterDirection.Input, 0, 0, "", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
((global::System.Data.SqlClient.SqlCommand)(this._commandCollection[2])).Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@pdate", global::System.Data.SqlDbType.VarChar, 1024, global::System.Data.ParameterDirection.Input, 0, 0, "", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
((global::System.Data.SqlClient.SqlCommand)(this._commandCollection[2])).Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@idxlen6", global::System.Data.SqlDbType.VarChar, 1024, global::System.Data.ParameterDirection.Input, 0, 0, "", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
@@ -7818,7 +7826,7 @@ SELECT idx, gcode, grp, seq, grade, empno, name, wuid, wdate, indate, email FROM
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
[global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
public virtual global::System.Nullable<double> WorkUserJan_Yesterday_Day(string gcode, string uid, string pdate) {
public virtual global::System.Nullable<double> WorkUserJan_Yesterday_Day(string gcode, string uid, string firstdate, string pdate, string idxlen6) {
global::System.Data.SqlClient.SqlCommand command = ((global::System.Data.SqlClient.SqlCommand)(this.CommandCollection[1]));
if ((gcode == null)) {
throw new global::System.ArgumentNullException("gcode");
@@ -7832,11 +7840,23 @@ SELECT idx, gcode, grp, seq, grade, empno, name, wuid, wdate, indate, email FROM
else {
command.Parameters[1].Value = ((string)(uid));
}
if ((pdate == null)) {
command.Parameters[2].Value = global::System.DBNull.Value;
if ((firstdate == null)) {
throw new global::System.ArgumentNullException("firstdate");
}
else {
command.Parameters[2].Value = ((string)(pdate));
command.Parameters[2].Value = ((string)(firstdate));
}
if ((pdate == null)) {
throw new global::System.ArgumentNullException("pdate");
}
else {
command.Parameters[3].Value = ((string)(pdate));
}
if ((idxlen6 == null)) {
throw new global::System.ArgumentNullException("idxlen6");
}
else {
command.Parameters[4].Value = ((string)(idxlen6));
}
global::System.Data.ConnectionState previousConnectionState = command.Connection.State;
if (((command.Connection.State & global::System.Data.ConnectionState.Open)
@@ -7864,7 +7884,7 @@ SELECT idx, gcode, grp, seq, grade, empno, name, wuid, wdate, indate, email FROM
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
[global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
public virtual global::System.Nullable<double> WorkUserJan_YesterDay_Time(string gcode, string uid, string pdate) {
public virtual global::System.Nullable<double> WorkUserJan_YesterDay_Time(string gcode, string uid, string firstdate, string pdate, string idxlen6) {
global::System.Data.SqlClient.SqlCommand command = ((global::System.Data.SqlClient.SqlCommand)(this.CommandCollection[2]));
if ((gcode == null)) {
throw new global::System.ArgumentNullException("gcode");
@@ -7878,11 +7898,23 @@ SELECT idx, gcode, grp, seq, grade, empno, name, wuid, wdate, indate, email FROM
else {
command.Parameters[1].Value = ((string)(uid));
}
if ((pdate == null)) {
command.Parameters[2].Value = global::System.DBNull.Value;
if ((firstdate == null)) {
throw new global::System.ArgumentNullException("firstdate");
}
else {
command.Parameters[2].Value = ((string)(pdate));
command.Parameters[2].Value = ((string)(firstdate));
}
if ((pdate == null)) {
throw new global::System.ArgumentNullException("pdate");
}
else {
command.Parameters[3].Value = ((string)(pdate));
}
if ((idxlen6 == null)) {
throw new global::System.ArgumentNullException("idxlen6");
}
else {
command.Parameters[4].Value = ((string)(idxlen6));
}
global::System.Data.ConnectionState previousConnectionState = command.Connection.State;
if (((command.Connection.State & global::System.Data.ConnectionState.Open)

View File

@@ -625,11 +625,13 @@ WHERE (gcode = @gcode) AND (empno = @empno)</CommandText>
<DbCommand CommandType="Text" ModifiedByUser="true">
<CommandText>SELECT ISNULL(SUM(termDr), 0) - ISNULL(SUM(term), 0) AS jan
FROM Holyday
WHERE (gcode = @gcode) AND (uid = @uid) AND (sdate &lt; @pdate)</CommandText>
WHERE (gcode = @gcode) AND (uid = @uid) AND (CONVERT(CHAR(10), sdate, 23) &gt;= @firstdate) AND (CONVERT(CHAR(10), sdate, 23) + dbo.PadLeft(idx, '0', 6) &lt; @pdate + @idxlen6)</CommandText>
<Parameters>
<Parameter AllowDbNull="false" AutogeneratedName="gcode" ColumnName="gcode" DataSourceName="EE.dbo.Holyday" DataTypeServer="varchar(10)" DbType="AnsiString" Direction="Input" ParameterName="@gcode" Precision="0" ProviderType="VarChar" Scale="0" Size="10" SourceColumn="gcode" SourceColumnNullMapping="false" SourceVersion="Current" />
<Parameter AllowDbNull="true" AutogeneratedName="uid" ColumnName="uid" DataSourceName="EE.dbo.Holyday" DataTypeServer="varchar(20)" DbType="AnsiString" Direction="Input" ParameterName="@uid" Precision="0" ProviderType="VarChar" Scale="0" Size="20" SourceColumn="uid" SourceColumnNullMapping="false" SourceVersion="Current" />
<Parameter AllowDbNull="true" AutogeneratedName="pdate" ColumnName="sdate" DataSourceName="EE.dbo.Holyday" DataTypeServer="date" DbType="AnsiString" Direction="Input" ParameterName="@pdate" Precision="0" ProviderType="Date" Scale="0" Size="3" SourceColumn="sdate" SourceColumnNullMapping="false" SourceVersion="Current" />
<Parameter AllowDbNull="false" AutogeneratedName="firstdate" ColumnName="" DataSourceName="" DataTypeServer="unknown" DbType="AnsiString" Direction="Input" ParameterName="@firstdate" Precision="0" Scale="0" Size="1024" SourceColumn="" SourceColumnNullMapping="false" SourceVersion="Current" />
<Parameter AllowDbNull="false" AutogeneratedName="pdate" ColumnName="" DataSourceName="" DataTypeServer="unknown" DbType="AnsiString" Direction="Input" ParameterName="@pdate" Precision="0" Scale="0" Size="1024" SourceColumn="" SourceColumnNullMapping="false" SourceVersion="Current" />
<Parameter AllowDbNull="false" AutogeneratedName="idxlen6" ColumnName="" DataSourceName="" DataTypeServer="unknown" DbType="AnsiString" Direction="Input" ParameterName="@idxlen6" Precision="0" Scale="0" Size="1024" SourceColumn="" SourceColumnNullMapping="false" SourceVersion="Current" />
</Parameters>
</DbCommand>
</SelectCommand>
@@ -639,11 +641,13 @@ WHERE (gcode = @gcode) AND (uid = @uid) AND (sdate &lt; @pdate)</CommandText>
<DbCommand CommandType="Text" ModifiedByUser="true">
<CommandText>SELECT ISNULL(SUM(DrTime), 0) - ISNULL(SUM(CrTime), 0) AS jan
FROM Holyday
WHERE (gcode = @gcode) AND (uid = @uid) AND (sdate &lt; @pdate)</CommandText>
WHERE (gcode = @gcode) AND (uid = @uid) AND (CONVERT(CHAR(10), sdate, 23) &gt;= @firstdate) AND (CONVERT(CHAR(10), sdate, 23) + dbo.PadLeft(idx, '0', 6) &lt; @pdate + @idxlen6)</CommandText>
<Parameters>
<Parameter AllowDbNull="false" AutogeneratedName="gcode" ColumnName="gcode" DataSourceName="EE.dbo.Holyday" DataTypeServer="varchar(10)" DbType="AnsiString" Direction="Input" ParameterName="@gcode" Precision="0" ProviderType="VarChar" Scale="0" Size="10" SourceColumn="gcode" SourceColumnNullMapping="false" SourceVersion="Current" />
<Parameter AllowDbNull="true" AutogeneratedName="uid" ColumnName="uid" DataSourceName="EE.dbo.Holyday" DataTypeServer="varchar(20)" DbType="AnsiString" Direction="Input" ParameterName="@uid" Precision="0" ProviderType="VarChar" Scale="0" Size="20" SourceColumn="uid" SourceColumnNullMapping="false" SourceVersion="Current" />
<Parameter AllowDbNull="true" AutogeneratedName="pdate" ColumnName="sdate" DataSourceName="EE.dbo.Holyday" DataTypeServer="date" DbType="AnsiString" Direction="Input" ParameterName="@pdate" Precision="0" ProviderType="Date" Scale="0" Size="3" SourceColumn="sdate" SourceColumnNullMapping="false" SourceVersion="Current" />
<Parameter AllowDbNull="false" AutogeneratedName="firstdate" ColumnName="" DataSourceName="" DataTypeServer="unknown" DbType="AnsiString" Direction="Input" ParameterName="@firstdate" Precision="0" Scale="0" Size="1024" SourceColumn="" SourceColumnNullMapping="false" SourceVersion="Current" />
<Parameter AllowDbNull="false" AutogeneratedName="pdate" ColumnName="" DataSourceName="" DataTypeServer="unknown" DbType="AnsiString" Direction="Input" ParameterName="@pdate" Precision="0" Scale="0" Size="1024" SourceColumn="" SourceColumnNullMapping="false" SourceVersion="Current" />
<Parameter AllowDbNull="false" AutogeneratedName="idxlen6" ColumnName="" DataSourceName="" DataTypeServer="unknown" DbType="AnsiString" Direction="Input" ParameterName="@idxlen6" Precision="0" Scale="0" Size="1024" SourceColumn="" SourceColumnNullMapping="false" SourceVersion="Current" />
</Parameters>
</DbCommand>
</SelectCommand>