공정 항목 추가 (업무일지, 프로젝트)

구매내역에 s/c 정렬 기능 추가
This commit is contained in:
chi
2020-01-06 16:27:21 +09:00
parent d73a2e212a
commit 178c295587
80 changed files with 12686 additions and 9599 deletions

View File

@@ -84,6 +84,7 @@
this.tam = new FPJ0000.dsPRJTableAdapters.TableAdapterManager();
this.ta = new FPJ0000.dsPRJTableAdapters.JobReportTableAdapter();
this.fpSpread1 = new FarPoint.Win.Spread.FpSpread();
this.fpSpread1_Sheet1 = new FarPoint.Win.Spread.SheetView();
this.toolStrip1 = new System.Windows.Forms.ToolStrip();
this.lbStt = new System.Windows.Forms.ToolStripLabel();
this.dtSD = new System.Windows.Forms.ToolStripTextBox();
@@ -95,15 +96,14 @@
this.cmbUser = new System.Windows.Forms.ToolStripComboBox();
this.btSearch = new System.Windows.Forms.ToolStripButton();
this.toolStripButton2 = new System.Windows.Forms.ToolStripButton();
this.fpSpread1_Sheet1 = new FarPoint.Win.Spread.SheetView();
((System.ComponentModel.ISupportInitialize)(this.bn)).BeginInit();
this.bn.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.bs)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.dsMSSQL)).BeginInit();
this.cm.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.fpSpread1)).BeginInit();
this.toolStrip1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.fpSpread1_Sheet1)).BeginInit();
this.toolStrip1.SuspendLayout();
this.SuspendLayout();
//
// bn
@@ -299,6 +299,7 @@
// btReport
//
this.btReport.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right;
this.btReport.Enabled = false;
this.btReport.Image = ((System.Drawing.Image)(resources.GetObject("btReport.Image")));
this.btReport.ImageTransparentColor = System.Drawing.Color.Magenta;
this.btReport.Name = "btReport";
@@ -319,6 +320,7 @@
// toolStripButton1
//
this.toolStripButton1.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right;
this.toolStripButton1.Enabled = false;
this.toolStripButton1.Image = ((System.Drawing.Image)(resources.GetObject("toolStripButton1.Image")));
this.toolStripButton1.ImageTransparentColor = System.Drawing.Color.Magenta;
this.toolStripButton1.Name = "toolStripButton1";
@@ -474,104 +476,6 @@
this.fpSpread1.StatusBarVisible = true;
this.fpSpread1.TabIndex = 2;
//
// toolStrip1
//
this.toolStrip1.ImageScalingSize = new System.Drawing.Size(30, 30);
this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.lbStt,
this.dtSD,
this.lbEnd,
this.dtED,
this.lbTime,
this.toolStripSeparator2,
this.toolStripLabel3,
this.cmbUser,
this.btSearch,
this.toolStripButton2});
this.toolStrip1.Location = new System.Drawing.Point(0, 0);
this.toolStrip1.Name = "toolStrip1";
this.toolStrip1.Size = new System.Drawing.Size(1142, 37);
this.toolStrip1.TabIndex = 4;
this.toolStrip1.Text = "toolStrip1";
//
// lbStt
//
this.lbStt.Font = new System.Drawing.Font("맑은 고딕", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(129)));
this.lbStt.ForeColor = System.Drawing.Color.Blue;
this.lbStt.Name = "lbStt";
this.lbStt.Size = new System.Drawing.Size(31, 34);
this.lbStt.Text = "기간";
this.lbStt.Click += new System.EventHandler(this.lbStt_Click);
//
// dtSD
//
this.dtSD.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.dtSD.Name = "dtSD";
this.dtSD.ReadOnly = true;
this.dtSD.Size = new System.Drawing.Size(90, 37);
this.dtSD.Text = "1982-11-23";
this.dtSD.TextBoxTextAlign = System.Windows.Forms.HorizontalAlignment.Center;
//
// lbEnd
//
this.lbEnd.Name = "lbEnd";
this.lbEnd.Size = new System.Drawing.Size(15, 34);
this.lbEnd.Text = "~";
//
// dtED
//
this.dtED.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.dtED.Name = "dtED";
this.dtED.ReadOnly = true;
this.dtED.Size = new System.Drawing.Size(90, 37);
this.dtED.Text = "1982-11-23";
this.dtED.TextBoxTextAlign = System.Windows.Forms.HorizontalAlignment.Center;
//
// lbTime
//
this.lbTime.Name = "lbTime";
this.lbTime.Size = new System.Drawing.Size(29, 34);
this.lbTime.Text = "{0}h";
//
// toolStripSeparator2
//
this.toolStripSeparator2.Name = "toolStripSeparator2";
this.toolStripSeparator2.Size = new System.Drawing.Size(6, 37);
//
// toolStripLabel3
//
this.toolStripLabel3.Name = "toolStripLabel3";
this.toolStripLabel3.Size = new System.Drawing.Size(43, 34);
this.toolStripLabel3.Text = "사용자";
this.toolStripLabel3.Click += new System.EventHandler(this.toolStripLabel3_Click);
//
// cmbUser
//
this.cmbUser.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbUser.Name = "cmbUser";
this.cmbUser.Size = new System.Drawing.Size(200, 37);
this.cmbUser.SelectedIndexChanged += new System.EventHandler(this.cmbUser_SelectedIndexChanged);
this.cmbUser.Click += new System.EventHandler(this.cmbUser_Click);
//
// btSearch
//
this.btSearch.Image = ((System.Drawing.Image)(resources.GetObject("btSearch.Image")));
this.btSearch.ImageTransparentColor = System.Drawing.Color.Magenta;
this.btSearch.Name = "btSearch";
this.btSearch.Size = new System.Drawing.Size(80, 34);
this.btSearch.Text = "조회(&R)";
this.btSearch.Click += new System.EventHandler(this.btSearch_Click);
//
// toolStripButton2
//
this.toolStripButton2.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right;
this.toolStripButton2.Image = ((System.Drawing.Image)(resources.GetObject("toolStripButton2.Image")));
this.toolStripButton2.ImageTransparentColor = System.Drawing.Color.Magenta;
this.toolStripButton2.Name = "toolStripButton2";
this.toolStripButton2.Size = new System.Drawing.Size(65, 34);
this.toolStripButton2.Text = "닫기";
this.toolStripButton2.Click += new System.EventHandler(this.toolStripButton2_Click);
//
// fpSpread1_Sheet1
//
this.fpSpread1_Sheet1.Reset();
@@ -670,6 +574,102 @@
this.fpSpread1_Sheet1.RowHeader.Columns.Default.Resizable = false;
this.fpSpread1_Sheet1.ReferenceStyle = FarPoint.Win.Spread.Model.ReferenceStyle.A1;
//
// toolStrip1
//
this.toolStrip1.ImageScalingSize = new System.Drawing.Size(30, 30);
this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.lbStt,
this.dtSD,
this.lbEnd,
this.dtED,
this.lbTime,
this.toolStripSeparator2,
this.toolStripLabel3,
this.cmbUser,
this.btSearch,
this.toolStripButton2});
this.toolStrip1.Location = new System.Drawing.Point(0, 0);
this.toolStrip1.Name = "toolStrip1";
this.toolStrip1.Size = new System.Drawing.Size(1142, 37);
this.toolStrip1.TabIndex = 4;
this.toolStrip1.Text = "toolStrip1";
//
// lbStt
//
this.lbStt.Font = new System.Drawing.Font("맑은 고딕", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(129)));
this.lbStt.ForeColor = System.Drawing.Color.Blue;
this.lbStt.Name = "lbStt";
this.lbStt.Size = new System.Drawing.Size(31, 34);
this.lbStt.Text = "기간";
this.lbStt.Click += new System.EventHandler(this.lbStt_Click);
//
// dtSD
//
this.dtSD.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.dtSD.Name = "dtSD";
this.dtSD.Size = new System.Drawing.Size(90, 37);
this.dtSD.Text = "1982-11-23";
this.dtSD.TextBoxTextAlign = System.Windows.Forms.HorizontalAlignment.Center;
//
// lbEnd
//
this.lbEnd.Name = "lbEnd";
this.lbEnd.Size = new System.Drawing.Size(15, 34);
this.lbEnd.Text = "~";
//
// dtED
//
this.dtED.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.dtED.Name = "dtED";
this.dtED.Size = new System.Drawing.Size(90, 37);
this.dtED.Text = "1982-11-23";
this.dtED.TextBoxTextAlign = System.Windows.Forms.HorizontalAlignment.Center;
//
// lbTime
//
this.lbTime.Name = "lbTime";
this.lbTime.Size = new System.Drawing.Size(29, 34);
this.lbTime.Text = "{0}h";
//
// toolStripSeparator2
//
this.toolStripSeparator2.Name = "toolStripSeparator2";
this.toolStripSeparator2.Size = new System.Drawing.Size(6, 37);
//
// toolStripLabel3
//
this.toolStripLabel3.Name = "toolStripLabel3";
this.toolStripLabel3.Size = new System.Drawing.Size(43, 34);
this.toolStripLabel3.Text = "사용자";
this.toolStripLabel3.Click += new System.EventHandler(this.toolStripLabel3_Click);
//
// cmbUser
//
this.cmbUser.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbUser.Name = "cmbUser";
this.cmbUser.Size = new System.Drawing.Size(200, 37);
this.cmbUser.SelectedIndexChanged += new System.EventHandler(this.cmbUser_SelectedIndexChanged);
this.cmbUser.Click += new System.EventHandler(this.cmbUser_Click);
//
// btSearch
//
this.btSearch.Image = ((System.Drawing.Image)(resources.GetObject("btSearch.Image")));
this.btSearch.ImageTransparentColor = System.Drawing.Color.Magenta;
this.btSearch.Name = "btSearch";
this.btSearch.Size = new System.Drawing.Size(80, 34);
this.btSearch.Text = "조회(&R)";
this.btSearch.Click += new System.EventHandler(this.btSearch_Click);
//
// toolStripButton2
//
this.toolStripButton2.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right;
this.toolStripButton2.Image = ((System.Drawing.Image)(resources.GetObject("toolStripButton2.Image")));
this.toolStripButton2.ImageTransparentColor = System.Drawing.Color.Magenta;
this.toolStripButton2.Name = "toolStripButton2";
this.toolStripButton2.Size = new System.Drawing.Size(65, 34);
this.toolStripButton2.Text = "닫기";
this.toolStripButton2.Click += new System.EventHandler(this.toolStripButton2_Click);
//
// fJobReport
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F);
@@ -689,9 +689,9 @@
((System.ComponentModel.ISupportInitialize)(this.dsMSSQL)).EndInit();
this.cm.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.fpSpread1)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.fpSpread1_Sheet1)).EndInit();
this.toolStrip1.ResumeLayout(false);
this.toolStrip1.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.fpSpread1_Sheet1)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();

