TaiZhouChangChu/Assets/Script/Order.cs

73 lines
2.3 KiB
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using System;
public class Order : MonoBehaviour
{
public Task TaskCon;
DateTime dtNow;
public string Str_ServiceCode;//业务单号
public string Str_Company;//预约单位
public string Str_CarNum;//车牌号
public string Str_Driver;//司机姓名
public string Str_Phone;//司机电话
public InputField Input_ServiceCode;//业务单号
public InputField Input_Company;//预约单位
public InputField Input_CarNum;//车牌号
public InputField Input_Driver;//司机姓名
public InputField Input_Phone;//司机电话
public InputField Input_Time;//时间
//一条记录
public string ReserveCode;//预约单号
public Text Text_One_ReserveCode;
public Text Text_One_Company;//公司
public Text Text_One_ServiceCode;//业务单号
public Text Text_One_Kind;//预约类型
public Text Text_One_Car;//车牌号
public Text Text_One_Phone;//手机号
void Start()
{
}
public void Show()
{
Input_Time.text = DateTime.Now.ToString ();//自动显示预约时间
}
//提交
public void Submit()
{
Str_ServiceCode = Input_ServiceCode.text;//业务单号
Str_Company = Input_Company.text;//预约单位
Str_CarNum = Input_CarNum.text;//车牌号
Str_Driver = Input_Driver.text;//司机姓名
Str_Phone = Input_Phone.text;//司机电话
//预约单号
dtNow = DateTime.Now;
ReserveCode = dtNow.Year.ToString();
if (dtNow.Month < 10)
ReserveCode += "0" + dtNow.Month.ToString();
else
ReserveCode += dtNow.Month.ToString();
if (dtNow.Day < 10)
ReserveCode += "0" + dtNow.Day.ToString();
else
ReserveCode += dtNow.Day.ToString();
ReserveCode += UnityEngine.Random.Range(100, 200);
}
//显示一条记录
public void ShowOne()
{
Text_One_ReserveCode.text = ReserveCode;//预约单号
Text_One_Company.text = Str_Company;
Text_One_ServiceCode.text = Str_ServiceCode;
Text_One_Kind.text = TaskCon.Courses[TaskCon.InputKind];//选择的预约类型
Text_One_Car.text = Str_CarNum;//车牌
Text_One_Phone.text = Str_Phone;//手机号
}
}