Bez popisu
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using UnityEngine.SceneManagement;
  5. using UnityEngine.UI;
  6. using UnityEngine.Networking;
  7. using UnityEngine.EventSystems;
  8. using System.Text.RegularExpressions;
  9. using System.Data.SqlClient;
  10. using System.Runtime.InteropServices;
  11. using System.Text;
  12. using TMPro;
  13. using System;
  14. using System.IO;
  15. using ZXing;
  16. using ZXing.QrCode;
  17. using System.Net;
  18. using System.Data;
  19. using SimpleJSON;
  20. using System.Linq;
  21. public class test : MonoBehaviour
  22. {
  23. public GameObject textPrefab;
  24. public Transform textParent;
  25. public GameObject textceneter;
  26. public GameObject textPrefab1;
  27. public Transform textParent1;
  28. public GameObject textceneter1;
  29. public GameObject textPrefab2;
  30. public Transform textParent2;
  31. public GameObject textceneter2;
  32. public CanvasScaler canvasScaler;
  33. [SerializeField] GameObject 左;
  34. [SerializeField] GameObject 右;
  35. [SerializeField] GameObject 選擇面板;
  36. [SerializeField] TextMeshProUGUI 選擇語言;
  37. [SerializeField] TextMeshProUGUI 中;
  38. [SerializeField] TextMeshProUGUI 英;
  39. [SerializeField] TextMeshProUGUI 印;
  40. [SerializeField] TextMeshProUGUI 簡;
  41. [SerializeField] Button 中按鈕;
  42. [SerializeField] Button 英按鈕;
  43. [SerializeField] Button 印按鈕;
  44. [SerializeField] Button 簡按鈕;
  45. [SerializeField] TextMeshProUGUI 合約報價單審核;
  46. [SerializeField] TextMeshProUGUI 合約清單_tb;
  47. [SerializeField] TextMeshProUGUI 合約編號;
  48. [SerializeField] TextMeshProUGUI 客戶名稱;
  49. [SerializeField] TextMeshProUGUI 負責人;
  50. [SerializeField] TextMeshProUGUI 工程地點;
  51. [SerializeField] TextMeshProUGUI 地址;
  52. [SerializeField] TextMeshProUGUI 工程名稱_tb;
  53. [SerializeField] TextMeshProUGUI 公司名稱;
  54. [SerializeField] TextMeshProUGUI 負責人1;
  55. [SerializeField] TextMeshProUGUI 地址1;
  56. [SerializeField] TextMeshProUGUI 地址_地址1;
  57. [SerializeField] TextMeshProUGUI 負責人_名稱1;
  58. [SerializeField] TextMeshProUGUI 公司名稱_名稱;
  59. [SerializeField] TextMeshProUGUI 工程名稱_名稱;
  60. [SerializeField] TextMeshProUGUI 地址_地址;
  61. [SerializeField] TextMeshProUGUI 工程地點_地址;
  62. [SerializeField] TextMeshProUGUI 負責人_名稱;
  63. [SerializeField] TextMeshProUGUI 客戶名稱_名稱;
  64. [SerializeField] TextMeshProUGUI 合約編號號碼;
  65. [SerializeField] TextMeshProUGUI text1;
  66. [SerializeField] TextMeshProUGUI text2;
  67. [SerializeField] TextMeshProUGUI text3;
  68. [SerializeField] TextMeshProUGUI text4;
  69. [SerializeField] TextMeshProUGUI text5;
  70. [SerializeField] TextMeshProUGUI text6;
  71. [SerializeField] TextMeshProUGUI text7;
  72. [SerializeField] TextMeshProUGUI text8;
  73. [SerializeField] TextMeshProUGUI text11;
  74. [SerializeField] TextMeshProUGUI text21;
  75. [SerializeField] TextMeshProUGUI text31;
  76. [SerializeField] TextMeshProUGUI text41;
  77. [SerializeField] TextMeshProUGUI text51;
  78. [SerializeField] TextMeshProUGUI text61;
  79. [SerializeField] TextMeshProUGUI text71;
  80. [SerializeField] TextMeshProUGUI text81;
  81. [SerializeField] TextMeshProUGUI 未折價前;
  82. [SerializeField] TextMeshProUGUI 報價小計;
  83. [SerializeField] TextMeshProUGUI 預估工資總成本;
  84. [SerializeField] TextMeshProUGUI 預估材料總成本;
  85. [SerializeField] TextMeshProUGUI 總成本;
  86. [SerializeField] TextMeshProUGUI 預估工資總報價;
  87. [SerializeField] TextMeshProUGUI 預估材料總報價;
  88. [SerializeField] TextMeshProUGUI 總報價;
  89. [SerializeField] TextMeshProUGUI 利潤比;
  90. [SerializeField] TextMeshProUGUI 利潤比1;
  91. [SerializeField] TextMeshProUGUI 利潤比2;
  92. [SerializeField] TextMeshProUGUI 利潤比3;
  93. [SerializeField] TextMeshProUGUI 預估利潤;
  94. [SerializeField] TextMeshProUGUI 未折價前_錢;
  95. [SerializeField] TextMeshProUGUI 報價小計_錢;
  96. [SerializeField] TextMeshProUGUI 預估工資總成本_錢;
  97. [SerializeField] TextMeshProUGUI 預估材料總成本_錢;
  98. [SerializeField] TextMeshProUGUI 總成本_錢;
  99. [SerializeField] TextMeshProUGUI 預估工資總報價_錢;
  100. [SerializeField] TextMeshProUGUI 預估材料總報價_錢;
  101. [SerializeField] TextMeshProUGUI 總報價_錢;
  102. [SerializeField] TextMeshProUGUI 利潤比_錢;
  103. [SerializeField] TextMeshProUGUI 利潤比1_錢;
  104. [SerializeField] TextMeshProUGUI 利潤比2_錢;
  105. [SerializeField] TextMeshProUGUI 利潤比3_錢;
  106. [SerializeField] TextMeshProUGUI 預估利潤_錢;
  107. [SerializeField] TextMeshProUGUI 折讓金額;
  108. [SerializeField] TextMeshProUGUI 總成本1;
  109. [SerializeField] TextMeshProUGUI 總報價1;
  110. [SerializeField] TextMeshProUGUI 放行結果;
  111. [SerializeField] GameObject 放行面板;
  112. [SerializeField] GameObject 放行頁面關閉;
  113. [SerializeField] GameObject 放行頁面回到主畫面;
  114. [SerializeField] GameObject 總價按鈕;
  115. [SerializeField] GameObject 利潤表按鈕;
  116. [SerializeField] GameObject 報價;
  117. [SerializeField] GameObject image_row;
  118. [SerializeField] GameObject 面板_建立;
  119. [SerializeField] GameObject 面板_明細;
  120. [SerializeField] GameObject 下一頁;
  121. [SerializeField] GameObject 上一頁;
  122. [SerializeField] GameObject 面板_利潤;
  123. [SerializeField] GameObject 面板_利潤表頭;
  124. public float idleTime = 300f; // 5分鐘的閒置時間
  125. private float timeSinceLastInteraction = 0f;
  126. bool isTraditionalChinese;
  127. private TextMeshProUGUI[] texts;
  128. private TextMeshProUGUI[] texts1;
  129. private TextMeshProUGUI[] texts2;
  130. private TextMeshProUGUI[] texts3;
  131. private TextMeshProUGUI[] texts4;
  132. private Image[] image;
  133. private List<GameObject> textcopy = new List<GameObject>();
  134. private List<GameObject> textcopy1 = new List<GameObject>();
  135. private List<GameObject> textcopy2 = new List<GameObject>();
  136. private Button[] bts;
  137. List<List<string>> myArray = new List<List<string>>();
  138. List<string> 合約清單 = new List<string>();
  139. private float timer = 0f;
  140. private float interval = 60f;
  141. [SerializeField] GameObject 讀取面板;
  142. [SerializeField] TextMeshProUGUI 讀取;
  143. private string loadingText = "";
  144. private int dotCount = 0;
  145. int nd = 1;
  146. private JSONNode jsond;
  147. void Start()
  148. {
  149. Screen.autorotateToPortrait = false;
  150. Screen.orientation = ScreenOrientation.LandscapeLeft;
  151. texts = new TextMeshProUGUI[] { text1, text2, text3, text4, text5, text6, text7, text8 };
  152. texts2 = new TextMeshProUGUI[] { text11, text21, text31, text41, text51, text61, text71, text81 };
  153. float screenWidth = Screen.width;
  154. float screenHeight = Screen.height;
  155. float rate = screenWidth/screenHeight;
  156. if (canvasScaler == null)
  157. {
  158. canvasScaler = GetComponent<CanvasScaler>();
  159. }
  160. if (rate>1.6)
  161. {
  162. canvasScaler.matchWidthOrHeight = 1f;
  163. }
  164. else
  165. {
  166. canvasScaler.matchWidthOrHeight = 0f;
  167. }
  168. StartCoroutine(判斷更新());
  169. StartCoroutine(AnimateText());
  170. Main.Global.阿帕契路徑="http://106.1.48.106:8080/wp-content/themes/event-star/tab.php?";
  171. //Main.Global.阿帕契路徑="http://103.231.201.230/hxpgsweb/wp-content/themes/twentytwentyone/tab.php?";
  172. 初始化系統語言();
  173. Main.Global.預設伺服器路徑="tw";
  174. Main.Global.系統語言="繁體中文";
  175. 語言選擇按鈕();
  176. 系統語言轉換();
  177. StartCoroutine(審核清單());
  178. }
  179. public void 左按鈕()
  180. {
  181. nd--;
  182. if (nd==1)
  183. {
  184. 左.SetActive(false);
  185. }
  186. else
  187. {
  188. 左.SetActive(true);
  189. }
  190. if (nd==合約清單.Count)
  191. {
  192. 右.SetActive(false);
  193. }
  194. else
  195. {
  196. 右.SetActive(true);
  197. }
  198. 讀取面板.SetActive(true);
  199. Main.Global.合約編號=合約清單[nd-1];
  200. StartCoroutine(合約內容());
  201. }
  202. public void 右按鈕()
  203. {
  204. nd++;
  205. if (nd==合約清單.Count)
  206. {
  207. 右.SetActive(false);
  208. }
  209. else
  210. {
  211. 右.SetActive(true);
  212. }
  213. if (nd==1)
  214. {
  215. 左.SetActive(false);
  216. }
  217. else
  218. {
  219. 左.SetActive(true);
  220. }
  221. 讀取面板.SetActive(true);
  222. Main.Global.合約編號=合約清單[nd-1];
  223. StartCoroutine(合約內容());
  224. }
  225. IEnumerator AnimateText()
  226. {
  227. string qqq = 讀取.text.ToString();
  228. while (true)
  229. {
  230. yield return new WaitForSeconds(0.5f);
  231. if (dotCount < 3)
  232. {
  233. loadingText += ".";
  234. dotCount++;
  235. }
  236. else
  237. {
  238. loadingText = "";
  239. dotCount = 0;
  240. }
  241. 讀取.text = qqq+loadingText;
  242. }
  243. }
  244. void Update()
  245. {
  246. timer += Time.deltaTime;
  247. // 判斷是否達到時間間隔
  248. if (timer >= interval)
  249. {
  250. StartCoroutine(判斷更新());
  251. timer = 0f;
  252. }
  253. if (Main.Global.快速登入==false)
  254. {
  255. if (Input.anyKeyDown)
  256. {
  257. timeSinceLastInteraction = 0f;
  258. }
  259. else
  260. {
  261. timeSinceLastInteraction += Time.deltaTime;
  262. if (timeSinceLastInteraction > idleTime)
  263. {
  264. change_Secen(1);
  265. }
  266. }
  267. }
  268. }
  269. IEnumerator 合約內容()
  270. {
  271. if (textcopy != null)
  272. {
  273. DeletetextCopies();
  274. }
  275. 讀取面板.SetActive(true);
  276. string strcon = "合約內容";
  277. string name1 = Main.Global.合約編號;
  278. string se = Main.Global.預設伺服器路徑;
  279. string strUrl = string.Format(Main.Global.阿帕契路徑+"comm={0}&字={1}&se={2}", strcon, name1, se);
  280. UnityWebRequest request = UnityWebRequest.Get(strUrl);
  281. yield return request.SendWebRequest();
  282. if (request.result == UnityWebRequest.Result.ConnectionError)
  283. {
  284. //Debug.Log(request.error);
  285. yield break;
  286. }
  287. JSONNode json1 = JSON.Parse(request.downloadHandler.text);
  288. 合約編號號碼.text=json1[0];
  289. 客戶名稱_名稱.text=json1[1];
  290. 負責人_名稱.text=json1[2];
  291. 工程地點_地址.text=json1[3];
  292. 地址_地址.text=json1[4];
  293. if (Main.Global.系統語言=="繁體中文" || Main.Global.系統語言=="簡體中文")
  294. {
  295. 工程名稱_名稱.text=json1[5];
  296. }
  297. else
  298. {
  299. 工程名稱_名稱.text=json1[6];
  300. }
  301. 公司名稱_名稱.text=json1[7];
  302. 負責人_名稱1.text=json1[8];
  303. 地址_地址1.text=json1[9];
  304. if (textcopy != null)
  305. {
  306. StartCoroutine(合約報價系數());
  307. }
  308. }
  309. IEnumerator 合約報價系數()
  310. {
  311. string strcon3 = "合約報價係數";
  312. string se = Main.Global.預設伺服器路徑;
  313. string num = Main.Global.合約編號;
  314. string strUrl3 = string.Format(Main.Global.阿帕契路徑+"comm={0}&se={1}&編號={2}", strcon3, se, num);
  315. UnityWebRequest request3 = UnityWebRequest.Get(strUrl3);
  316. yield return request3.SendWebRequest();
  317. if (request3.result == UnityWebRequest.Result.ConnectionError)
  318. {
  319. //Debug.Log(request.error);
  320. yield break;
  321. }
  322. JSONNode json3 = JSON.Parse(request3.downloadHandler.text);
  323. if (myArray != null)
  324. {
  325. myArray.Clear();
  326. }
  327. if (json3.Count != 0)
  328. {
  329. for (int i3 = 0; i3<json3.Count; i3++)
  330. {
  331. List<string> subList = new List<string>();
  332. for (int j3 = 2; j3<json3[0].Count; j3++)
  333. {
  334. string str = json3[i3][j3];
  335. str=str.Trim('"');
  336. subList.Add(str);
  337. }
  338. myArray.Add(subList);
  339. }
  340. }
  341. StartCoroutine(報價內容());
  342. }
  343. IEnumerator 報價內容()
  344. {
  345. string strcon1 = "報價內容";
  346. string se = Main.Global.預設伺服器路徑;
  347. //string se = "id";
  348. string num = Main.Global.合約編號;
  349. string strUrl1 = string.Format(Main.Global.阿帕契路徑+"comm={0}&se={1}&編號={2}", strcon1, se, num);
  350. UnityWebRequest request1 = UnityWebRequest.Get(strUrl1);
  351. yield return request1.SendWebRequest();
  352. if (request1.result == UnityWebRequest.Result.ConnectionError)
  353. {
  354. //Debug.Log(request.error);
  355. yield break;
  356. }
  357. JSONNode json = JSON.Parse(request1.downloadHandler.text);
  358. string strcon2 = "報價明細";
  359. string lan = Main.Global.系統語言;
  360. string strUrl2 = string.Format(Main.Global.阿帕契路徑+"comm={0}&se={1}&編號={2}&語言={3}", strcon2, se, num, lan);
  361. UnityWebRequest request2 = UnityWebRequest.Get(strUrl2);
  362. yield return request2.SendWebRequest();
  363. if (request2.result == UnityWebRequest.Result.ConnectionError)
  364. {
  365. //Debug.Log(request.error);
  366. yield break;
  367. }
  368. JSONNode json1 = JSON.Parse(request2.downloadHandler.text);
  369. int k = 0;
  370. double doc = 0;
  371. double doc1 = 0;
  372. double doc2 = 0;
  373. double doc3 = 0;
  374. int sum1 = 0;
  375. double num10 = 0;
  376. double num12 = 0;
  377. double num14 = 0;
  378. double num16 = 0;
  379. double total10 = 0;
  380. double total12 = 0;
  381. double total14 = 0;
  382. double total16 = 0;
  383. for (int i = 0; i<json1.Count; i++)
  384. {
  385. GameObject textname1 = Instantiate(textPrefab1) as GameObject;
  386. textname1.GetComponent<RectTransform>().anchoredPosition = new Vector2(0, -sum1);
  387. textname1.transform.SetParent(textParent1, false);
  388. texts3 = textname1.GetComponentsInChildren<TextMeshProUGUI>();
  389. GameObject textname2 = Instantiate(textPrefab2) as GameObject;
  390. textname2.GetComponent<RectTransform>().anchoredPosition = new Vector2(0, -sum1);
  391. textname2.transform.SetParent(textParent2, false);
  392. texts4 = textname2.GetComponentsInChildren<TextMeshProUGUI>();
  393. for (int j = 0; j <json1[0].Count; j++)
  394. {
  395. string checkitem = json1[i][1].ToString();
  396. if (j==1)
  397. {
  398. texts3[0].text=json1[i][j];
  399. texts4[0].text=json1[i][j];
  400. }
  401. if (j==2)
  402. {
  403. texts3[1].text=json1[i][j];
  404. texts4[1].text=json1[i][j];
  405. }
  406. if (j==3)
  407. {
  408. texts3[2].text=json1[i][j];
  409. }
  410. if (j==4)
  411. {
  412. double co4 = double.Parse(json1[i][j]);
  413. int rco4 = (int)Math.Round(co4);
  414. texts3[3].text=rco4.ToString("#,##0");
  415. }
  416. if (j==5)
  417. {
  418. double co5 = double.Parse(json1[i][j]);
  419. int rco5 = (int)Math.Round(co5);
  420. texts3[4].text=rco5.ToString("#,##0");
  421. }
  422. if (j==6)
  423. {
  424. double co6 = double.Parse(json1[i][j]);
  425. int rco6 = (int)Math.Round(co6);
  426. texts3[5].text=rco6.ToString("#,##0");
  427. }
  428. if (j==7)
  429. {
  430. texts3[6].text=json1[i][j];
  431. }
  432. if (j==32)//材料系數
  433. {
  434. //texts3[7].text=json1[i][j];
  435. if (json1[i][j] != null || json1[i][j] != "")
  436. {
  437. string si = json1[i][j];
  438. si= si.Trim('"');
  439. for (int acv = 0; acv < myArray.Count; acv++)
  440. {
  441. if (myArray[acv][0] == si)
  442. {
  443. float number = float.Parse(myArray[acv][1]); // 將字串轉換為浮點數
  444. number = Mathf.Round(number); // 進行四捨五入
  445. number -= 100; // 減去 100
  446. int result = Mathf.RoundToInt(number);
  447. string output = result.ToString()+myArray[acv][2];
  448. texts3[7].text=output;
  449. }
  450. }
  451. }
  452. }
  453. if (j ==8)
  454. {
  455. double num8 = double.Parse(json1[i][j]);
  456. texts4[2].text=num8.ToString();
  457. // Debug.Log(json1[i][j]);
  458. num10 = double.Parse(json1[i][j])*double.Parse(json1[i][j+1]);
  459. num12 = double.Parse(json1[i][j])*double.Parse(json1[i][j+3]);
  460. num14 = double.Parse(json1[i][j])*double.Parse(json1[i][j+5]);
  461. num16 = double.Parse(json1[i][j])*double.Parse(json1[i][j+7]);
  462. doc+=num10;
  463. doc1+=num14;
  464. doc2+=num12;
  465. doc3+=num16;
  466. total10+=num10;
  467. total12+=num12;
  468. total14+=num14;
  469. total16+=num16;
  470. }
  471. if (j ==9)
  472. {
  473. int roundedNum9;
  474. if (json1[i][j]==null)
  475. {
  476. roundedNum9=0;
  477. }
  478. else
  479. {
  480. double num9 = double.Parse(json1[i][j]);
  481. roundedNum9 = (int)Math.Round(num9);
  482. }
  483. texts4[3].text=roundedNum9.ToString("#,##0");
  484. }
  485. if (j ==10)
  486. {
  487. if (checkitem.Contains("*"))
  488. {
  489. int rtotal10 = (int)Math.Round(total10);
  490. texts4[4].text=rtotal10.ToString("#,##0");
  491. }
  492. else
  493. {
  494. int roundedNum10 = (int)Math.Round(num10);
  495. texts4[4].text=roundedNum10.ToString("#,##0");
  496. }
  497. }
  498. if (j ==11)
  499. {
  500. int roundedNum11;
  501. if (json1[i][j]==null)
  502. {
  503. roundedNum11=0;
  504. }
  505. else
  506. {
  507. double num11 = double.Parse(json1[i][j]);
  508. roundedNum11 = (int)Math.Round(num11);
  509. }
  510. texts4[5].text=roundedNum11.ToString("#,##0");
  511. }
  512. if (j ==12)
  513. {
  514. if (checkitem.Contains("*"))
  515. {
  516. int rtotal12 = (int)Math.Round(total12);
  517. texts4[6].text=rtotal12.ToString("#,##0");
  518. }
  519. else
  520. {
  521. int roundedNum12 = (int)Math.Round(num12);
  522. texts4[6].text=roundedNum12.ToString("#,##0");
  523. }
  524. }
  525. if (j ==13)
  526. {
  527. int roundedNum13;
  528. if (json1[i][j]==null)
  529. {
  530. roundedNum13=0;
  531. }
  532. else
  533. {
  534. double num13 = double.Parse(json1[i][j]);
  535. roundedNum13 = (int)Math.Round(num13);
  536. }
  537. texts4[7].text=roundedNum13.ToString("#,##0");
  538. }
  539. if (j ==14)
  540. {
  541. if (checkitem.Contains("*"))
  542. {
  543. int rtotal14 = (int)Math.Round(total14);
  544. texts4[8].text=rtotal14.ToString("#,##0");
  545. }
  546. else
  547. {
  548. int roundedNum14 = (int)Math.Round(num14);
  549. texts4[8].text=roundedNum14.ToString("#,##0");
  550. }
  551. }
  552. if (j ==15)
  553. {
  554. int roundedNum15;
  555. if (json1[i][j]==null)
  556. {
  557. roundedNum15=0;
  558. }
  559. else
  560. {
  561. double num15 = double.Parse(json1[i][j]);
  562. roundedNum15 = (int)Math.Round(num15);
  563. }
  564. texts4[9].text=roundedNum15.ToString("#,##0");
  565. }
  566. if (j ==16)
  567. {
  568. if (checkitem.Contains("*"))
  569. {
  570. int rtotal16 = (int)Math.Round(total16);
  571. texts4[10].text=rtotal16.ToString("#,##0");
  572. }
  573. else
  574. {
  575. int roundedNum16 = (int)Math.Round(num16);
  576. texts4[10].text=roundedNum16.ToString("#,##0");
  577. }
  578. }
  579. if (j ==17)
  580. {
  581. if (checkitem.Contains("*"))
  582. {
  583. double total17 = total12+total16-total10-total14;
  584. int rtotal17 = (int)Math.Round(total17);
  585. texts4[11].text=rtotal17.ToString("#,##0");
  586. total10=0;
  587. total12=0;
  588. total14=0;
  589. total16=0;
  590. }
  591. else
  592. {
  593. double num17 = num12+num16-num10-num14;
  594. int roundedNum17 = (int)Math.Round(num17);
  595. texts4[11].text=roundedNum17.ToString("#,##0");
  596. }
  597. }
  598. }
  599. sum1+=100;
  600. textcopy1.Add(textname1);
  601. textcopy2.Add(textname2);
  602. }
  603. //Debug.Log(json.Count);
  604. //Debug.Log(json[0].Count);
  605. /*for (int i = 0; i < json.Count; i++)
  606. {
  607. for (int j = 1; j <json[0].Count; j++) {
  608. Debug.Log(json[i][j]);
  609. }
  610. }*/
  611. int sum = 0;
  612. long total = 0;
  613. long total1 = 0;
  614. long dis = 0;
  615. for (int i = 0; i<json.Count; i++)
  616. {
  617. GameObject textname = Instantiate(textPrefab) as GameObject;
  618. textname.GetComponent<RectTransform>().anchoredPosition = new Vector2(0, -sum);
  619. textname.transform.SetParent(textParent, false);
  620. //textname.GetComponent<RectTransform>().sizeDelta = new Vector2(textname.GetComponent<RectTransform>().sizeDelta.x, 75f);
  621. texts1 = textname.GetComponentsInChildren<TextMeshProUGUI>();
  622. //image = textname.GetComponentsInChildren<Image>();
  623. /*foreach (var ima in image)
  624. {
  625. ima.GetComponent<RectTransform>().sizeDelta = new Vector2(ima.GetComponent<RectTransform>().sizeDelta.x, 73f);
  626. }
  627. foreach (var text in texts1)
  628. {
  629. text.GetComponent<RectTransform>().sizeDelta = new Vector2(text.GetComponent<RectTransform>().sizeDelta.x, 73f);
  630. }*/
  631. for (int j = 0; j <json[0].Count-2; j++)
  632. {
  633. string pattern = @"[\u4e00-\u9fa5]+"; // 正規表達式:匹配一個或多個中文字符
  634. isTraditionalChinese = Regex.IsMatch(json[i][1].ToString(), pattern);
  635. string str = json[i][2].ToString();
  636. if (j == 3 || j == 5)
  637. {
  638. long num35 = (long)double.Parse(json[i][j+1]);
  639. if (j==5)
  640. {
  641. if (isTraditionalChinese==true)
  642. {
  643. total+=num35;
  644. total1+=num35;
  645. }
  646. if (str.Contains("管理費"))
  647. {
  648. total+=num35;
  649. total1+=num35;
  650. }
  651. if (str.Contains("折讓"))
  652. {
  653. total1+=num35;
  654. dis =num35;
  655. }
  656. texts1[j].text=num35.ToString("#,##0");
  657. }
  658. else
  659. {
  660. texts1[j].text=num35.ToString();
  661. }
  662. //texts1[j].text = json[i][j+1];
  663. }
  664. else if (j==4)
  665. {
  666. double num4 = double.Parse(json[i][j + 1]);
  667. long roundedNum = (long)Math.Round(num4);
  668. texts1[j].text=roundedNum.ToString("#,##0");
  669. }
  670. /*else if (j==1)
  671. {
  672. string item =json[i][j+1].ToString();
  673. item = item.Trim('"');
  674. int chineseCharCount = Regex.Matches(item, @"[\u4e00-\u9fa5]").Count;
  675. if (chineseCharCount>3)
  676. {
  677. int index = item.IndexOf(" ");
  678. string chinese = item.Substring(0, index);
  679. string English = item.Substring(index + 1);
  680. if (Main.Global.系統語言=="繁體中文")
  681. {
  682. texts1[j].text=chinese;
  683. }
  684. else
  685. {
  686. texts1[j].text=English;
  687. }
  688. }
  689. else
  690. {
  691. texts1[j].text = json[i][j+1];
  692. }
  693. }*/
  694. else
  695. {
  696. texts1[j].text = json[i][j+1];
  697. }
  698. }
  699. textcopy.Add(textname);
  700. sum+=75;
  701. }
  702. long doci = (long)Math.Round(doc);
  703. long doci1 = (long)Math.Round(doc1);
  704. long doci2 = (long)Math.Round(doc2);
  705. long doci3 = (long)Math.Round(doc3);
  706. double rate = 1-(doc/doc2);
  707. rate= rate*100;
  708. double rate1 = 1-(doc1/doc3);
  709. rate1= rate1*100;
  710. double rate2 = 1-((doc+doc1)/(doc2+doc3));
  711. rate2= rate2*100;
  712. double rate3 = 1-((doc+doc1)/(doc2+doc3+dis));
  713. rate3= rate3*100;
  714. if (double.IsNaN(rate))
  715. {
  716. rate=0;
  717. }
  718. if (double.IsNaN(rate1))
  719. {
  720. rate1=0;
  721. }
  722. if (double.IsNaN(rate2))
  723. {
  724. rate2=0;
  725. }
  726. if (double.IsNaN(rate3))
  727. {
  728. rate3=0;
  729. }
  730. 利潤比_錢.text=((int)Math.Round(rate)).ToString()+"%";
  731. 利潤比1_錢.text=((int)Math.Round(rate1)).ToString()+"%";
  732. 利潤比2_錢.text=((int)Math.Round(rate2)).ToString()+"%";
  733. 利潤比3_錢.text=((int)Math.Round(rate3)).ToString()+"%";
  734. 未折價前_錢.text=total.ToString("#,##0");
  735. 報價小計_錢.text=total1.ToString("#,##0");
  736. 預估工資總成本_錢.text=doci.ToString("#,##0");
  737. 預估材料總成本_錢.text=doci1.ToString("#,##0");
  738. 總成本_錢.text=(doci+doci1).ToString("#,##0");
  739. 預估工資總報價_錢.text=doci2.ToString("#,##0");
  740. 預估材料總報價_錢.text=doci3.ToString("#,##0");
  741. 總報價_錢.text=(doci2+doci3).ToString("#,##0");
  742. 預估利潤_錢.text=((doci2+doci3)-((doci+doci1)-dis)).ToString("#,##0");
  743. textceneter.GetComponent<RectTransform>().sizeDelta = new Vector2(1420, sum);
  744. textceneter1.GetComponent<RectTransform>().sizeDelta = new Vector2(1420, sum1);
  745. textceneter2.GetComponent<RectTransform>().sizeDelta = new Vector2(976, sum1);
  746. 讀取面板.SetActive(false);
  747. }
  748. IEnumerator 判斷更新()
  749. {
  750. string strcon = "更新";
  751. string strUrl = string.Format(Main.Global.阿帕契路徑+"comm={0}", strcon);
  752. UnityWebRequest request = UnityWebRequest.Get(strUrl);
  753. yield return request.SendWebRequest();
  754. if (request.result == UnityWebRequest.Result.ConnectionError)
  755. {
  756. yield break;
  757. }
  758. string str = request.downloadHandler.text.ToString();
  759. Debug.Log(str);
  760. if (str == "系統更新")
  761. {
  762. change_Secen(1);
  763. }
  764. }
  765. IEnumerator 審核清單()
  766. {
  767. 讀取面板.SetActive(true);
  768. string strcon1 = "審核清單";
  769. string se = Main.Global.預設伺服器路徑;
  770. //string se = "id";
  771. string strUrl1 = string.Format(Main.Global.阿帕契路徑+"comm={0}&se={1}", strcon1, se);
  772. UnityWebRequest request1 = UnityWebRequest.Get(strUrl1);
  773. yield return request1.SendWebRequest();
  774. if (request1.result == UnityWebRequest.Result.ConnectionError)
  775. {
  776. //Debug.Log(request.error);
  777. yield break;
  778. }
  779. JSONNode json = JSON.Parse(request1.downloadHandler.text);
  780. JSONArray titleData = json["fieldNames"].AsArray;
  781. JSONArray rowData = json["rows"].AsArray;
  782. int titleCount = titleData.Count;
  783. int rowCount = rowData.Count;
  784. if (rowCount > 0)
  785. {
  786. 放行頁面關閉.SetActive(true);
  787. 放行頁面回到主畫面.SetActive(false);
  788. 合約清單.Clear();
  789. for (int i = 0; i<rowCount; i++)
  790. {
  791. string str = rowData[i][0];
  792. str=str.Trim('"');
  793. 合約清單.Add(str);
  794. }
  795. Main.Global.合約編號=合約清單[0];
  796. Debug.Log(Main.Global.合約編號);
  797. if (合約清單.Count == 1)
  798. {
  799. 左.SetActive(false);
  800. 右.SetActive(false);
  801. }
  802. else
  803. {
  804. 左.SetActive(false);
  805. 右.SetActive(true);
  806. }
  807. StartCoroutine(合約內容());
  808. }
  809. else
  810. {
  811. 讀取面板.SetActive(false);
  812. yield return new WaitForSeconds(2f);
  813. 放行頁面關閉.SetActive(false);
  814. 放行頁面回到主畫面.SetActive(true);
  815. 放行面板.SetActive(true);
  816. if (Main.Global.系統語言=="繁體中文")
  817. {
  818. 放行結果.text="目前沒有未審核的合約!!";
  819. }
  820. else if (Main.Global.系統語言=="簡體中文")
  821. {
  822. 放行結果.text="目前没有待审核的合约!!";
  823. }
  824. else if (Main.Global.系統語言=="English")
  825. {
  826. 放行結果.text="There are no pending contracts!!";
  827. }
  828. else
  829. {
  830. 放行結果.text="Saat ini tidak ada kontrak yang belum diverifikasi!!";
  831. }
  832. }
  833. }
  834. IEnumerator 報價放行寫入()
  835. {
  836. string strcon = "報價放行";
  837. string se = Main.Global.預設伺服器路徑;
  838. string strUrl = string.Format(Main.Global.阿帕契路徑+"comm={0}&se={1}&編號={2}", strcon, se, Main.Global.合約編號);
  839. UnityWebRequest request = UnityWebRequest.Get(strUrl);
  840. yield return request.SendWebRequest();
  841. if (request.result != UnityWebRequest.Result.Success)
  842. {
  843. 放行結果.text="error!!";
  844. }
  845. else
  846. {
  847. if (Main.Global.系統語言=="繁體中文")
  848. {
  849. 放行結果.text="合約"+ Main.Global.合約編號+"放行成功!!";
  850. }
  851. else if (Main.Global.系統語言=="簡體中文")
  852. {
  853. 放行結果.text="合同"+ Main.Global.合約編號+"放行成功!!";
  854. }
  855. else if (Main.Global.系統語言=="English")
  856. {
  857. 放行結果.text="Contract"+ Main.Global.合約編號+"Release successful!!";
  858. }
  859. else
  860. {
  861. 放行結果.text="Kontrak"+ Main.Global.合約編號+" Rilis dengan sukses!!";
  862. }
  863. Main.Global.合約編號="";
  864. if (textcopy != null)
  865. {
  866. DeletetextCopies();
  867. }
  868. nd=1;
  869. StartCoroutine(審核清單());
  870. }
  871. }
  872. public void 放行面板開啟()
  873. {
  874. 放行面板.SetActive(true);
  875. if (Main.Global.合約編號=="" || Main.Global.合約編號==null)
  876. {
  877. if (Main.Global.系統語言=="繁體中文")
  878. {
  879. 放行結果.text="沒有選擇合約!!";
  880. }
  881. else if (Main.Global.系統語言=="簡體中文")
  882. {
  883. 放行結果.text="没有选择合同!!";
  884. }
  885. else if (Main.Global.系統語言=="English")
  886. {
  887. 放行結果.text="No contract selected!!";
  888. }
  889. else
  890. {
  891. 放行結果.text="Silakan pilih kontrak!!";
  892. }
  893. }
  894. else
  895. {
  896. StartCoroutine(報價放行寫入());
  897. }
  898. }
  899. public void 放行面板開啟關閉()
  900. {
  901. 放行面板.SetActive(false);
  902. }
  903. public void 放行面板回到主畫面()
  904. {
  905. change_Secen(3);
  906. }
  907. public void setting_click()
  908. {
  909. 選擇面板.SetActive(true);
  910. }
  911. public void 上一頁_click()
  912. {
  913. 上一頁.SetActive(false);
  914. 下一頁.SetActive(true);
  915. 面板_建立.SetActive(true);
  916. 面板_明細.SetActive(false);
  917. 總價按鈕.SetActive(true);
  918. 利潤表按鈕.SetActive(false);
  919. }
  920. public void 利潤_click()
  921. {
  922. 面板_利潤.SetActive(!面板_利潤.activeSelf);
  923. 面板_利潤表頭.SetActive(!面板_利潤表頭.activeSelf);
  924. }
  925. public void 重新整理()
  926. {
  927. if (Main.Global.合約編號!=null)
  928. {
  929. if (textcopy != null)
  930. {
  931. DeletetextCopies();
  932. }
  933. StartCoroutine(合約內容());
  934. }
  935. }
  936. public void 下一頁_click()
  937. {
  938. 上一頁.SetActive(true);
  939. 下一頁.SetActive(false);
  940. 面板_明細.SetActive(true);
  941. 面板_建立.SetActive(false);
  942. 總價按鈕.SetActive(false);
  943. 利潤表按鈕.SetActive(true);
  944. }
  945. public void setting_中()
  946. {
  947. Main.Global.系統語言="繁體中文";
  948. 系統語言轉換();
  949. 語言選擇按鈕();
  950. 選擇面板.SetActive(false);
  951. StartCoroutine(合約內容());
  952. }
  953. public void setting_簡()
  954. {
  955. Main.Global.系統語言="簡體中文";
  956. 系統語言轉換();
  957. 語言選擇按鈕();
  958. 選擇面板.SetActive(false);
  959. StartCoroutine(合約內容());
  960. }
  961. public void setting_英()
  962. {
  963. Main.Global.系統語言="English";
  964. 系統語言轉換();
  965. 語言選擇按鈕();
  966. 選擇面板.SetActive(false);
  967. StartCoroutine(合約內容());
  968. }
  969. public void setting_印()
  970. {
  971. Main.Global.系統語言="Indonesian";
  972. 系統語言轉換();
  973. 語言選擇按鈕();
  974. 選擇面板.SetActive(false);
  975. StartCoroutine(合約內容());
  976. }
  977. public void 語言選擇按鈕()
  978. {
  979. if (bts == null)
  980. {
  981. if (Main.Global.系統語言=="繁體中文")
  982. {
  983. bts = new Button[] { 簡按鈕, 英按鈕, 印按鈕, 中按鈕 };
  984. }
  985. else if (Main.Global.系統語言=="簡體中文")
  986. {
  987. bts = new Button[] { 中按鈕, 英按鈕, 印按鈕, 簡按鈕 };
  988. }
  989. else if (Main.Global.系統語言=="English")
  990. {
  991. bts = new Button[] { 中按鈕, 簡按鈕, 印按鈕, 英按鈕 };
  992. }
  993. else
  994. {
  995. bts = new Button[] { 中按鈕, 簡按鈕, 英按鈕, 印按鈕 };
  996. }
  997. }
  998. else
  999. {
  1000. for (int j = 0; j < bts.Length; j++)
  1001. {
  1002. bts[j] = null;
  1003. }
  1004. if (Main.Global.系統語言=="繁體中文")
  1005. {
  1006. bts = new Button[] { 簡按鈕, 英按鈕, 印按鈕, 中按鈕 };
  1007. }
  1008. else if (Main.Global.系統語言=="簡體中文")
  1009. {
  1010. bts = new Button[] { 中按鈕, 英按鈕, 印按鈕, 簡按鈕 };
  1011. }
  1012. else if (Main.Global.系統語言=="English")
  1013. {
  1014. bts = new Button[] { 中按鈕, 簡按鈕, 印按鈕, 英按鈕 };
  1015. }
  1016. else
  1017. {
  1018. bts = new Button[] { 中按鈕, 簡按鈕, 英按鈕, 印按鈕 };
  1019. }
  1020. }
  1021. for (int i = 0; i < bts.Length; i++)
  1022. {
  1023. RectTransform rectTransform = bts[i].GetComponent<RectTransform>();
  1024. if (i==3)
  1025. {
  1026. rectTransform.anchoredPosition = new Vector2(1200, 1200);
  1027. }
  1028. else
  1029. {
  1030. rectTransform.anchoredPosition = new Vector2(300*i, 0);
  1031. }
  1032. }
  1033. }
  1034. public void setting_exit()
  1035. {
  1036. 選擇面板.SetActive(false);
  1037. }
  1038. public void exit_click()
  1039. {
  1040. change_Secen(3);
  1041. }
  1042. public void DeletetextCopies()
  1043. {
  1044. // 刪除複製出來的物件
  1045. foreach (GameObject copy in textcopy)
  1046. {
  1047. Destroy(copy);
  1048. }
  1049. foreach (GameObject copy in textcopy1)
  1050. {
  1051. Destroy(copy);
  1052. }
  1053. foreach (GameObject copy in textcopy2)
  1054. {
  1055. Destroy(copy);
  1056. }
  1057. textcopy.Clear();
  1058. textcopy1.Clear();
  1059. textcopy2.Clear();// 清空列表
  1060. }
  1061. public void 縮放_click()
  1062. {
  1063. image_row.SetActive(!image_row.activeSelf);
  1064. 報價.SetActive(false);
  1065. }
  1066. public void 總價_click()
  1067. {
  1068. 報價.SetActive(!報價.activeSelf);
  1069. image_row.SetActive(false);
  1070. }
  1071. public void change_Secen(int _screenNum)
  1072. {
  1073. SceneManager.LoadScene(_screenNum);
  1074. }
  1075. private void 系統語言轉換()
  1076. {
  1077. string 介面 = "H04";
  1078. if (Main.Global.系統語言=="繁體中文")
  1079. {
  1080. 合約報價單審核.text = Main.Global.系統語言字典[介面+"00CH"];
  1081. //建立合約資料.text = Main.Global.系統語言字典[介面+"01CH"];
  1082. //工程合約報價明細.text = Main.Global.系統語言字典[介面+"02CH"];
  1083. // 合約清單_tb.text = Main.Global.系統語言字典[介面+"03CH"];
  1084. 合約編號.text = Main.Global.系統語言字典[介面+"04CH"];
  1085. 客戶名稱.text = Main.Global.系統語言字典[介面+"05CH"];
  1086. 負責人.text = Main.Global.系統語言字典[介面+"06CH"];
  1087. 負責人1.text = Main.Global.系統語言字典[介面+"06CH"];
  1088. 工程地點.text = Main.Global.系統語言字典[介面+"07CH"];
  1089. 地址.text = Main.Global.系統語言字典[介面+"08CH"];
  1090. 地址1.text = Main.Global.系統語言字典[介面+"08CH"];
  1091. 工程名稱_tb.text = Main.Global.系統語言字典[介面+"09CH"];
  1092. 公司名稱.text = Main.Global.系統語言字典[介面+"10CH"];
  1093. 中.text = Main.Global.系統語言字典[介面+"11CH"];
  1094. 英.text = Main.Global.系統語言字典[介面+"12CH"];
  1095. 印.text = Main.Global.系統語言字典[介面+"13CH"];
  1096. 簡.text = Main.Global.系統語言字典[介面+"29CH"];
  1097. 選擇語言.text = Main.Global.系統語言字典[介面+"14CH"];
  1098. 未折價前.text = Main.Global.系統語言字典[介面+"15CH"];
  1099. 報價小計.text = Main.Global.系統語言字典[介面+"16CH"];
  1100. 預估工資總成本.text = Main.Global.系統語言字典[介面+"17CH"];
  1101. 預估材料總成本.text = Main.Global.系統語言字典[介面+"18CH"];
  1102. 總成本.text = Main.Global.系統語言字典[介面+"19CH"];
  1103. 總成本1.text = Main.Global.系統語言字典[介面+"19CH"];
  1104. 預估工資總報價.text = Main.Global.系統語言字典[介面+"20CH"];
  1105. 預估材料總報價.text = Main.Global.系統語言字典[介面+"21CH"];
  1106. 總報價.text = Main.Global.系統語言字典[介面+"22CH"];
  1107. 總報價1.text = Main.Global.系統語言字典[介面+"22CH"];
  1108. 利潤比.text = Main.Global.系統語言字典[介面+"23CH"];
  1109. 利潤比1.text = Main.Global.系統語言字典[介面+"23CH"];
  1110. 利潤比2.text = Main.Global.系統語言字典[介面+"24CH"];
  1111. 利潤比3.text = Main.Global.系統語言字典[介面+"25CH"];
  1112. 預估利潤.text = Main.Global.系統語言字典[介面+"26CH"];
  1113. 折讓金額.text = Main.Global.系統語言字典[介面+"27CH"];
  1114. }
  1115. else if (Main.Global.系統語言=="簡體中文")
  1116. {
  1117. 合約報價單審核.text = Main.Global.系統語言字典[介面+"00CS"];
  1118. //建立合約資料.text = Main.Global.系統語言字典[介面+"01CH"];
  1119. //工程合約報價明細.text = Main.Global.系統語言字典[介面+"02CH"];
  1120. // 合約清單_tb.text = Main.Global.系統語言字典[介面+"03CH"];
  1121. 合約編號.text = Main.Global.系統語言字典[介面+"04CS"];
  1122. 客戶名稱.text = Main.Global.系統語言字典[介面+"05CS"];
  1123. 負責人.text = Main.Global.系統語言字典[介面+"06CS"];
  1124. 負責人1.text = Main.Global.系統語言字典[介面+"06CS"];
  1125. 工程地點.text = Main.Global.系統語言字典[介面+"07CS"];
  1126. 地址.text = Main.Global.系統語言字典[介面+"08CS"];
  1127. 地址1.text = Main.Global.系統語言字典[介面+"08CS"];
  1128. 工程名稱_tb.text = Main.Global.系統語言字典[介面+"09CS"];
  1129. 公司名稱.text = Main.Global.系統語言字典[介面+"10CS"];
  1130. 中.text = Main.Global.系統語言字典[介面+"11CS"];
  1131. 英.text = Main.Global.系統語言字典[介面+"12CS"];
  1132. 印.text = Main.Global.系統語言字典[介面+"13CS"];
  1133. 簡.text = Main.Global.系統語言字典[介面+"29CS"];
  1134. 選擇語言.text = Main.Global.系統語言字典[介面+"14CS"];
  1135. 未折價前.text = Main.Global.系統語言字典[介面+"15CS"];
  1136. 報價小計.text = Main.Global.系統語言字典[介面+"16CS"];
  1137. 預估工資總成本.text = Main.Global.系統語言字典[介面+"17CS"];
  1138. 預估材料總成本.text = Main.Global.系統語言字典[介面+"18CS"];
  1139. 總成本.text = Main.Global.系統語言字典[介面+"19CS"];
  1140. 總成本1.text = Main.Global.系統語言字典[介面+"19CS"];
  1141. 預估工資總報價.text = Main.Global.系統語言字典[介面+"20CS"];
  1142. 預估材料總報價.text = Main.Global.系統語言字典[介面+"21CS"];
  1143. 總報價.text = Main.Global.系統語言字典[介面+"22CS"];
  1144. 總報價1.text = Main.Global.系統語言字典[介面+"22CS"];
  1145. 利潤比.text = Main.Global.系統語言字典[介面+"23CS"];
  1146. 利潤比1.text = Main.Global.系統語言字典[介面+"23CS"];
  1147. 利潤比2.text = Main.Global.系統語言字典[介面+"24CS"];
  1148. 利潤比3.text = Main.Global.系統語言字典[介面+"25CS"];
  1149. 預估利潤.text = Main.Global.系統語言字典[介面+"26CS"];
  1150. 折讓金額.text = Main.Global.系統語言字典[介面+"27CS"];
  1151. }
  1152. else if (Main.Global.系統語言=="English")
  1153. {
  1154. 合約報價單審核.text = Main.Global.系統語言字典[介面+"00EN"];
  1155. //建立合約資料.text = Main.Global.系統語言字典[介面+"01EN"];
  1156. //工程合約報價明細.text = Main.Global.系統語言字典[介面+"02EN"];
  1157. //合約清單_tb.text = Main.Global.系統語言字典[介面+"03EN"];
  1158. 合約編號.text = Main.Global.系統語言字典[介面+"04EN"];
  1159. 客戶名稱.text = Main.Global.系統語言字典[介面+"05EN"];
  1160. 負責人.text = Main.Global.系統語言字典[介面+"06EN"];
  1161. 負責人1.text = Main.Global.系統語言字典[介面+"06EN"];
  1162. 工程地點.text = Main.Global.系統語言字典[介面+"07EN"];
  1163. 地址.text = Main.Global.系統語言字典[介面+"08EN"];
  1164. 地址1.text = Main.Global.系統語言字典[介面+"08EN"];
  1165. 工程名稱_tb.text = Main.Global.系統語言字典[介面+"09EN"];
  1166. 公司名稱.text = Main.Global.系統語言字典[介面+"10EN"];
  1167. 中.text = Main.Global.系統語言字典[介面+"11EN"];
  1168. 英.text = Main.Global.系統語言字典[介面+"12EN"];
  1169. 印.text = Main.Global.系統語言字典[介面+"13EN"];
  1170. 簡.text = Main.Global.系統語言字典[介面+"29EN"];
  1171. 選擇語言.text = Main.Global.系統語言字典[介面+"14EN"];
  1172. 未折價前.text = Main.Global.系統語言字典[介面+"15EN"];
  1173. 報價小計.text = Main.Global.系統語言字典[介面+"16EN"];
  1174. 預估工資總成本.text = Main.Global.系統語言字典[介面+"17EN"];
  1175. 預估材料總成本.text = Main.Global.系統語言字典[介面+"18EN"];
  1176. 總成本.text = Main.Global.系統語言字典[介面+"19EN"];
  1177. 總成本1.text = Main.Global.系統語言字典[介面+"19EN"];
  1178. 預估工資總報價.text = Main.Global.系統語言字典[介面+"20EN"];
  1179. 預估材料總報價.text = Main.Global.系統語言字典[介面+"21EN"];
  1180. 總報價.text = Main.Global.系統語言字典[介面+"22EN"];
  1181. 總報價1.text = Main.Global.系統語言字典[介面+"22EN"];
  1182. 利潤比.text = Main.Global.系統語言字典[介面+"23EN"];
  1183. 利潤比1.text = Main.Global.系統語言字典[介面+"23EN"];
  1184. 利潤比2.text = Main.Global.系統語言字典[介面+"24EN"];
  1185. 利潤比3.text = Main.Global.系統語言字典[介面+"25EN"];
  1186. 預估利潤.text = Main.Global.系統語言字典[介面+"26EN"];
  1187. 折讓金額.text = Main.Global.系統語言字典[介面+"27EN"];
  1188. }
  1189. else
  1190. {
  1191. 合約報價單審核.text = Main.Global.系統語言字典[介面+"00ID"];
  1192. // 建立合約資料.text = Main.Global.系統語言字典[介面+"01ID"];
  1193. //工程合約報價明細.text = Main.Global.系統語言字典[介面+"02ID"];
  1194. //合約清單_tb.text = Main.Global.系統語言字典[介面+"03ID"];
  1195. 合約編號.text = Main.Global.系統語言字典[介面+"04ID"];
  1196. 客戶名稱.text = Main.Global.系統語言字典[介面+"05ID"];
  1197. 負責人.text = Main.Global.系統語言字典[介面+"06ID"];
  1198. 負責人1.text = Main.Global.系統語言字典[介面+"06ID"];
  1199. 工程地點.text = Main.Global.系統語言字典[介面+"07ID"];
  1200. 地址.text = Main.Global.系統語言字典[介面+"08ID"];
  1201. 地址1.text = Main.Global.系統語言字典[介面+"08ID"];
  1202. 工程名稱_tb.text = Main.Global.系統語言字典[介面+"09ID"];
  1203. 公司名稱.text = Main.Global.系統語言字典[介面+"10ID"];
  1204. 中.text = Main.Global.系統語言字典[介面+"11ID"];
  1205. 英.text = Main.Global.系統語言字典[介面+"12ID"];
  1206. 印.text = Main.Global.系統語言字典[介面+"13ID"];
  1207. 簡.text = Main.Global.系統語言字典[介面+"29ID"];
  1208. 選擇語言.text = Main.Global.系統語言字典[介面+"14ID"];
  1209. 未折價前.text = Main.Global.系統語言字典[介面+"15ID"];
  1210. 報價小計.text = Main.Global.系統語言字典[介面+"16ID"];
  1211. 預估工資總成本.text = Main.Global.系統語言字典[介面+"17ID"];
  1212. 預估材料總成本.text = Main.Global.系統語言字典[介面+"18ID"];
  1213. 總成本.text = Main.Global.系統語言字典[介面+"19ID"];
  1214. 總成本1.text = Main.Global.系統語言字典[介面+"19ID"];
  1215. 預估工資總報價.text = Main.Global.系統語言字典[介面+"20ID"];
  1216. 預估材料總報價.text = Main.Global.系統語言字典[介面+"21ID"];
  1217. 總報價.text = Main.Global.系統語言字典[介面+"22ID"];
  1218. 總報價1.text = Main.Global.系統語言字典[介面+"22ID"];
  1219. 利潤比.text = Main.Global.系統語言字典[介面+"23ID"];
  1220. 利潤比1.text = Main.Global.系統語言字典[介面+"23ID"];
  1221. 利潤比2.text = Main.Global.系統語言字典[介面+"24ID"];
  1222. 利潤比3.text = Main.Global.系統語言字典[介面+"25ID"];
  1223. 預估利潤.text = Main.Global.系統語言字典[介面+"26ID"];
  1224. 折讓金額.text = Main.Global.系統語言字典[介面+"27ID"];
  1225. }
  1226. }
  1227. private void 初始化系統語言()
  1228. {
  1229. TextAsset txt = Resources.Load("Tran") as TextAsset;
  1230. Main.Global.系統語言資料=txt.text.Split('\n');
  1231. for (int i = 1; i<=Main.Global.系統語言資料.Length; i++)
  1232. {
  1233. try
  1234. {
  1235. string key = Main.Global.系統語言資料[i].ToString().Substring(0, 3)+Main.Global.系統語言資料[i].ToString().Substring(4, 2)+Main.Global.系統語言資料[i].ToString().Substring(7, 2);
  1236. Main.Global.系統語言字典.Add(key, Main.Global.系統語言資料[i].ToString().Substring(10));
  1237. }
  1238. catch
  1239. {
  1240. // Debug.Log("No data");
  1241. }
  1242. }
  1243. }
  1244. }