View File

@@ -40,29 +40,15 @@ namespace FPJ0000
if (FCOMMON.info.Login.no == "dev") namestr = "김치균(395552)";
this.cmbUser.Items.Clear();
this.cmbUser.Items.Add(namestr);
try
var taUserList = new dsReportTableAdapters.ProcessUserListTableAdapter();
var processStr = "%";
if (FCOMMON.info.Login.process != "") processStr = FCOMMON.info.Login.process;
var dtUserList = taUserList.GetData(processStr);
foreach(dsReport.ProcessUserListRow dr in dtUserList)
{
var cn = FCOMMON.DBM.getCn();
cn.Open();
string sql = "select uid,dbo.getUserName(uid) as uname " +
" from JobReport" +
" where gcode='{1}' and uid <> '{0}'" +
" group by uid " +
" order by uname";
sql = string.Format(sql, FCOMMON.info.Login.no, FCOMMON.info.Login.gcode);
var cmd = new System.Data.SqlClient.SqlCommand(sql, cn);
var rdr = cmd.ExecuteReader();
while (rdr.Read())
{
string cmbdata = string.Format("{1}({0})", rdr["uid"].ToString(), rdr["uname"].ToString());
this.cmbUser.Items.Add(cmbdata);
}
cmd.Dispose();
cn.Close();
cn.Dispose();
}catch (Exception ex)
{
FCOMMON.Util.MsgE("User List Error\n\n"+ex.Message);
string cmbdata = string.Format("{1}({0})", dr.id, dr.name);
this.cmbUser.Items.Add(cmbdata);
}
//var userList = FCOMMON.DBM.getGroupList("name + '(' + id + ')'", "Users", "[level] > 0 and [level] < 10", false, false);

