구매필요내역에 cr 없느 ㄴ데이터는 나오지 않게 함(박성민s)
This commit is contained in:
		| @@ -49,6 +49,9 @@ namespace FPJ0000.JobReport_ | ||||
|         { | ||||
|             string prcname = tbProcess.SelectedIndex < 1 ? "%" : tbProcess.Text.Trim(); | ||||
|             this.ta.Fill(this.dsReport.JobReportDay, tbMon.Text, FCOMMON.info.Login.gcode, prcname); | ||||
|  | ||||
|             var taH = new dsReportTableAdapters.HolidayLIstTableAdapter(); | ||||
|             taH.Fill(this.dsReport.HolidayLIst, tbMon.Text + "%"); | ||||
|             //this.reportViewer1.SetDisplayMode(Microsoft.Reporting.WinForms.DisplayMode.PrintLayout); | ||||
|             //this.reportViewer1.ZoomMode = Microsoft.Reporting.WinForms.ZoomMode.PageWidth; | ||||
|             //this.reportViewer1.RefreshReport(); | ||||
| @@ -68,17 +71,28 @@ namespace FPJ0000.JobReport_ | ||||
|             var daylist = dsReport.JobReportDay.OrderBy(t=>t.pdate).GroupBy(t => t.pdate); | ||||
|             foreach (var dayitem in daylist) | ||||
|             { | ||||
|                | ||||
|                 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() + ")"); | ||||
|                 } | ||||
|                 var week = wekklist[(int)dtValue.DayOfWeek]; | ||||
|                 this.dataGridView1.Columns.Add("dvcu_pdate", dayitem.Key.Substring(8, 2) + "(" + week.ToString() + ")"); | ||||
|  | ||||
|                 //휴일이면 태그에 1을 넣는다 | ||||
|                 var drh = this.dsReport.HolidayLIst.Where(t => t.pdate == dayitem.Key).FirstOrDefault(); | ||||
|                 if (drh != null && drh.free == true) | ||||
|                     this.dataGridView1.Columns[this.dataGridView1.Columns.Count - 1].Tag = "1"; | ||||
|                 else | ||||
|                 { | ||||
|                     this.dataGridView1.Columns.Add("dvcu_pdate", dayitem.Key.Substring(8, 2) ); | ||||
|                 } | ||||
|                  | ||||
|                     this.dataGridView1.Columns[this.dataGridView1.Columns.Count - 1].Tag = "0"; | ||||
|  | ||||
|  | ||||
|                 //if (dtValue.DayOfWeek == DayOfWeek.Saturday || dtValue.DayOfWeek == DayOfWeek.Sunday) | ||||
|                 //{ | ||||
|  | ||||
|                 //} | ||||
|                 //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", "합계"); | ||||
| @@ -97,16 +111,39 @@ namespace FPJ0000.JobReport_ | ||||
|                 //이 사용자의 데이터를 날짜별로 정렬해서 가져온다. | ||||
|                 var sum = 0.0; | ||||
|                 var sumOT = 0.0; | ||||
|                 var sumFR = 0.0; //휴일근무시간 210310 | ||||
|                 for (int i = 1; i < this.dataGridView1.Columns.Count-1; i++) | ||||
|                 { | ||||
|                     var col = this.dataGridView1.Columns[i]; | ||||
|                     var dayStr = col.HeaderText.Substring(0, 2);  | ||||
|                     var dayStr = col.HeaderText.Substring(0, 2); | ||||
|  | ||||
|                    | ||||
|  | ||||
|                      | ||||
|  | ||||
|  | ||||
|  | ||||
|                     var daydata = dsReport.JobReportDay.Where(t => t.uid == userid && t.pdate.EndsWith(dayStr)).FirstOrDefault(); | ||||
|                     if (daydata != null) | ||||
|                     { | ||||
|                         // 휴일여부확인 | ||||
|                         //var daystrF = this.tbMon.Text + "-" + dayStr; | ||||
|                         //var dayinfo = dsReport.HolidayLIst.Where(t => t.pdate == daystrF).FirstOrDefault(); | ||||
|  | ||||
|                         sum += daydata.hrs; | ||||
|                         sumOT += daydata.ot; | ||||
|                         rowdata.Add((daydata.hrs.ToString() + "+" + daydata.ot.ToString())); | ||||
|  | ||||
|                         if (col.Tag.ToString() == "1") | ||||
|                         { | ||||
|                             //이날은 휴일이다 | ||||
|                             sumFR += daydata.ot + daydata.hrs; | ||||
|                             rowdata.Add((daydata.hrs.ToString() + "+" + daydata.ot.ToString())); | ||||
|                         } | ||||
|                         else | ||||
|                         { | ||||
|                             //평일이다 | ||||
|                             sumOT += daydata.ot; | ||||
|                             rowdata.Add((daydata.hrs.ToString() + "+" + daydata.ot.ToString())); | ||||
|                         } | ||||
|                     } | ||||
|                     else rowdata.Add("--"); | ||||
|                 } | ||||
| @@ -117,6 +154,7 @@ namespace FPJ0000.JobReport_ | ||||
|             { | ||||
|                 for(int i = 1;i < this.dataGridView1.ColumnCount-1;i++) | ||||
|                 { | ||||
|                     var col = this.dataGridView1.Columns[i ]; | ||||
|                     var cellvalue = "--"; | ||||
|                     if(dvrow.Cells[i].Value != null) cellvalue=  dvrow.Cells[i].Value.ToString(); | ||||
|                     if (cellvalue == "--") dvrow.Cells[i].Style.ForeColor = Color.Gray; | ||||
| @@ -127,23 +165,31 @@ namespace FPJ0000.JobReport_ | ||||
|                         double ot; | ||||
|                         if (double.TryParse(datasplbu[1], out ot) == false) ot = 0; | ||||
|  | ||||
|                         if(double.TryParse(datasplbu[0],out hrs)) | ||||
|                         if(col.Tag.ToString() == "1") | ||||
|                         { | ||||
|                             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; | ||||
|                             } | ||||
|                             dvrow.Cells[i].Style.ForeColor = Color.Green; | ||||
|                         } | ||||
|                         else | ||||
|                         { | ||||
|                             FCOMMON.Util.MsgE("숫자변경실패 " + cellvalue); | ||||
|                             dvrow.Cells[i].Style.ForeColor = Color.Red; | ||||
|                             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; | ||||
|                             } | ||||
|                         } | ||||
|                         | ||||
|                     } | ||||
|                 } | ||||
|                  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 chi
					chi