Esempio n. 1
0
    private void OnSubmitButtonClick()
    {
        if (!Check())
        {
            print("Check faild");
            return;
        }

        print("Succ");

        DateTime  checkInTime = datePicker.SelectedDate.Date;
        EGender   gender      = toggleF.isOn ? EGender.Female : EGender.Male;
        String    name        = nameInputField.text.Trim();
        ENational national    = (ENational)nationalityDropdown.value;
        String    identity    = passportInputField.text.Trim();

        Debug.Log(string.Format("CheckInTime: {0} Gender: {1} Name: {2} National: {3} Identity: {4}",
                                checkInTime.ToString(),
                                gender.ToString(),
                                name,
                                national.ToString(),
                                identity));

        Customer addCustomer = new Customer()
        {
            Name        = name,
            Gender      = gender,
            CheckInTime = checkInTime,
            National    = national,
            Identity    = identity,
            RoomInfo    = RoomInfoInputField.text
        };

        bool succ = StorageManager.AddCoustomer(addCustomer);

        string displayStr = succ ? "加入成功" : "加入失敗";

        NativeManager.ShowToast(displayStr);
        print(displayStr);


//		List<Customer> assignList = StorageManager.GetAssign (searchCustomer);
//		revealPanelGO.gameObject.SetActive (true);
//		revealPanel.SetData (assignList);
    }
Esempio n. 2
0
    private void OnSubmitButtonClick()
    {
        if (!Check())
        {
            print("Check faild");
            return;
        }

        print("Succ");

        DateTime  checkInTime = isSelectedDate ? datePicker.SelectedDate.Date : default(DateTime);
        EGender   gender      = GetGender();
        String    name        = nameInputField.text.Trim();
        ENational national    = (ENational)nationalityDropdown.value;
        String    identity    = passportInputField.text.Trim();

        Debug.Log(string.Format("CheckInTime: {0} Gender: {1} Name: {2} National: {3} Identity: {4}",
                                checkInTime.ToString(),
                                gender.ToString(),
                                name,
                                national.ToString(),
                                identity));

        Customer searchCustomer = new Customer()
        {
            Name        = name,
            Gender      = gender,
            CheckInTime = checkInTime,
            National    = national,
            Identity    = identity
        };

        List <Customer> assignList = StorageManager.GetAssign(searchCustomer);

        revealPanelGO.gameObject.SetActive(true);
        revealPanel.SetData(assignList);
    }