View File

@@ -29,18 +29,21 @@
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
Microsoft.Reporting.WinForms.ReportDataSource reportDataSource1 = new Microsoft.Reporting.WinForms.ReportDataSource();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle();
this.bs = new System.Windows.Forms.BindingSource(this.components);
this.dsReport = new FPJ0000.dsReport();
this.reportViewer1 = new Microsoft.Reporting.WinForms.ReportViewer();
this.panel1 = new System.Windows.Forms.Panel();
this.label1 = new System.Windows.Forms.Label();
this.linkLabel1 = new System.Windows.Forms.LinkLabel();
this.btRefresh = new System.Windows.Forms.Button();
this.tbMon = new System.Windows.Forms.TextBox();
this.ta = new FPJ0000.dsReportTableAdapters.JobReportDayTableAdapter();
this.dataGridView1 = new System.Windows.Forms.DataGridView();
this.tbProcess = new System.Windows.Forms.ComboBox();
((System.ComponentModel.ISupportInitialize)(this.bs)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.dsReport)).BeginInit();
this.panel1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit();
this.SuspendLayout();
//
// bs
@@ -53,20 +56,10 @@
this.dsReport.DataSetName = "dsReport";
this.dsReport.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema;
//
// reportViewer1
//
this.reportViewer1.Dock = System.Windows.Forms.DockStyle.Fill;
reportDataSource1.Name = "DataSet1";
reportDataSource1.Value = this.bs;
this.reportViewer1.LocalReport.DataSources.Add(reportDataSource1);
this.reportViewer1.LocalReport.ReportEmbeddedResource = "FPJ0000.JobReport.rJobReportDay.rdlc";
this.reportViewer1.Location = new System.Drawing.Point(0, 42);
this.reportViewer1.Name = "reportViewer1";
this.reportViewer1.Size = new System.Drawing.Size(721, 544);
this.reportViewer1.TabIndex = 1;
//
// panel1
//
this.panel1.Controls.Add(this.tbProcess);
this.panel1.Controls.Add(this.label1);
this.panel1.Controls.Add(this.linkLabel1);
this.panel1.Controls.Add(this.btRefresh);
this.panel1.Controls.Add(this.tbMon);
@@ -74,9 +67,18 @@
this.panel1.Location = new System.Drawing.Point(0, 0);
this.panel1.Name = "panel1";
this.panel1.Padding = new System.Windows.Forms.Padding(5);
this.panel1.Size = new System.Drawing.Size(721, 42);
this.panel1.Size = new System.Drawing.Size(751, 42);
this.panel1.TabIndex = 0;
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(198, 15);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(29, 12);
this.label1.TabIndex = 3;
this.label1.Text = "공정";
//
// linkLabel1
//
this.linkLabel1.AutoSize = true;
@@ -91,7 +93,7 @@
// btRefresh
//
this.btRefresh.Dock = System.Windows.Forms.DockStyle.Right;
this.btRefresh.Location = new System.Drawing.Point(641, 5);
this.btRefresh.Location = new System.Drawing.Point(671, 5);
this.btRefresh.Name = "btRefresh";
this.btRefresh.Size = new System.Drawing.Size(75, 32);
this.btRefresh.TabIndex = 2;
@@ -103,7 +105,7 @@
//
this.tbMon.Location = new System.Drawing.Point(66, 10);
this.tbMon.Name = "tbMon";
this.tbMon.Size = new System.Drawing.Size(100, 21);
this.tbMon.Size = new System.Drawing.Size(115, 21);
this.tbMon.TabIndex = 1;
this.tbMon.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
//
@@ -111,12 +113,39 @@
//
this.ta.ClearBeforeFill = true;
//
// dataGridView1
//
this.dataGridView1.AllowUserToAddRows = false;
this.dataGridView1.AllowUserToDeleteRows = false;
this.dataGridView1.AllowUserToResizeColumns = false;
this.dataGridView1.AllowUserToResizeRows = false;
dataGridViewCellStyle3.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));
this.dataGridView1.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle3;
this.dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dataGridView1.Dock = System.Windows.Forms.DockStyle.Fill;
this.dataGridView1.Location = new System.Drawing.Point(0, 42);
this.dataGridView1.Name = "dataGridView1";
this.dataGridView1.ReadOnly = true;
this.dataGridView1.RowHeadersVisible = false;
this.dataGridView1.RowTemplate.Height = 23;
this.dataGridView1.Size = new System.Drawing.Size(751, 546);
this.dataGridView1.TabIndex = 2;
//
// tbProcess
//
this.tbProcess.FormattingEnabled = true;
this.tbProcess.Location = new System.Drawing.Point(233, 10);
this.tbProcess.Name = "tbProcess";
this.tbProcess.Size = new System.Drawing.Size(158, 20);
this.tbProcess.TabIndex = 5;
this.tbProcess.SelectedIndexChanged += new System.EventHandler(this.tbProcess_SelectedIndexChanged);
//
// rJobReportDay
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(721, 586);
this.Controls.Add(this.reportViewer1);
this.ClientSize = new System.Drawing.Size(751, 588);
this.Controls.Add(this.dataGridView1);
this.Controls.Add(this.panel1);
this.Name = "rJobReportDay";
this.Text = "일/개인별 근무시간 집계(+OT 포함)";
@@ -125,13 +154,12 @@
((System.ComponentModel.ISupportInitialize)(this.dsReport)).EndInit();
this.panel1.ResumeLayout(false);
this.panel1.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit();
this.ResumeLayout(false);
}
#endregion
private Microsoft.Reporting.WinForms.ReportViewer reportViewer1;
private dsReport dsReport;
private System.Windows.Forms.BindingSource bs;
private System.Windows.Forms.Panel panel1;
@@ -139,5 +167,8 @@
private System.Windows.Forms.TextBox tbMon;
private System.Windows.Forms.LinkLabel linkLabel1;
private dsReportTableAdapters.JobReportDayTableAdapter ta;
private System.Windows.Forms.DataGridView dataGridView1;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.ComboBox tbProcess;
}
}

