w전자실 업무일지 양식 수정, 저장 후 색상 업데이트

This commit is contained in:
chi
2021-07-13 10:58:41 +09:00
parent 3af25188e1
commit 7b7c5d1f4f
4 changed files with 50 additions and 0 deletions

View File

@@ -150,6 +150,7 @@
<Compile Include="fWebCamera.Designer.cs">
<DependentUpon>fWebCamera.cs</DependentUpon>
</Compile>
<Compile Include="ISO8601.cs" />
<Compile Include="keyValuedataTable.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Info.cs" />

View File

@@ -0,0 +1,37 @@
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
namespace ISO8601
{
public static class Calender
{
private static CultureInfo culture = CultureInfo.CurrentCulture;
private static int CalcDate(DateTime date)
{
return date.DayOfWeek != DayOfWeek.Sunday ? DayOfWeek.Thursday - date.DayOfWeek : (int)DayOfWeek.Tuesday - 7;
}
public static int GetYear(DateTime date)
{
date = date.AddDays(CalcDate(date));
return culture.Calendar.GetYear(date);
}
public static int GetMonth(DateTime date)
{
date = date.AddDays(CalcDate(date));
return culture.Calendar.GetMonth(date);
}
public static int GetWorkWeek(DateTime date)
{
date = date.AddDays(CalcDate(date));
return culture.Calendar.GetWeekOfYear(date, CalendarWeekRule.FirstFourDayWeek, DayOfWeek.Monday);
}
}
}

View File

@@ -203,6 +203,7 @@ namespace FPJ0000
{
FCOMMON.Util.MsgE(ex.Message);
}
FormattingData();
}
private void projectsBindingNavigatorSaveItem_Click(object sender, EventArgs e)
@@ -388,6 +389,17 @@ namespace FPJ0000
var fn = System.IO.Path.Combine(FCOMMON.Util.CurrentPath, "EBoardDailyform.xlsx");
System.IO.File.Copy(fn, sd.FileName, true);
book.load(sd.FileName);
//week 기록
var lastrow = dsMSSQL.EETGW_JobReport_EBoard.FirstOrDefault();
if(lastrow != null)
{
var ww = ISO8601.Calender.GetWorkWeek(DateTime.Parse( lastrow.pdate));
var sht1 = book.getSheet(2);
sht1.writeNum(1, 0, ww);
}
var sht = book.getSheet(0);
//2번쨰 줄부터 데이터를 기록한다.
var row = 1;