99 lines
2.8 KiB
C#
99 lines
2.8 KiB
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using WI;
|
|
using UnityEngine.UI;
|
|
using TMPro;
|
|
using System;
|
|
using static System.Windows.Forms.VisualStyles.VisualStyleElement.Menu;
|
|
using System.Globalization;
|
|
|
|
namespace CHN
|
|
{
|
|
public class Panel_WorkConditionAnalysis : PanelBase
|
|
{
|
|
private Button Button_StartDay;
|
|
private Button Button_EndDay;
|
|
private TextMeshProUGUI Text_StartDay;
|
|
private TextMeshProUGUI Text_EndDay;
|
|
private TMP_Dropdown Dropdown_Facility;
|
|
private TMP_InputField InputField_WorkOrderNumber;
|
|
private Button Button_Search;
|
|
private Button Button_Close;
|
|
|
|
private UI_Calendar ui_Calendar;
|
|
|
|
HTTPTest hTTPTest;
|
|
|
|
public override void AfterAwake()
|
|
{
|
|
ui_Calendar = transform.GetComponentInChildren<UI_Calendar>();
|
|
Button_Close.onClick.AddListener(() => SetActive(false));
|
|
Button_StartDay.onClick.AddListener(OnClickStartDayBtn);
|
|
Button_EndDay.onClick.AddListener(OnClickEndDayBtn);
|
|
Button_Search.onClick.AddListener(OnClickSearchBtn);
|
|
|
|
ui_Calendar.Close();
|
|
|
|
Text_StartDay.text = DateTime.Now.ToString("yyyy-MM-dd");
|
|
Text_EndDay.text = DateTime.Now.ToString("yyyy-MM-dd");
|
|
|
|
SetActive(false);
|
|
}
|
|
|
|
private void SetFacilityDropDown()
|
|
{
|
|
hTTPTest = FindObjectOfType<HTTPTest>();
|
|
|
|
if (hTTPTest == null)
|
|
return;
|
|
|
|
Dropdown_Facility.ClearOptions();
|
|
|
|
string[] data = hTTPTest.workConditionFacilityData.data;
|
|
|
|
List<TMP_Dropdown.OptionData> optionList = new List<TMP_Dropdown.OptionData>();
|
|
|
|
foreach (string str in data)
|
|
{
|
|
optionList.Add(new TMP_Dropdown.OptionData(str));
|
|
}
|
|
|
|
Dropdown_Facility.AddOptions(optionList);
|
|
Dropdown_Facility.value = 0;
|
|
}
|
|
|
|
|
|
|
|
private void OnClickStartDayBtn()
|
|
{
|
|
ui_Calendar.Open(Text_StartDay);
|
|
}
|
|
|
|
private void OnClickEndDayBtn()
|
|
{
|
|
ui_Calendar.Open(Text_EndDay);
|
|
}
|
|
|
|
private void OnClickSearchBtn()
|
|
{
|
|
DateTime startDate = Convert.ToDateTime(Text_StartDay.text);
|
|
DateTime endDate = Convert.ToDateTime(Text_EndDay.text);
|
|
|
|
string startDateString = startDate.ToString("yyyy-MM-ddTHH:mm:ssZ");
|
|
string endDateString = endDate.ToString("yyyy-MM-ddTHH:mm:ssZ");
|
|
string MCHCD = Dropdown_Facility.options[Dropdown_Facility.value].text;
|
|
string WO = InputField_WorkOrderNumber.text;
|
|
|
|
hTTPTest.WorkTimeInQuiry(startDateString, endDateString, MCHCD, WO);
|
|
}
|
|
|
|
public void Open()
|
|
{
|
|
SetFacilityDropDown();
|
|
SetActive(true);
|
|
}
|
|
}
|
|
}
|
|
|