View File

@@ -11,16 +11,30 @@ namespace FPJ0000.JobReport
{
public partial class rJobReportDay : Form
{
Boolean binit = false;
public rJobReportDay()
{
InitializeComponent();
this.WindowState = FormWindowState.Maximized;
}
private void rJobReport_Load(object sender, EventArgs e)
{
this.tbProcess.Items.Clear();
tbProcess.Items.Add("전체");
var taProcess = new dsReportTableAdapters.ProcessListTableAdapter();
var dtProcessList = taProcess.GetData(FCOMMON.info.Login.gcode);
foreach (dsReport.ProcessListRow dr in dtProcessList.Rows)
tbProcess.Items.Add(dr.processs);
this.tbProcess.Text = FCOMMON.info.Login.process;
if (tbProcess.SelectedIndex < 0) tbProcess.SelectedIndex = 0;
this.tbMon.Text = DateTime.Now.ToString("yyyy-MM");
refrehData();
binit = true;
}
private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
@@ -34,13 +48,82 @@ namespace FPJ0000.JobReport
void refrehData()
{
this.ta.Fill(this.dsReport.JobReportDay, tbMon.Text, FCOMMON.info.Login.gcode);
this.reportViewer1.SetDisplayMode(Microsoft.Reporting.WinForms.DisplayMode.PrintLayout);
this.reportViewer1.ZoomMode = Microsoft.Reporting.WinForms.ZoomMode.PageWidth;
this.reportViewer1.RefreshReport();
//this.reportViewer1.SetDisplayMode(Microsoft.Reporting.WinForms.DisplayMode.PrintLayout);
//this.reportViewer1.ZoomMode = Microsoft.Reporting.WinForms.ZoomMode.PageWidth;
//this.reportViewer1.RefreshReport();
//그리드뷰 생성
this.dataGridView1.Rows.Clear();
this.dataGridView1.Columns.Clear();
var Process = tbProcess.Text.Trim();
if (Process == "%" || tbProcess.SelectedIndex == 0) Process = "";
//날짜에 해당하는 열을 먼저 생성한다
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));
this.dataGridView1.Columns[this.dataGridView1.Columns.Count -1].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
}
dataGridView1.Columns.Add("dvcu_sum", "합계");
this.dataGridView1.Columns[this.dataGridView1.Columns.Count - 1].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
foreach (var item in dsReport.JobReportDay.Where(t=>t.processs.Contains(Process)).OrderBy(t => t.uname + t.uid).GroupBy(t => t.uname))
{
//사용자별로 데이터를 가져온다.
var username = item.Key;
var userid = item.FirstOrDefault().uid;
List<string> rowdata = new List<string>();
rowdata.Add(username);
// rowdata.Add(item.FirstOrDefault().processs);
//이 사용자의 데이터를 날짜별로 정렬해서 가져온다.
var sum = 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();
if (daydata != null)
{
sum += daydata.hrs + daydata.ot;
rowdata.Add((daydata.hrs + daydata.ot).ToString("N1"));
}
else rowdata.Add("--");
}
rowdata.Add(sum.ToString("N1"));
this.dataGridView1.Rows.Add(rowdata.ToArray());
}
foreach(DataGridViewRow dvrow in this.dataGridView1.Rows)
{
for(int i = 1;i < this.dataGridView1.ColumnCount-1;i++)
{
var cellvalue = "--";
if(dvrow.Cells[i].Value != null) cellvalue= dvrow.Cells[i].Value.ToString();
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;
}
}
}
this.dataGridView1.AutoResizeColumns();
}
private void button1_Click(object sender, EventArgs e)
{
refrehData();
}
private void tbProcess_SelectedIndexChanged(object sender, EventArgs e)
{
if (tbProcess.SelectedIndex >= 0) refrehData();
}
}
}

View File

@@ -123,6 +123,9 @@
<metadata name="dsReport.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="dsReport.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="ta.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>245, 17</value>
</metadata>