프로젝트 목록 열 너비를 좀더 줄임 (낮은해상도에서 좀더 보이게)

This commit is contained in:
chi
2020-01-20 09:44:26 +09:00
parent 178c295587
commit 5e0088cdfe
8 changed files with 277 additions and 168 deletions

View File

@@ -30,18 +30,18 @@
{
this.components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(fJobReport));
FarPoint.Win.Spread.CellType.TextCellType textCellType1 = new FarPoint.Win.Spread.CellType.TextCellType();
FarPoint.Win.Spread.CellType.TextCellType textCellType2 = new FarPoint.Win.Spread.CellType.TextCellType();
FarPoint.Win.Spread.CellType.TextCellType textCellType3 = new FarPoint.Win.Spread.CellType.TextCellType();
FarPoint.Win.Spread.CellType.TextCellType textCellType4 = new FarPoint.Win.Spread.CellType.TextCellType();
FarPoint.Win.Spread.CellType.TextCellType textCellType5 = new FarPoint.Win.Spread.CellType.TextCellType();
FarPoint.Win.Spread.CellType.TextCellType textCellType6 = new FarPoint.Win.Spread.CellType.TextCellType();
FarPoint.Win.Spread.CellType.TextCellType textCellType7 = new FarPoint.Win.Spread.CellType.TextCellType();
FarPoint.Win.Spread.CellType.TextCellType textCellType8 = new FarPoint.Win.Spread.CellType.TextCellType();
FarPoint.Win.Spread.CellType.NumberCellType numberCellType1 = new FarPoint.Win.Spread.CellType.NumberCellType();
FarPoint.Win.Spread.CellType.NumberCellType numberCellType2 = new FarPoint.Win.Spread.CellType.NumberCellType();
FarPoint.Win.Spread.CellType.NumberCellType numberCellType3 = new FarPoint.Win.Spread.CellType.NumberCellType();
FarPoint.Win.Spread.CellType.TextCellType textCellType9 = new FarPoint.Win.Spread.CellType.TextCellType();
FarPoint.Win.Spread.CellType.TextCellType textCellType19 = new FarPoint.Win.Spread.CellType.TextCellType();
FarPoint.Win.Spread.CellType.TextCellType textCellType20 = new FarPoint.Win.Spread.CellType.TextCellType();
FarPoint.Win.Spread.CellType.TextCellType textCellType21 = new FarPoint.Win.Spread.CellType.TextCellType();
FarPoint.Win.Spread.CellType.TextCellType textCellType22 = new FarPoint.Win.Spread.CellType.TextCellType();
FarPoint.Win.Spread.CellType.TextCellType textCellType23 = new FarPoint.Win.Spread.CellType.TextCellType();
FarPoint.Win.Spread.CellType.TextCellType textCellType24 = new FarPoint.Win.Spread.CellType.TextCellType();
FarPoint.Win.Spread.CellType.TextCellType textCellType25 = new FarPoint.Win.Spread.CellType.TextCellType();
FarPoint.Win.Spread.CellType.TextCellType textCellType26 = new FarPoint.Win.Spread.CellType.TextCellType();
FarPoint.Win.Spread.CellType.NumberCellType numberCellType7 = new FarPoint.Win.Spread.CellType.NumberCellType();
FarPoint.Win.Spread.CellType.NumberCellType numberCellType8 = new FarPoint.Win.Spread.CellType.NumberCellType();
FarPoint.Win.Spread.CellType.NumberCellType numberCellType9 = new FarPoint.Win.Spread.CellType.NumberCellType();
FarPoint.Win.Spread.CellType.TextCellType textCellType27 = new FarPoint.Win.Spread.CellType.TextCellType();
this.bn = new System.Windows.Forms.BindingNavigator(this.components);
this.bs = new System.Windows.Forms.BindingSource(this.components);
this.dsMSSQL = new FPJ0000.dsPRJ();
@@ -96,6 +96,8 @@
this.cmbUser = new System.Windows.Forms.ToolStripComboBox();
this.btSearch = new System.Windows.Forms.ToolStripButton();
this.toolStripButton2 = new System.Windows.Forms.ToolStripButton();
this.toolStripLabel1 = new System.Windows.Forms.ToolStripLabel();
this.cmbProcess = new System.Windows.Forms.ToolStripComboBox();
((System.ComponentModel.ISupportInitialize)(this.bn)).BeginInit();
this.bn.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.bs)).BeginInit();
@@ -499,71 +501,71 @@
this.fpSpread1_Sheet1.ColumnHeader.Cells.Get(0, 10).Value = "초과";
this.fpSpread1_Sheet1.ColumnHeader.Cells.Get(0, 11).Value = "비고";
this.fpSpread1_Sheet1.ColumnHeader.Rows.Get(0).Height = 28F;
this.fpSpread1_Sheet1.Columns.Get(0).CellType = textCellType1;
this.fpSpread1_Sheet1.Columns.Get(0).CellType = textCellType19;
this.fpSpread1_Sheet1.Columns.Get(0).DataField = "pdate";
this.fpSpread1_Sheet1.Columns.Get(0).Label = "날짜";
this.fpSpread1_Sheet1.Columns.Get(0).Width = 58F;
this.fpSpread1_Sheet1.Columns.Get(1).BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));
this.fpSpread1_Sheet1.Columns.Get(1).CellType = textCellType2;
this.fpSpread1_Sheet1.Columns.Get(1).CellType = textCellType20;
this.fpSpread1_Sheet1.Columns.Get(1).DataField = "ww";
this.fpSpread1_Sheet1.Columns.Get(1).HorizontalAlignment = FarPoint.Win.Spread.CellHorizontalAlignment.Center;
this.fpSpread1_Sheet1.Columns.Get(1).Label = "WW";
this.fpSpread1_Sheet1.Columns.Get(1).VerticalAlignment = FarPoint.Win.Spread.CellVerticalAlignment.Center;
this.fpSpread1_Sheet1.Columns.Get(2).AllowAutoFilter = true;
this.fpSpread1_Sheet1.Columns.Get(2).CellType = textCellType3;
this.fpSpread1_Sheet1.Columns.Get(2).CellType = textCellType21;
this.fpSpread1_Sheet1.Columns.Get(2).DataField = "requestpart";
this.fpSpread1_Sheet1.Columns.Get(2).Label = "요청부서";
this.fpSpread1_Sheet1.Columns.Get(2).Width = 78F;
this.fpSpread1_Sheet1.Columns.Get(3).AllowAutoFilter = true;
this.fpSpread1_Sheet1.Columns.Get(3).CellType = textCellType4;
this.fpSpread1_Sheet1.Columns.Get(3).CellType = textCellType22;
this.fpSpread1_Sheet1.Columns.Get(3).DataField = "package";
this.fpSpread1_Sheet1.Columns.Get(3).Label = "패키지";
this.fpSpread1_Sheet1.Columns.Get(3).Width = 86F;
this.fpSpread1_Sheet1.Columns.Get(4).CellType = textCellType5;
this.fpSpread1_Sheet1.Columns.Get(4).CellType = textCellType23;
this.fpSpread1_Sheet1.Columns.Get(4).DataField = "status";
this.fpSpread1_Sheet1.Columns.Get(4).Label = "상태";
this.fpSpread1_Sheet1.Columns.Get(5).AllowAutoFilter = true;
this.fpSpread1_Sheet1.Columns.Get(5).CellType = textCellType6;
this.fpSpread1_Sheet1.Columns.Get(5).CellType = textCellType24;
this.fpSpread1_Sheet1.Columns.Get(5).DataField = "type";
this.fpSpread1_Sheet1.Columns.Get(5).Label = "업무형태";
this.fpSpread1_Sheet1.Columns.Get(5).Width = 84F;
this.fpSpread1_Sheet1.Columns.Get(6).AllowAutoFilter = true;
this.fpSpread1_Sheet1.Columns.Get(6).CellType = textCellType7;
this.fpSpread1_Sheet1.Columns.Get(6).CellType = textCellType25;
this.fpSpread1_Sheet1.Columns.Get(6).DataField = "process";
this.fpSpread1_Sheet1.Columns.Get(6).HorizontalAlignment = FarPoint.Win.Spread.CellHorizontalAlignment.Left;
this.fpSpread1_Sheet1.Columns.Get(6).Label = "업무분류";
this.fpSpread1_Sheet1.Columns.Get(6).VerticalAlignment = FarPoint.Win.Spread.CellVerticalAlignment.Center;
this.fpSpread1_Sheet1.Columns.Get(6).Width = 80F;
this.fpSpread1_Sheet1.Columns.Get(7).AllowAutoFilter = true;
this.fpSpread1_Sheet1.Columns.Get(7).CellType = textCellType8;
this.fpSpread1_Sheet1.Columns.Get(7).CellType = textCellType26;
this.fpSpread1_Sheet1.Columns.Get(7).DataField = "projectName";
this.fpSpread1_Sheet1.Columns.Get(7).Label = "프로젝트(아이템)";
this.fpSpread1_Sheet1.Columns.Get(7).Width = 158F;
this.fpSpread1_Sheet1.Columns.Get(8).BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));
numberCellType1.DecimalPlaces = 0;
numberCellType1.LeadingZero = FarPoint.Win.Spread.CellType.LeadingZero.Yes;
numberCellType1.MaximumValue = 2147483647D;
numberCellType1.MinimumValue = -2147483648D;
this.fpSpread1_Sheet1.Columns.Get(8).CellType = numberCellType1;
numberCellType7.DecimalPlaces = 0;
numberCellType7.LeadingZero = FarPoint.Win.Spread.CellType.LeadingZero.Yes;
numberCellType7.MaximumValue = 2147483647D;
numberCellType7.MinimumValue = -2147483648D;
this.fpSpread1_Sheet1.Columns.Get(8).CellType = numberCellType7;
this.fpSpread1_Sheet1.Columns.Get(8).DataField = "pidx";
this.fpSpread1_Sheet1.Columns.Get(8).Label = "*";
this.fpSpread1_Sheet1.Columns.Get(8).Tag = "pidx";
this.fpSpread1_Sheet1.Columns.Get(8).Width = 39F;
numberCellType2.MaximumValue = 999999999999999D;
numberCellType2.MinimumValue = -999999999999999D;
this.fpSpread1_Sheet1.Columns.Get(9).CellType = numberCellType2;
numberCellType8.MaximumValue = 999999999999999D;
numberCellType8.MinimumValue = -999999999999999D;
this.fpSpread1_Sheet1.Columns.Get(9).CellType = numberCellType8;
this.fpSpread1_Sheet1.Columns.Get(9).DataField = "hrs";
this.fpSpread1_Sheet1.Columns.Get(9).Label = "시간";
this.fpSpread1_Sheet1.Columns.Get(9).Width = 52F;
numberCellType3.MaximumValue = 999999999999999D;
numberCellType3.MinimumValue = -999999999999999D;
this.fpSpread1_Sheet1.Columns.Get(10).CellType = numberCellType3;
numberCellType9.MaximumValue = 999999999999999D;
numberCellType9.MinimumValue = -999999999999999D;
this.fpSpread1_Sheet1.Columns.Get(10).CellType = numberCellType9;
this.fpSpread1_Sheet1.Columns.Get(10).DataField = "ot";
this.fpSpread1_Sheet1.Columns.Get(10).ForeColor = System.Drawing.Color.Red;
this.fpSpread1_Sheet1.Columns.Get(10).HorizontalAlignment = FarPoint.Win.Spread.CellHorizontalAlignment.Center;
this.fpSpread1_Sheet1.Columns.Get(10).Label = "초과";
this.fpSpread1_Sheet1.Columns.Get(10).VerticalAlignment = FarPoint.Win.Spread.CellVerticalAlignment.Center;
this.fpSpread1_Sheet1.Columns.Get(11).CellType = textCellType9;
this.fpSpread1_Sheet1.Columns.Get(11).CellType = textCellType27;
this.fpSpread1_Sheet1.Columns.Get(11).DataField = "description";
this.fpSpread1_Sheet1.Columns.Get(11).HorizontalAlignment = FarPoint.Win.Spread.CellHorizontalAlignment.Left;
this.fpSpread1_Sheet1.Columns.Get(11).Label = "비고";
@@ -584,6 +586,8 @@
this.dtED,
this.lbTime,
this.toolStripSeparator2,
this.toolStripLabel1,
this.cmbProcess,
this.toolStripLabel3,
this.cmbUser,
this.btSearch,
@@ -670,6 +674,20 @@
this.toolStripButton2.Text = "닫기";
this.toolStripButton2.Click += new System.EventHandler(this.toolStripButton2_Click);
//
// toolStripLabel1
//
this.toolStripLabel1.Name = "toolStripLabel1";
this.toolStripLabel1.Size = new System.Drawing.Size(31, 34);
this.toolStripLabel1.Text = "공정";
//
// cmbProcess
//
this.cmbProcess.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbProcess.Name = "cmbProcess";
this.cmbProcess.Size = new System.Drawing.Size(150, 37);
this.cmbProcess.SelectedIndexChanged += new System.EventHandler(this.cmbProcess_SelectedIndexChanged);
this.cmbProcess.Click += new System.EventHandler(this.cmbProcess_Click);
//
// fJobReport
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F);
@@ -753,5 +771,7 @@
private System.Windows.Forms.ToolStripButton toolStripButton1;
private System.Windows.Forms.ToolStripButton toolStripButton2;
private FarPoint.Win.Spread.SheetView fpSpread1_Sheet1;
private System.Windows.Forms.ToolStripLabel toolStripLabel1;
private System.Windows.Forms.ToolStripComboBox cmbProcess;
}
}

