123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344 |
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using UnityEngine.SceneManagement;
- using UnityEngine.UI;
- using UnityEngine.Networking;
- using UnityEngine.EventSystems;
- using System.Text.RegularExpressions;
- using System.Data.SqlClient;
- using System.Runtime.InteropServices;
- using System.Text;
- using TMPro;
- using System;
- using System.IO;
- using ZXing;
- using ZXing.QrCode;
- using System.Net;
- using System.Data;
- using SimpleJSON;
- using System.Linq;
-
- public class test : MonoBehaviour
- {
- public GameObject textPrefab;
- public Transform textParent;
- public GameObject textceneter;
- public GameObject textPrefab1;
- public Transform textParent1;
- public GameObject textceneter1;
- public GameObject textPrefab2;
- public Transform textParent2;
- public GameObject textceneter2;
-
- public CanvasScaler canvasScaler;
-
- [SerializeField] GameObject 左;
- [SerializeField] GameObject 右;
- [SerializeField] GameObject 選擇面板;
- [SerializeField] TextMeshProUGUI 選擇語言;
- [SerializeField] TextMeshProUGUI 中;
- [SerializeField] TextMeshProUGUI 英;
- [SerializeField] TextMeshProUGUI 印;
- [SerializeField] TextMeshProUGUI 簡;
- [SerializeField] Button 中按鈕;
- [SerializeField] Button 英按鈕;
- [SerializeField] Button 印按鈕;
- [SerializeField] Button 簡按鈕;
- [SerializeField] TextMeshProUGUI 合約報價單審核;
- [SerializeField] TextMeshProUGUI 合約清單_tb;
- [SerializeField] TextMeshProUGUI 合約編號;
- [SerializeField] TextMeshProUGUI 客戶名稱;
- [SerializeField] TextMeshProUGUI 負責人;
- [SerializeField] TextMeshProUGUI 工程地點;
- [SerializeField] TextMeshProUGUI 地址;
- [SerializeField] TextMeshProUGUI 工程名稱_tb;
- [SerializeField] TextMeshProUGUI 公司名稱;
- [SerializeField] TextMeshProUGUI 負責人1;
- [SerializeField] TextMeshProUGUI 地址1;
- [SerializeField] TextMeshProUGUI 地址_地址1;
- [SerializeField] TextMeshProUGUI 負責人_名稱1;
- [SerializeField] TextMeshProUGUI 公司名稱_名稱;
- [SerializeField] TextMeshProUGUI 工程名稱_名稱;
- [SerializeField] TextMeshProUGUI 地址_地址;
- [SerializeField] TextMeshProUGUI 工程地點_地址;
- [SerializeField] TextMeshProUGUI 負責人_名稱;
- [SerializeField] TextMeshProUGUI 客戶名稱_名稱;
- [SerializeField] TextMeshProUGUI 合約編號號碼;
-
- [SerializeField] TextMeshProUGUI text1;
- [SerializeField] TextMeshProUGUI text2;
- [SerializeField] TextMeshProUGUI text3;
- [SerializeField] TextMeshProUGUI text4;
- [SerializeField] TextMeshProUGUI text5;
- [SerializeField] TextMeshProUGUI text6;
- [SerializeField] TextMeshProUGUI text7;
- [SerializeField] TextMeshProUGUI text8;
- [SerializeField] TextMeshProUGUI text11;
- [SerializeField] TextMeshProUGUI text21;
- [SerializeField] TextMeshProUGUI text31;
- [SerializeField] TextMeshProUGUI text41;
- [SerializeField] TextMeshProUGUI text51;
- [SerializeField] TextMeshProUGUI text61;
- [SerializeField] TextMeshProUGUI text71;
- [SerializeField] TextMeshProUGUI text81;
- [SerializeField] TextMeshProUGUI 未折價前;
- [SerializeField] TextMeshProUGUI 報價小計;
- [SerializeField] TextMeshProUGUI 預估工資總成本;
- [SerializeField] TextMeshProUGUI 預估材料總成本;
- [SerializeField] TextMeshProUGUI 總成本;
- [SerializeField] TextMeshProUGUI 預估工資總報價;
- [SerializeField] TextMeshProUGUI 預估材料總報價;
- [SerializeField] TextMeshProUGUI 總報價;
- [SerializeField] TextMeshProUGUI 利潤比;
- [SerializeField] TextMeshProUGUI 利潤比1;
- [SerializeField] TextMeshProUGUI 利潤比2;
- [SerializeField] TextMeshProUGUI 利潤比3;
- [SerializeField] TextMeshProUGUI 預估利潤;
- [SerializeField] TextMeshProUGUI 未折價前_錢;
- [SerializeField] TextMeshProUGUI 報價小計_錢;
- [SerializeField] TextMeshProUGUI 預估工資總成本_錢;
- [SerializeField] TextMeshProUGUI 預估材料總成本_錢;
- [SerializeField] TextMeshProUGUI 總成本_錢;
- [SerializeField] TextMeshProUGUI 預估工資總報價_錢;
- [SerializeField] TextMeshProUGUI 預估材料總報價_錢;
- [SerializeField] TextMeshProUGUI 總報價_錢;
- [SerializeField] TextMeshProUGUI 利潤比_錢;
- [SerializeField] TextMeshProUGUI 利潤比1_錢;
- [SerializeField] TextMeshProUGUI 利潤比2_錢;
- [SerializeField] TextMeshProUGUI 利潤比3_錢;
- [SerializeField] TextMeshProUGUI 預估利潤_錢;
- [SerializeField] TextMeshProUGUI 折讓金額;
- [SerializeField] TextMeshProUGUI 總成本1;
- [SerializeField] TextMeshProUGUI 總報價1;
- [SerializeField] TextMeshProUGUI 放行結果;
- [SerializeField] GameObject 放行面板;
-
-
-
- [SerializeField] GameObject 放行頁面關閉;
- [SerializeField] GameObject 放行頁面回到主畫面;
- [SerializeField] GameObject 總價按鈕;
- [SerializeField] GameObject 利潤表按鈕;
- [SerializeField] GameObject 報價;
- [SerializeField] GameObject image_row;
- [SerializeField] GameObject 面板_建立;
- [SerializeField] GameObject 面板_明細;
- [SerializeField] GameObject 下一頁;
- [SerializeField] GameObject 上一頁;
- [SerializeField] GameObject 面板_利潤;
- [SerializeField] GameObject 面板_利潤表頭;
- public float idleTime = 300f; // 5分鐘的閒置時間
- private float timeSinceLastInteraction = 0f;
- bool isTraditionalChinese;
- private TextMeshProUGUI[] texts;
- private TextMeshProUGUI[] texts1;
- private TextMeshProUGUI[] texts2;
- private TextMeshProUGUI[] texts3;
- private TextMeshProUGUI[] texts4;
- private Image[] image;
- private List<GameObject> textcopy = new List<GameObject>();
- private List<GameObject> textcopy1 = new List<GameObject>();
- private List<GameObject> textcopy2 = new List<GameObject>();
- private Button[] bts;
- List<List<string>> myArray = new List<List<string>>();
- List<string> 合約清單 = new List<string>();
-
- private float timer = 0f;
- private float interval = 60f;
-
- [SerializeField] GameObject 讀取面板;
- [SerializeField] TextMeshProUGUI 讀取;
- private string loadingText = "";
- private int dotCount = 0;
-
- int nd = 1;
- private JSONNode jsond;
- void Start()
- {
- Screen.autorotateToPortrait = false;
- Screen.orientation = ScreenOrientation.LandscapeLeft;
- texts = new TextMeshProUGUI[] { text1, text2, text3, text4, text5, text6, text7, text8 };
- texts2 = new TextMeshProUGUI[] { text11, text21, text31, text41, text51, text61, text71, text81 };
-
- float screenWidth = Screen.width;
- float screenHeight = Screen.height;
- float rate = screenWidth/screenHeight;
- if (canvasScaler == null)
- {
- canvasScaler = GetComponent<CanvasScaler>();
- }
- if (rate>1.6)
- {
- canvasScaler.matchWidthOrHeight = 1f;
- }
- else
- {
- canvasScaler.matchWidthOrHeight = 0f;
- }
- StartCoroutine(判斷更新());
- StartCoroutine(AnimateText());
- Main.Global.阿帕契路徑="http://106.1.48.106:8080/wp-content/themes/event-star/tab.php?";
- //Main.Global.阿帕契路徑="http://103.231.201.230/hxpgsweb/wp-content/themes/twentytwentyone/tab.php?";
- 初始化系統語言();
- Main.Global.預設伺服器路徑="tw";
- Main.Global.系統語言="繁體中文";
- 語言選擇按鈕();
- 系統語言轉換();
- StartCoroutine(審核清單());
-
- }
- public void 左按鈕()
- {
- nd--;
- if (nd==1)
- {
- 左.SetActive(false);
- }
- else
- {
- 左.SetActive(true);
- }
- if (nd==合約清單.Count)
- {
- 右.SetActive(false);
- }
- else
- {
- 右.SetActive(true);
- }
- 讀取面板.SetActive(true);
- Main.Global.合約編號=合約清單[nd-1];
- StartCoroutine(合約內容());
- }
- public void 右按鈕()
- {
- nd++;
- if (nd==合約清單.Count)
- {
- 右.SetActive(false);
- }
- else
- {
- 右.SetActive(true);
- }
- if (nd==1)
- {
- 左.SetActive(false);
- }
- else
- {
- 左.SetActive(true);
- }
- 讀取面板.SetActive(true);
- Main.Global.合約編號=合約清單[nd-1];
- StartCoroutine(合約內容());
- }
- IEnumerator AnimateText()
- {
- string qqq = 讀取.text.ToString();
- while (true)
- {
- yield return new WaitForSeconds(0.5f);
-
- if (dotCount < 3)
- {
- loadingText += ".";
- dotCount++;
- }
- else
- {
- loadingText = "";
- dotCount = 0;
- }
-
- 讀取.text = qqq+loadingText;
- }
- }
- void Update()
- {
- timer += Time.deltaTime;
- // 判斷是否達到時間間隔
- if (timer >= interval)
- {
- StartCoroutine(判斷更新());
- timer = 0f;
- }
- if (Main.Global.快速登入==false)
- {
- if (Input.anyKeyDown)
- {
- timeSinceLastInteraction = 0f;
- }
- else
- {
- timeSinceLastInteraction += Time.deltaTime;
- if (timeSinceLastInteraction > idleTime)
- {
- change_Secen(1);
- }
- }
- }
- }
- IEnumerator 合約內容()
- {
- if (textcopy != null)
- {
- DeletetextCopies();
- }
- 讀取面板.SetActive(true);
- string strcon = "合約內容";
- string name1 = Main.Global.合約編號;
- string se = Main.Global.預設伺服器路徑;
- string strUrl = string.Format(Main.Global.阿帕契路徑+"comm={0}&字={1}&se={2}", strcon, name1, se);
- UnityWebRequest request = UnityWebRequest.Get(strUrl);
- yield return request.SendWebRequest();
- if (request.result == UnityWebRequest.Result.ConnectionError)
- {
- //Debug.Log(request.error);
- yield break;
- }
- JSONNode json1 = JSON.Parse(request.downloadHandler.text);
-
- 合約編號號碼.text=json1[0];
- 客戶名稱_名稱.text=json1[1];
- 負責人_名稱.text=json1[2];
- 工程地點_地址.text=json1[3];
- 地址_地址.text=json1[4];
- if (Main.Global.系統語言=="繁體中文" || Main.Global.系統語言=="簡體中文")
- {
- 工程名稱_名稱.text=json1[5];
-
- }
- else
- {
- 工程名稱_名稱.text=json1[6];
-
- }
- 公司名稱_名稱.text=json1[7];
- 負責人_名稱1.text=json1[8];
- 地址_地址1.text=json1[9];
- if (textcopy != null)
- {
- StartCoroutine(合約報價系數());
- }
- }
- IEnumerator 合約報價系數()
- {
- string strcon3 = "合約報價係數";
- string se = Main.Global.預設伺服器路徑;
- string num = Main.Global.合約編號;
- string strUrl3 = string.Format(Main.Global.阿帕契路徑+"comm={0}&se={1}&編號={2}", strcon3, se, num);
- UnityWebRequest request3 = UnityWebRequest.Get(strUrl3);
- yield return request3.SendWebRequest();
- if (request3.result == UnityWebRequest.Result.ConnectionError)
- {
- //Debug.Log(request.error);
- yield break;
- }
- JSONNode json3 = JSON.Parse(request3.downloadHandler.text);
- if (myArray != null)
- {
- myArray.Clear();
- }
- if (json3.Count != 0)
- {
- for (int i3 = 0; i3<json3.Count; i3++)
- {
- List<string> subList = new List<string>();
- for (int j3 = 2; j3<json3[0].Count; j3++)
- {
- string str = json3[i3][j3];
- str=str.Trim('"');
- subList.Add(str);
- }
- myArray.Add(subList);
- }
- }
- StartCoroutine(報價內容());
- }
- IEnumerator 報價內容()
- {
-
- string strcon1 = "報價內容";
- string se = Main.Global.預設伺服器路徑;
- //string se = "id";
- string num = Main.Global.合約編號;
- string strUrl1 = string.Format(Main.Global.阿帕契路徑+"comm={0}&se={1}&編號={2}", strcon1, se, num);
- UnityWebRequest request1 = UnityWebRequest.Get(strUrl1);
- yield return request1.SendWebRequest();
- if (request1.result == UnityWebRequest.Result.ConnectionError)
- {
- //Debug.Log(request.error);
- yield break;
- }
- JSONNode json = JSON.Parse(request1.downloadHandler.text);
-
-
- string strcon2 = "報價明細";
- string lan = Main.Global.系統語言;
- string strUrl2 = string.Format(Main.Global.阿帕契路徑+"comm={0}&se={1}&編號={2}&語言={3}", strcon2, se, num, lan);
- UnityWebRequest request2 = UnityWebRequest.Get(strUrl2);
- yield return request2.SendWebRequest();
- if (request2.result == UnityWebRequest.Result.ConnectionError)
- {
- //Debug.Log(request.error);
- yield break;
- }
- JSONNode json1 = JSON.Parse(request2.downloadHandler.text);
-
-
-
-
-
- int k = 0;
- double doc = 0;
- double doc1 = 0;
- double doc2 = 0;
- double doc3 = 0;
- int sum1 = 0;
- double num10 = 0;
- double num12 = 0;
- double num14 = 0;
- double num16 = 0;
- double total10 = 0;
- double total12 = 0;
- double total14 = 0;
- double total16 = 0;
-
- for (int i = 0; i<json1.Count; i++)
- {
- GameObject textname1 = Instantiate(textPrefab1) as GameObject;
- textname1.GetComponent<RectTransform>().anchoredPosition = new Vector2(0, -sum1);
- textname1.transform.SetParent(textParent1, false);
- texts3 = textname1.GetComponentsInChildren<TextMeshProUGUI>();
-
- GameObject textname2 = Instantiate(textPrefab2) as GameObject;
- textname2.GetComponent<RectTransform>().anchoredPosition = new Vector2(0, -sum1);
- textname2.transform.SetParent(textParent2, false);
- texts4 = textname2.GetComponentsInChildren<TextMeshProUGUI>();
-
- for (int j = 0; j <json1[0].Count; j++)
- {
- string checkitem = json1[i][1].ToString();
-
- if (j==1)
- {
- texts3[0].text=json1[i][j];
- texts4[0].text=json1[i][j];
- }
- if (j==2)
- {
- texts3[1].text=json1[i][j];
- texts4[1].text=json1[i][j];
- }
- if (j==3)
- {
- texts3[2].text=json1[i][j];
- }
- if (j==4)
- {
- double co4 = double.Parse(json1[i][j]);
- int rco4 = (int)Math.Round(co4);
- texts3[3].text=rco4.ToString("#,##0");
- }
- if (j==5)
- {
- double co5 = double.Parse(json1[i][j]);
- int rco5 = (int)Math.Round(co5);
- texts3[4].text=rco5.ToString("#,##0");
-
- }
- if (j==6)
- {
- double co6 = double.Parse(json1[i][j]);
-
- int rco6 = (int)Math.Round(co6);
- texts3[5].text=rco6.ToString("#,##0");
-
- }
- if (j==7)
- {
- texts3[6].text=json1[i][j];
- }
- if (j==32)//材料系數
- {
- //texts3[7].text=json1[i][j];
- if (json1[i][j] != null || json1[i][j] != "")
- {
- string si = json1[i][j];
- si= si.Trim('"');
- for (int acv = 0; acv < myArray.Count; acv++)
- {
- if (myArray[acv][0] == si)
- {
- float number = float.Parse(myArray[acv][1]); // 將字串轉換為浮點數
- number = Mathf.Round(number); // 進行四捨五入
- number -= 100; // 減去 100
- int result = Mathf.RoundToInt(number);
- string output = result.ToString()+myArray[acv][2];
- texts3[7].text=output;
- }
- }
- }
- }
-
- if (j ==8)
- {
-
-
- double num8 = double.Parse(json1[i][j]);
- texts4[2].text=num8.ToString();
- // Debug.Log(json1[i][j]);
- num10 = double.Parse(json1[i][j])*double.Parse(json1[i][j+1]);
- num12 = double.Parse(json1[i][j])*double.Parse(json1[i][j+3]);
- num14 = double.Parse(json1[i][j])*double.Parse(json1[i][j+5]);
- num16 = double.Parse(json1[i][j])*double.Parse(json1[i][j+7]);
- doc+=num10;
- doc1+=num14;
- doc2+=num12;
- doc3+=num16;
- total10+=num10;
- total12+=num12;
- total14+=num14;
- total16+=num16;
- }
- if (j ==9)
- {
- int roundedNum9;
- if (json1[i][j]==null)
- {
- roundedNum9=0;
- }
- else
- {
- double num9 = double.Parse(json1[i][j]);
- roundedNum9 = (int)Math.Round(num9);
-
- }
- texts4[3].text=roundedNum9.ToString("#,##0");
- }
- if (j ==10)
- {
-
- if (checkitem.Contains("*"))
- {
- int rtotal10 = (int)Math.Round(total10);
- texts4[4].text=rtotal10.ToString("#,##0");
-
- }
- else
- {
- int roundedNum10 = (int)Math.Round(num10);
- texts4[4].text=roundedNum10.ToString("#,##0");
- }
- }
- if (j ==11)
- {
- int roundedNum11;
- if (json1[i][j]==null)
- {
- roundedNum11=0;
- }
- else
- {
- double num11 = double.Parse(json1[i][j]);
- roundedNum11 = (int)Math.Round(num11);
-
- }
- texts4[5].text=roundedNum11.ToString("#,##0");
- }
- if (j ==12)
- {
- if (checkitem.Contains("*"))
- {
- int rtotal12 = (int)Math.Round(total12);
- texts4[6].text=rtotal12.ToString("#,##0");
-
- }
- else
- {
- int roundedNum12 = (int)Math.Round(num12);
- texts4[6].text=roundedNum12.ToString("#,##0");
- }
-
- }
- if (j ==13)
- {
- int roundedNum13;
- if (json1[i][j]==null)
- {
- roundedNum13=0;
- }
- else
- {
- double num13 = double.Parse(json1[i][j]);
- roundedNum13 = (int)Math.Round(num13);
-
- }
- texts4[7].text=roundedNum13.ToString("#,##0");
- }
- if (j ==14)
- {
- if (checkitem.Contains("*"))
- {
- int rtotal14 = (int)Math.Round(total14);
- texts4[8].text=rtotal14.ToString("#,##0");
-
- }
- else
- {
- int roundedNum14 = (int)Math.Round(num14);
- texts4[8].text=roundedNum14.ToString("#,##0");
- }
-
- }
- if (j ==15)
- {
- int roundedNum15;
- if (json1[i][j]==null)
- {
- roundedNum15=0;
- }
- else
- {
- double num15 = double.Parse(json1[i][j]);
- roundedNum15 = (int)Math.Round(num15);
-
- }
- texts4[9].text=roundedNum15.ToString("#,##0");
- }
- if (j ==16)
- {
- if (checkitem.Contains("*"))
- {
- int rtotal16 = (int)Math.Round(total16);
- texts4[10].text=rtotal16.ToString("#,##0");
-
- }
- else
- {
- int roundedNum16 = (int)Math.Round(num16);
- texts4[10].text=roundedNum16.ToString("#,##0");
- }
-
- }
- if (j ==17)
- {
- if (checkitem.Contains("*"))
- {
- double total17 = total12+total16-total10-total14;
- int rtotal17 = (int)Math.Round(total17);
- texts4[11].text=rtotal17.ToString("#,##0");
- total10=0;
- total12=0;
- total14=0;
- total16=0;
- }
- else
- {
- double num17 = num12+num16-num10-num14;
- int roundedNum17 = (int)Math.Round(num17);
- texts4[11].text=roundedNum17.ToString("#,##0");
- }
-
- }
- }
- sum1+=100;
- textcopy1.Add(textname1);
- textcopy2.Add(textname2);
- }
-
- //Debug.Log(json.Count);
- //Debug.Log(json[0].Count);
-
- /*for (int i = 0; i < json.Count; i++)
- {
- for (int j = 1; j <json[0].Count; j++) {
-
- Debug.Log(json[i][j]);
- }
- }*/
- int sum = 0;
- long total = 0;
- long total1 = 0;
- long dis = 0;
- for (int i = 0; i<json.Count; i++)
- {
- GameObject textname = Instantiate(textPrefab) as GameObject;
- textname.GetComponent<RectTransform>().anchoredPosition = new Vector2(0, -sum);
- textname.transform.SetParent(textParent, false);
- //textname.GetComponent<RectTransform>().sizeDelta = new Vector2(textname.GetComponent<RectTransform>().sizeDelta.x, 75f);
- texts1 = textname.GetComponentsInChildren<TextMeshProUGUI>();
- //image = textname.GetComponentsInChildren<Image>();
- /*foreach (var ima in image)
- {
- ima.GetComponent<RectTransform>().sizeDelta = new Vector2(ima.GetComponent<RectTransform>().sizeDelta.x, 73f);
- }
- foreach (var text in texts1)
- {
- text.GetComponent<RectTransform>().sizeDelta = new Vector2(text.GetComponent<RectTransform>().sizeDelta.x, 73f);
- }*/
-
- for (int j = 0; j <json[0].Count-2; j++)
- {
- string pattern = @"[\u4e00-\u9fa5]+"; // 正規表達式:匹配一個或多個中文字符
- isTraditionalChinese = Regex.IsMatch(json[i][1].ToString(), pattern);
- string str = json[i][2].ToString();
- if (j == 3 || j == 5)
- {
- long num35 = (long)double.Parse(json[i][j+1]);
-
- if (j==5)
- {
- if (isTraditionalChinese==true)
- {
- total+=num35;
- total1+=num35;
- }
- if (str.Contains("管理費"))
- {
- total+=num35;
- total1+=num35;
- }
- if (str.Contains("折讓"))
- {
- total1+=num35;
- dis =num35;
- }
- texts1[j].text=num35.ToString("#,##0");
-
- }
- else
- {
- texts1[j].text=num35.ToString();
- }
-
- //texts1[j].text = json[i][j+1];
- }
- else if (j==4)
- {
- double num4 = double.Parse(json[i][j + 1]);
- long roundedNum = (long)Math.Round(num4);
- texts1[j].text=roundedNum.ToString("#,##0");
- }
- /*else if (j==1)
- {
- string item =json[i][j+1].ToString();
- item = item.Trim('"');
- int chineseCharCount = Regex.Matches(item, @"[\u4e00-\u9fa5]").Count;
- if (chineseCharCount>3)
- {
- int index = item.IndexOf(" ");
- string chinese = item.Substring(0, index);
- string English = item.Substring(index + 1);
- if (Main.Global.系統語言=="繁體中文")
- {
- texts1[j].text=chinese;
- }
- else
- {
- texts1[j].text=English;
- }
- }
- else
- {
- texts1[j].text = json[i][j+1];
- }
-
- }*/
- else
- {
- texts1[j].text = json[i][j+1];
-
- }
-
- }
- textcopy.Add(textname);
- sum+=75;
- }
- long doci = (long)Math.Round(doc);
- long doci1 = (long)Math.Round(doc1);
- long doci2 = (long)Math.Round(doc2);
- long doci3 = (long)Math.Round(doc3);
-
- double rate = 1-(doc/doc2);
- rate= rate*100;
- double rate1 = 1-(doc1/doc3);
- rate1= rate1*100;
- double rate2 = 1-((doc+doc1)/(doc2+doc3));
- rate2= rate2*100;
- double rate3 = 1-((doc+doc1)/(doc2+doc3+dis));
- rate3= rate3*100;
- if (double.IsNaN(rate))
- {
- rate=0;
- }
- if (double.IsNaN(rate1))
- {
- rate1=0;
- }
- if (double.IsNaN(rate2))
- {
- rate2=0;
- }
- if (double.IsNaN(rate3))
- {
- rate3=0;
- }
- 利潤比_錢.text=((int)Math.Round(rate)).ToString()+"%";
- 利潤比1_錢.text=((int)Math.Round(rate1)).ToString()+"%";
- 利潤比2_錢.text=((int)Math.Round(rate2)).ToString()+"%";
- 利潤比3_錢.text=((int)Math.Round(rate3)).ToString()+"%";
- 未折價前_錢.text=total.ToString("#,##0");
- 報價小計_錢.text=total1.ToString("#,##0");
- 預估工資總成本_錢.text=doci.ToString("#,##0");
- 預估材料總成本_錢.text=doci1.ToString("#,##0");
- 總成本_錢.text=(doci+doci1).ToString("#,##0");
- 預估工資總報價_錢.text=doci2.ToString("#,##0");
- 預估材料總報價_錢.text=doci3.ToString("#,##0");
- 總報價_錢.text=(doci2+doci3).ToString("#,##0");
- 預估利潤_錢.text=((doci2+doci3)-((doci+doci1)-dis)).ToString("#,##0");
- textceneter.GetComponent<RectTransform>().sizeDelta = new Vector2(1420, sum);
- textceneter1.GetComponent<RectTransform>().sizeDelta = new Vector2(1420, sum1);
- textceneter2.GetComponent<RectTransform>().sizeDelta = new Vector2(976, sum1);
- 讀取面板.SetActive(false);
- }
-
- IEnumerator 判斷更新()
- {
- string strcon = "更新";
- string strUrl = string.Format(Main.Global.阿帕契路徑+"comm={0}", strcon);
- UnityWebRequest request = UnityWebRequest.Get(strUrl);
- yield return request.SendWebRequest();
- if (request.result == UnityWebRequest.Result.ConnectionError)
- {
- yield break;
- }
- string str = request.downloadHandler.text.ToString();
- Debug.Log(str);
- if (str == "系統更新")
- {
- change_Secen(1);
- }
- }
-
-
-
- IEnumerator 審核清單()
- {
- 讀取面板.SetActive(true);
- string strcon1 = "審核清單";
- string se = Main.Global.預設伺服器路徑;
- //string se = "id";
-
- string strUrl1 = string.Format(Main.Global.阿帕契路徑+"comm={0}&se={1}", strcon1, se);
- UnityWebRequest request1 = UnityWebRequest.Get(strUrl1);
- yield return request1.SendWebRequest();
- if (request1.result == UnityWebRequest.Result.ConnectionError)
- {
- //Debug.Log(request.error);
- yield break;
- }
- JSONNode json = JSON.Parse(request1.downloadHandler.text);
- JSONArray titleData = json["fieldNames"].AsArray;
- JSONArray rowData = json["rows"].AsArray;
- int titleCount = titleData.Count;
- int rowCount = rowData.Count;
- if (rowCount > 0)
- {
- 放行頁面關閉.SetActive(true);
- 放行頁面回到主畫面.SetActive(false);
- 合約清單.Clear();
- for (int i = 0; i<rowCount; i++)
- {
- string str = rowData[i][0];
- str=str.Trim('"');
- 合約清單.Add(str);
- }
- Main.Global.合約編號=合約清單[0];
- Debug.Log(Main.Global.合約編號);
- if (合約清單.Count == 1)
- {
- 左.SetActive(false);
- 右.SetActive(false);
- }
- else
- {
- 左.SetActive(false);
- 右.SetActive(true);
- }
- StartCoroutine(合約內容());
- }
- else
- {
- 讀取面板.SetActive(false);
- yield return new WaitForSeconds(2f);
- 放行頁面關閉.SetActive(false);
- 放行頁面回到主畫面.SetActive(true);
- 放行面板.SetActive(true);
- if (Main.Global.系統語言=="繁體中文")
- {
- 放行結果.text="目前沒有未審核的合約!!";
- }
- else if (Main.Global.系統語言=="簡體中文")
- {
- 放行結果.text="目前没有待审核的合约!!";
- }
- else if (Main.Global.系統語言=="English")
- {
- 放行結果.text="There are no pending contracts!!";
- }
- else
- {
- 放行結果.text="Saat ini tidak ada kontrak yang belum diverifikasi!!";
- }
-
- }
-
- }
- IEnumerator 報價放行寫入()
- {
- string strcon = "報價放行";
- string se = Main.Global.預設伺服器路徑;
- string strUrl = string.Format(Main.Global.阿帕契路徑+"comm={0}&se={1}&編號={2}", strcon, se, Main.Global.合約編號);
- UnityWebRequest request = UnityWebRequest.Get(strUrl);
- yield return request.SendWebRequest();
- if (request.result != UnityWebRequest.Result.Success)
- {
- 放行結果.text="error!!";
- }
- else
- {
- if (Main.Global.系統語言=="繁體中文")
- {
- 放行結果.text="合約"+ Main.Global.合約編號+"放行成功!!";
- }
- else if (Main.Global.系統語言=="簡體中文")
- {
- 放行結果.text="合同"+ Main.Global.合約編號+"放行成功!!";
- }
- else if (Main.Global.系統語言=="English")
- {
- 放行結果.text="Contract"+ Main.Global.合約編號+"Release successful!!";
- }
- else
- {
- 放行結果.text="Kontrak"+ Main.Global.合約編號+" Rilis dengan sukses!!";
- }
- Main.Global.合約編號="";
- if (textcopy != null)
- {
- DeletetextCopies();
- }
- nd=1;
- StartCoroutine(審核清單());
- }
- }
- public void 放行面板開啟()
- {
- 放行面板.SetActive(true);
- if (Main.Global.合約編號=="" || Main.Global.合約編號==null)
- {
- if (Main.Global.系統語言=="繁體中文")
- {
- 放行結果.text="沒有選擇合約!!";
- }
- else if (Main.Global.系統語言=="簡體中文")
- {
- 放行結果.text="没有选择合同!!";
- }
- else if (Main.Global.系統語言=="English")
- {
- 放行結果.text="No contract selected!!";
- }
- else
- {
- 放行結果.text="Silakan pilih kontrak!!";
- }
- }
- else
- {
- StartCoroutine(報價放行寫入());
-
-
- }
- }
- public void 放行面板開啟關閉()
- {
- 放行面板.SetActive(false);
- }
- public void 放行面板回到主畫面()
- {
- change_Secen(3);
- }
- public void setting_click()
- {
- 選擇面板.SetActive(true);
- }
- public void 上一頁_click()
- {
- 上一頁.SetActive(false);
- 下一頁.SetActive(true);
- 面板_建立.SetActive(true);
- 面板_明細.SetActive(false);
- 總價按鈕.SetActive(true);
- 利潤表按鈕.SetActive(false);
- }
- public void 利潤_click()
- {
-
- 面板_利潤.SetActive(!面板_利潤.activeSelf);
- 面板_利潤表頭.SetActive(!面板_利潤表頭.activeSelf);
- }
- public void 重新整理()
- {
- if (Main.Global.合約編號!=null)
- {
- if (textcopy != null)
- {
- DeletetextCopies();
- }
- StartCoroutine(合約內容());
- }
-
- }
- public void 下一頁_click()
- {
- 上一頁.SetActive(true);
- 下一頁.SetActive(false);
- 面板_明細.SetActive(true);
- 面板_建立.SetActive(false);
- 總價按鈕.SetActive(false);
- 利潤表按鈕.SetActive(true);
- }
- public void setting_中()
- {
- Main.Global.系統語言="繁體中文";
- 系統語言轉換();
- 語言選擇按鈕();
- 選擇面板.SetActive(false);
-
- StartCoroutine(合約內容());
- }
- public void setting_簡()
- {
- Main.Global.系統語言="簡體中文";
- 系統語言轉換();
- 語言選擇按鈕();
- 選擇面板.SetActive(false);
-
- StartCoroutine(合約內容());
- }
- public void setting_英()
- {
- Main.Global.系統語言="English";
-
- 系統語言轉換();
- 語言選擇按鈕();
- 選擇面板.SetActive(false);
- StartCoroutine(合約內容());
-
- }
- public void setting_印()
- {
- Main.Global.系統語言="Indonesian";
-
- 系統語言轉換();
- 語言選擇按鈕();
- 選擇面板.SetActive(false);
- StartCoroutine(合約內容());
- }
- public void 語言選擇按鈕()
- {
- if (bts == null)
- {
- if (Main.Global.系統語言=="繁體中文")
- {
- bts = new Button[] { 簡按鈕, 英按鈕, 印按鈕, 中按鈕 };
- }
- else if (Main.Global.系統語言=="簡體中文")
- {
- bts = new Button[] { 中按鈕, 英按鈕, 印按鈕, 簡按鈕 };
- }
- else if (Main.Global.系統語言=="English")
- {
- bts = new Button[] { 中按鈕, 簡按鈕, 印按鈕, 英按鈕 };
- }
- else
- {
- bts = new Button[] { 中按鈕, 簡按鈕, 英按鈕, 印按鈕 };
- }
- }
- else
- {
- for (int j = 0; j < bts.Length; j++)
- {
- bts[j] = null;
- }
- if (Main.Global.系統語言=="繁體中文")
- {
- bts = new Button[] { 簡按鈕, 英按鈕, 印按鈕, 中按鈕 };
- }
- else if (Main.Global.系統語言=="簡體中文")
- {
- bts = new Button[] { 中按鈕, 英按鈕, 印按鈕, 簡按鈕 };
- }
- else if (Main.Global.系統語言=="English")
- {
- bts = new Button[] { 中按鈕, 簡按鈕, 印按鈕, 英按鈕 };
- }
- else
- {
- bts = new Button[] { 中按鈕, 簡按鈕, 英按鈕, 印按鈕 };
- }
-
- }
- for (int i = 0; i < bts.Length; i++)
- {
- RectTransform rectTransform = bts[i].GetComponent<RectTransform>();
- if (i==3)
- {
- rectTransform.anchoredPosition = new Vector2(1200, 1200);
- }
- else
- {
- rectTransform.anchoredPosition = new Vector2(300*i, 0);
- }
-
- }
- }
- public void setting_exit()
- {
- 選擇面板.SetActive(false);
- }
- public void exit_click()
- {
- change_Secen(3);
- }
-
- public void DeletetextCopies()
- {
- // 刪除複製出來的物件
- foreach (GameObject copy in textcopy)
- {
- Destroy(copy);
- }
- foreach (GameObject copy in textcopy1)
- {
- Destroy(copy);
- }
- foreach (GameObject copy in textcopy2)
- {
- Destroy(copy);
- }
- textcopy.Clear();
- textcopy1.Clear();
- textcopy2.Clear();// 清空列表
- }
-
-
- public void 縮放_click()
- {
- image_row.SetActive(!image_row.activeSelf);
- 報價.SetActive(false);
- }
- public void 總價_click()
- {
- 報價.SetActive(!報價.activeSelf);
- image_row.SetActive(false);
- }
-
- public void change_Secen(int _screenNum)
- {
-
- SceneManager.LoadScene(_screenNum);
- }
- private void 系統語言轉換()
- {
- string 介面 = "H04";
- if (Main.Global.系統語言=="繁體中文")
- {
- 合約報價單審核.text = Main.Global.系統語言字典[介面+"00CH"];
- //建立合約資料.text = Main.Global.系統語言字典[介面+"01CH"];
- //工程合約報價明細.text = Main.Global.系統語言字典[介面+"02CH"];
- // 合約清單_tb.text = Main.Global.系統語言字典[介面+"03CH"];
- 合約編號.text = Main.Global.系統語言字典[介面+"04CH"];
-
- 客戶名稱.text = Main.Global.系統語言字典[介面+"05CH"];
- 負責人.text = Main.Global.系統語言字典[介面+"06CH"];
- 負責人1.text = Main.Global.系統語言字典[介面+"06CH"];
- 工程地點.text = Main.Global.系統語言字典[介面+"07CH"];
- 地址.text = Main.Global.系統語言字典[介面+"08CH"];
- 地址1.text = Main.Global.系統語言字典[介面+"08CH"];
- 工程名稱_tb.text = Main.Global.系統語言字典[介面+"09CH"];
-
- 公司名稱.text = Main.Global.系統語言字典[介面+"10CH"];
- 中.text = Main.Global.系統語言字典[介面+"11CH"];
- 英.text = Main.Global.系統語言字典[介面+"12CH"];
- 印.text = Main.Global.系統語言字典[介面+"13CH"];
- 簡.text = Main.Global.系統語言字典[介面+"29CH"];
- 選擇語言.text = Main.Global.系統語言字典[介面+"14CH"];
-
- 未折價前.text = Main.Global.系統語言字典[介面+"15CH"];
- 報價小計.text = Main.Global.系統語言字典[介面+"16CH"];
- 預估工資總成本.text = Main.Global.系統語言字典[介面+"17CH"];
- 預估材料總成本.text = Main.Global.系統語言字典[介面+"18CH"];
- 總成本.text = Main.Global.系統語言字典[介面+"19CH"];
- 總成本1.text = Main.Global.系統語言字典[介面+"19CH"];
- 預估工資總報價.text = Main.Global.系統語言字典[介面+"20CH"];
- 預估材料總報價.text = Main.Global.系統語言字典[介面+"21CH"];
- 總報價.text = Main.Global.系統語言字典[介面+"22CH"];
- 總報價1.text = Main.Global.系統語言字典[介面+"22CH"];
- 利潤比.text = Main.Global.系統語言字典[介面+"23CH"];
- 利潤比1.text = Main.Global.系統語言字典[介面+"23CH"];
- 利潤比2.text = Main.Global.系統語言字典[介面+"24CH"];
- 利潤比3.text = Main.Global.系統語言字典[介面+"25CH"];
- 預估利潤.text = Main.Global.系統語言字典[介面+"26CH"];
- 折讓金額.text = Main.Global.系統語言字典[介面+"27CH"];
-
- }
- else if (Main.Global.系統語言=="簡體中文")
- {
- 合約報價單審核.text = Main.Global.系統語言字典[介面+"00CS"];
- //建立合約資料.text = Main.Global.系統語言字典[介面+"01CH"];
- //工程合約報價明細.text = Main.Global.系統語言字典[介面+"02CH"];
- // 合約清單_tb.text = Main.Global.系統語言字典[介面+"03CH"];
- 合約編號.text = Main.Global.系統語言字典[介面+"04CS"];
-
- 客戶名稱.text = Main.Global.系統語言字典[介面+"05CS"];
- 負責人.text = Main.Global.系統語言字典[介面+"06CS"];
- 負責人1.text = Main.Global.系統語言字典[介面+"06CS"];
- 工程地點.text = Main.Global.系統語言字典[介面+"07CS"];
- 地址.text = Main.Global.系統語言字典[介面+"08CS"];
- 地址1.text = Main.Global.系統語言字典[介面+"08CS"];
- 工程名稱_tb.text = Main.Global.系統語言字典[介面+"09CS"];
-
- 公司名稱.text = Main.Global.系統語言字典[介面+"10CS"];
- 中.text = Main.Global.系統語言字典[介面+"11CS"];
- 英.text = Main.Global.系統語言字典[介面+"12CS"];
- 印.text = Main.Global.系統語言字典[介面+"13CS"];
- 簡.text = Main.Global.系統語言字典[介面+"29CS"];
- 選擇語言.text = Main.Global.系統語言字典[介面+"14CS"];
-
- 未折價前.text = Main.Global.系統語言字典[介面+"15CS"];
- 報價小計.text = Main.Global.系統語言字典[介面+"16CS"];
- 預估工資總成本.text = Main.Global.系統語言字典[介面+"17CS"];
- 預估材料總成本.text = Main.Global.系統語言字典[介面+"18CS"];
- 總成本.text = Main.Global.系統語言字典[介面+"19CS"];
- 總成本1.text = Main.Global.系統語言字典[介面+"19CS"];
- 預估工資總報價.text = Main.Global.系統語言字典[介面+"20CS"];
- 預估材料總報價.text = Main.Global.系統語言字典[介面+"21CS"];
- 總報價.text = Main.Global.系統語言字典[介面+"22CS"];
- 總報價1.text = Main.Global.系統語言字典[介面+"22CS"];
- 利潤比.text = Main.Global.系統語言字典[介面+"23CS"];
- 利潤比1.text = Main.Global.系統語言字典[介面+"23CS"];
- 利潤比2.text = Main.Global.系統語言字典[介面+"24CS"];
- 利潤比3.text = Main.Global.系統語言字典[介面+"25CS"];
- 預估利潤.text = Main.Global.系統語言字典[介面+"26CS"];
- 折讓金額.text = Main.Global.系統語言字典[介面+"27CS"];
-
- }
- else if (Main.Global.系統語言=="English")
- {
- 合約報價單審核.text = Main.Global.系統語言字典[介面+"00EN"];
- //建立合約資料.text = Main.Global.系統語言字典[介面+"01EN"];
- //工程合約報價明細.text = Main.Global.系統語言字典[介面+"02EN"];
- //合約清單_tb.text = Main.Global.系統語言字典[介面+"03EN"];
- 合約編號.text = Main.Global.系統語言字典[介面+"04EN"];
-
- 客戶名稱.text = Main.Global.系統語言字典[介面+"05EN"];
- 負責人.text = Main.Global.系統語言字典[介面+"06EN"];
- 負責人1.text = Main.Global.系統語言字典[介面+"06EN"];
- 工程地點.text = Main.Global.系統語言字典[介面+"07EN"];
- 地址.text = Main.Global.系統語言字典[介面+"08EN"];
- 地址1.text = Main.Global.系統語言字典[介面+"08EN"];
- 工程名稱_tb.text = Main.Global.系統語言字典[介面+"09EN"];
-
- 公司名稱.text = Main.Global.系統語言字典[介面+"10EN"];
- 中.text = Main.Global.系統語言字典[介面+"11EN"];
- 英.text = Main.Global.系統語言字典[介面+"12EN"];
- 印.text = Main.Global.系統語言字典[介面+"13EN"];
- 簡.text = Main.Global.系統語言字典[介面+"29EN"];
- 選擇語言.text = Main.Global.系統語言字典[介面+"14EN"];
-
- 未折價前.text = Main.Global.系統語言字典[介面+"15EN"];
- 報價小計.text = Main.Global.系統語言字典[介面+"16EN"];
- 預估工資總成本.text = Main.Global.系統語言字典[介面+"17EN"];
- 預估材料總成本.text = Main.Global.系統語言字典[介面+"18EN"];
- 總成本.text = Main.Global.系統語言字典[介面+"19EN"];
- 總成本1.text = Main.Global.系統語言字典[介面+"19EN"];
- 預估工資總報價.text = Main.Global.系統語言字典[介面+"20EN"];
- 預估材料總報價.text = Main.Global.系統語言字典[介面+"21EN"];
- 總報價.text = Main.Global.系統語言字典[介面+"22EN"];
- 總報價1.text = Main.Global.系統語言字典[介面+"22EN"];
- 利潤比.text = Main.Global.系統語言字典[介面+"23EN"];
- 利潤比1.text = Main.Global.系統語言字典[介面+"23EN"];
- 利潤比2.text = Main.Global.系統語言字典[介面+"24EN"];
- 利潤比3.text = Main.Global.系統語言字典[介面+"25EN"];
- 預估利潤.text = Main.Global.系統語言字典[介面+"26EN"];
- 折讓金額.text = Main.Global.系統語言字典[介面+"27EN"];
-
- }
- else
- {
- 合約報價單審核.text = Main.Global.系統語言字典[介面+"00ID"];
- // 建立合約資料.text = Main.Global.系統語言字典[介面+"01ID"];
- //工程合約報價明細.text = Main.Global.系統語言字典[介面+"02ID"];
- //合約清單_tb.text = Main.Global.系統語言字典[介面+"03ID"];
- 合約編號.text = Main.Global.系統語言字典[介面+"04ID"];
-
- 客戶名稱.text = Main.Global.系統語言字典[介面+"05ID"];
- 負責人.text = Main.Global.系統語言字典[介面+"06ID"];
- 負責人1.text = Main.Global.系統語言字典[介面+"06ID"];
- 工程地點.text = Main.Global.系統語言字典[介面+"07ID"];
- 地址.text = Main.Global.系統語言字典[介面+"08ID"];
- 地址1.text = Main.Global.系統語言字典[介面+"08ID"];
- 工程名稱_tb.text = Main.Global.系統語言字典[介面+"09ID"];
-
- 公司名稱.text = Main.Global.系統語言字典[介面+"10ID"];
- 中.text = Main.Global.系統語言字典[介面+"11ID"];
- 英.text = Main.Global.系統語言字典[介面+"12ID"];
- 印.text = Main.Global.系統語言字典[介面+"13ID"];
- 簡.text = Main.Global.系統語言字典[介面+"29ID"];
- 選擇語言.text = Main.Global.系統語言字典[介面+"14ID"];
-
- 未折價前.text = Main.Global.系統語言字典[介面+"15ID"];
- 報價小計.text = Main.Global.系統語言字典[介面+"16ID"];
- 預估工資總成本.text = Main.Global.系統語言字典[介面+"17ID"];
- 預估材料總成本.text = Main.Global.系統語言字典[介面+"18ID"];
- 總成本.text = Main.Global.系統語言字典[介面+"19ID"];
- 總成本1.text = Main.Global.系統語言字典[介面+"19ID"];
- 預估工資總報價.text = Main.Global.系統語言字典[介面+"20ID"];
- 預估材料總報價.text = Main.Global.系統語言字典[介面+"21ID"];
- 總報價.text = Main.Global.系統語言字典[介面+"22ID"];
- 總報價1.text = Main.Global.系統語言字典[介面+"22ID"];
- 利潤比.text = Main.Global.系統語言字典[介面+"23ID"];
- 利潤比1.text = Main.Global.系統語言字典[介面+"23ID"];
- 利潤比2.text = Main.Global.系統語言字典[介面+"24ID"];
- 利潤比3.text = Main.Global.系統語言字典[介面+"25ID"];
- 預估利潤.text = Main.Global.系統語言字典[介面+"26ID"];
- 折讓金額.text = Main.Global.系統語言字典[介面+"27ID"];
-
- }
- }
- private void 初始化系統語言()
- {
- TextAsset txt = Resources.Load("Tran") as TextAsset;
- Main.Global.系統語言資料=txt.text.Split('\n');
- for (int i = 1; i<=Main.Global.系統語言資料.Length; i++)
- {
- try
- {
- string key = Main.Global.系統語言資料[i].ToString().Substring(0, 3)+Main.Global.系統語言資料[i].ToString().Substring(4, 2)+Main.Global.系統語言資料[i].ToString().Substring(7, 2);
- Main.Global.系統語言字典.Add(key, Main.Global.系統語言資料[i].ToString().Substring(10));
- }
- catch
- {
- // Debug.Log("No data");
- }
-
- }
- }
-
- }
|