View File

@@ -30,34 +30,64 @@ namespace FPJ0000
}
Boolean binit = false;
void UpdateUserList()
{
//담당자목록 - 사용자목록으로 처리한다.
this.cmbUser.Items.Clear();
var taUserList = new dsReportTableAdapters.ProcessUserListTableAdapter();
var processStr = "%";
if (cmbProcess.SelectedIndex > 0) processStr = cmbProcess.Text;
var dtUserList = taUserList.GetData(processStr);
foreach (dsReport.ProcessUserListRow dr in dtUserList)
{
string cmbdata = string.Format("{1}({0})", dr.id, dr.name);
this.cmbUser.Items.Add(cmbdata);
}
}
private void __Load(object sender, EventArgs e)
{
this.dtSD.Text = DateTime.Now.ToString("yyyy-MM-01");
this.dtED.Text = DateTime.Now.ToShortDateString();
//공정목록
var taProc = new dsReportTableAdapters.ProcessListTableAdapter();
var dtProcList = taProc.GetData(FCOMMON.info.Login.gcode);
cmbProcess.Items.Clear();
cmbProcess.Items.Add("--전체--");
foreach (dsReport.ProcessListRow dr in dtProcList)
{
cmbProcess.Items.Add(dr.processs);
}
cmbProcess.Text = FCOMMON.info.Login.process;
if (cmbProcess.SelectedIndex < 0) cmbProcess.SelectedIndex = 0; //공정이 없는 사람은 전체보기로 함
//담당자목록 - 사용자목록으로 처리한다.
string namestr = string.Format("{0}({1})", FCOMMON.info.Login.nameK, FCOMMON.info.Login.no);
if (FCOMMON.info.Login.no == "dev") namestr = "김치균(395552)";
this.cmbUser.Items.Clear();
this.cmbUser.Items.Add(namestr);
var taUserList = new dsReportTableAdapters.ProcessUserListTableAdapter();
// if (FCOMMON.info.Login.no == "dev") namestr = "김치균(395552)";
// this.cmbUser.Items.Add(namestr);
UpdateUserList(); //현재사용자의 이름을 반환한다
cmbUser.Text = namestr;
var processStr = "%";
if (FCOMMON.info.Login.process != "") processStr = FCOMMON.info.Login.process;
var dtUserList = taUserList.GetData(processStr);
foreach(dsReport.ProcessUserListRow dr in dtUserList)
if(cmbUser.SelectedIndex < 0)
{
string cmbdata = string.Format("{1}({0})", dr.id, dr.name);
this.cmbUser.Items.Add(cmbdata);
//내 아이템이 없다면, 목록을 추가해서 선택해줘야 한다
this.cmbUser.Items.Add(namestr);
cmbUser.Text = namestr;
}
//var userList = FCOMMON.DBM.getGroupList("name + '(' + id + ')'", "Users", "[level] > 0 and [level] < 10", false, false);
//foreach (var user in userList)
//{
// this.cmbUser.Items.Add(user);
//}
cmbUser.Text = namestr;
//state list
//var stList = FCOMMON.DBM.getCodeList("05");
@@ -87,9 +117,21 @@ namespace FPJ0000
foreach (FarPoint.Win.Spread.Column col in fpSpread1.ActiveSheet.Columns)
col.Locked = true;
}
refreshData();
binit = true;
}
private void cmbProcess_SelectedIndexChanged(object sender, EventArgs e)
{
if (binit == false) return;
UpdateUserList();
}
private void cmbProcess_Click(object sender, EventArgs e)
{
}
void RefreshTime()
{
@@ -185,7 +227,7 @@ namespace FPJ0000
switch (stateStr.ToLower())
{
case "-1":
this.fpSpread1.ActiveSheet.Rows[i].BackColor = Color.Gold;
this.fpSpread1.ActiveSheet.Rows[i].BackColor = Color.WhiteSmoke;
break;
default:
this.fpSpread1.ActiveSheet.Rows[i].BackColor = SystemColors.Window;
@@ -510,5 +552,7 @@ namespace FPJ0000
{
this.Close();
}
}
}

View File

@@ -246,6 +246,9 @@
GoSrpcVIQqmAj6LZftFBup9vWiUlUQdIDCbsQrsGZRJKBbOXyA++SlEsu6QjvQAAAABJRU5ErkJggg==
</value>
</data>
<metadata name="dsMSSQL.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="cm.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>325, 17</value>
</metadata>

View File

@@ -1,28 +1,28 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace FPJ0000.JobReport
{
public partial class rJobReport : Form
{
public rJobReport()
{
InitializeComponent();
this.WindowState = FormWindowState.Maximized;
}
private void rJobReport_Load(object sender, EventArgs e)
{
this.ta.Fill(this.dsReport.jobReport, DateTime.Now.Year.ToString("0000"),FCOMMON.info.Login.gcode);
this.reportViewer1.SetDisplayMode( Microsoft.Reporting.WinForms.DisplayMode.PrintLayout);
this.reportViewer1.ZoomMode = Microsoft.Reporting.WinForms.ZoomMode.PageWidth;
this.reportViewer1.RefreshReport();
}
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace FPJ0000.JobReport
{
public partial class rJobReport : Form
{
public rJobReport()
{
InitializeComponent();
this.WindowState = FormWindowState.Maximized;
}
private void rJobReport_Load(object sender, EventArgs e)
{
this.ta.Fill(this.dsReport.jobReport, DateTime.Now.Year.ToString("0000"),FCOMMON.info.Login.gcode);
this.reportViewer1.SetDisplayMode( Microsoft.Reporting.WinForms.DisplayMode.PrintLayout);
this.reportViewer1.ZoomMode = Microsoft.Reporting.WinForms.ZoomMode.PageWidth;
this.reportViewer1.RefreshReport();
}
}
}

View File

@@ -59,13 +59,25 @@ namespace FPJ0000.JobReport
var Process = tbProcess.Text.Trim();
if (Process == "%" || tbProcess.SelectedIndex == 0) Process = "";
var wekklist = new string[] { "일","월","화","수","목","금","토" };
//날짜에 해당하는 열을 먼저 생성한다
dataGridView1.Columns.Add("dvcu_damdang", "사원명");
// dataGridView1.Columns.Add("dvcu_process", "공정");
var daylist = dsReport.JobReportDay.GroupBy(t => t.pdate);
foreach (var dayitem in daylist)
{
this.dataGridView1.Columns.Add("dvcu_pdate", dayitem.Key.Substring(8, 2));
var dtValue = DateTime.Parse(dayitem.Key);
if(dtValue.DayOfWeek == DayOfWeek.Saturday || dtValue.DayOfWeek == DayOfWeek.Sunday)
{
var week = wekklist[(int)dtValue.DayOfWeek];
this.dataGridView1.Columns.Add("dvcu_pdate", dayitem.Key.Substring(8, 2) + "(" + week.ToString() + ")");
}
else
{
this.dataGridView1.Columns.Add("dvcu_pdate", dayitem.Key.Substring(8, 2) );
}
this.dataGridView1.Columns[this.dataGridView1.Columns.Count -1].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
}
dataGridView1.Columns.Add("dvcu_sum", "합계");
@@ -83,18 +95,21 @@ namespace FPJ0000.JobReport
//이 사용자의 데이터를 날짜별로 정렬해서 가져온다.
var sum = 0.0;
var sumOT = 0.0;
for (int i = 1; i < this.dataGridView1.Columns.Count-1; i++)
{
var col = this.dataGridView1.Columns[i];
var daydata = dsReport.JobReportDay.Where(t => t.uid == userid && t.pdate.EndsWith(col.HeaderText)).FirstOrDefault();
var dayStr = col.HeaderText.Substring(0, 2);
var daydata = dsReport.JobReportDay.Where(t => t.uid == userid && t.pdate.EndsWith(dayStr)).FirstOrDefault();
if (daydata != null)
{
sum += daydata.hrs + daydata.ot;
rowdata.Add((daydata.hrs + daydata.ot).ToString("N1"));
sum += daydata.hrs;
sumOT += daydata.ot;
rowdata.Add((daydata.hrs.ToString() + "+" + daydata.ot.ToString()));
}
else rowdata.Add("--");
}
rowdata.Add(sum.ToString("N1"));
rowdata.Add(sum.ToString() + "+" + sumOT.ToString());
this.dataGridView1.Rows.Add(rowdata.ToArray());
}
foreach(DataGridViewRow dvrow in this.dataGridView1.Rows)
@@ -106,10 +121,28 @@ namespace FPJ0000.JobReport
if (cellvalue == "--") dvrow.Cells[i].Style.ForeColor = Color.Gray;
else
{
var hrs = double.Parse(cellvalue);
if (hrs > 8.0) dvrow.Cells[i].Style.ForeColor = Color.Blue;
else if (hrs < 8.0) dvrow.Cells[i].Style.ForeColor = Color.Red;
else dvrow.Cells[i].Style.ForeColor = Color.Black;
var datasplbu = cellvalue.Split('+');
double hrs;
double ot;
if (double.TryParse(datasplbu[1], out ot) == false) ot = 0;
if(double.TryParse(datasplbu[0],out hrs))
{
if (hrs > 8.0) dvrow.Cells[i].Style.ForeColor = Color.Blue;
else if (hrs < 8.0) dvrow.Cells[i].Style.ForeColor = Color.Red;
else
{
if (ot == 0)
dvrow.Cells[i].Style.ForeColor = Color.Black;
else
dvrow.Cells[i].Style.ForeColor = Color.Magenta;
}
}
else
{
FCOMMON.Util.MsgE("숫자변경실패 " + cellvalue);
dvrow.Cells[i].Style.ForeColor = Color.Red;
}
}
}