1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626 |
- 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 chingo : MonoBehaviour
- {
- public GameObject buttonPrefab;
- public Transform buttonParent;
- public GameObject buttonceneter;
-
- public GameObject buttonPrefab1;
- public Transform buttonParent1;
-
- public GameObject buttonPrefab2;
- public Transform buttonParent2;
- public GameObject buttonceneter2;
-
- public GameObject buttonPrefab3;
- public Transform buttonParent3;
- public GameObject buttonceneter3;
-
- public GameObject buttonPrefab4;
- public Transform buttonParent4;
- public GameObject buttonceneter4;
-
- public GameObject textPrefab;
- public Transform textParent;
- public GameObject textceneter;
-
- public GameObject imagePrefab;
- public Transform paneltransform;
-
- private TextMeshProUGUI[] texts;
- [SerializeField] TextMeshProUGUI 選擇主項;
- [SerializeField] TextMeshProUGUI 選擇物料;
- [SerializeField] TextMeshProUGUI 選擇規格數量;
-
- [SerializeField] TextMeshProUGUI 管材s;
- [SerializeField] TextMeshProUGUI 電線s;
- [SerializeField] TextMeshProUGUI 電料s;
- [SerializeField] TextMeshProUGUI 槽架s;
- [SerializeField] TextMeshProUGUI 建材s;
- [SerializeField] TextMeshProUGUI 五金s;
- [SerializeField] TextMeshProUGUI 設備s;
- [SerializeField] TextMeshProUGUI 工具s;
- [SerializeField] TextMeshProUGUI 日用s;
- [SerializeField] TextMeshProUGUI 其他s;
- [SerializeField] TextMeshProUGUI 輸入授權碼;
- [SerializeField] TextMeshProUGUI 指定倉庫;
- [SerializeField] TextMeshProUGUI 申請人;
- [SerializeField] TextMeshProUGUI 請購單號;
- [SerializeField] TextMeshProUGUI 合約號;
- [SerializeField] TextMeshProUGUI 申請日期;
- [SerializeField] TextMeshProUGUI 需求日期;
- [SerializeField] TextMeshProUGUI 備註;
- [SerializeField] TextMeshProUGUI 項次;
- [SerializeField] TextMeshProUGUI 品名;
- [SerializeField] TextMeshProUGUI 規格;
- [SerializeField] TextMeshProUGUI 數量;
- [SerializeField] TextMeshProUGUI 單位;
- [SerializeField] TextMeshProUGUI 圖片;
- [SerializeField] TextMeshProUGUI 修改;
- [SerializeField] TextMeshProUGUI 刪除;
-
-
- [SerializeField] GameObject 語言選擇面板;
- [SerializeField] TextMeshProUGUI 選擇語言;
- [SerializeField] TextMeshProUGUI 中;
- [SerializeField] TextMeshProUGUI 英;
- [SerializeField] TextMeshProUGUI 印;
- [SerializeField] TextMeshProUGUI 簡;
- [SerializeField] Button 中按鈕;
- [SerializeField] Button 英按鈕;
- [SerializeField] Button 印按鈕;
- [SerializeField] Button 簡按鈕;
-
- [SerializeField] GameObject 彈窗按鈕_底圖1;
- [SerializeField] GameObject 彈窗按鈕_底圖2;
- [SerializeField] GameObject 彈窗按鈕_Y;
- [SerializeField] GameObject 彈窗按鈕_N;
- [SerializeField] GameObject 彈窗按鈕_Y1;
- [SerializeField] GameObject 彈窗按鈕_N1;
- [SerializeField] GameObject 彈窗按鈕X;
- [SerializeField] GameObject 畫面一;
- [SerializeField] GameObject 畫面四;
- [SerializeField] GameObject 畫面二;
- [SerializeField] GameObject 畫面三;
- [SerializeField] GameObject 畫面五;
- [SerializeField] GameObject 畫面六;
- [SerializeField] GameObject 畫面七;
- [SerializeField] GameObject 畫面驗證碼;
- [SerializeField] GameObject 畫面彈出;
- [SerializeField] GameObject 有合約號返回;
- [SerializeField] GameObject 購物按鈕;
- [SerializeField] GameObject 申請按鈕;
- [SerializeField] GameObject 備註寫入葉面;
- [SerializeField] TextMeshProUGUI 彈出s;
- [SerializeField] TextMeshProUGUI 申請日期s;
- [SerializeField] TextMeshProUGUI 需求日期s;
- [SerializeField] TextMeshProUGUI Dates;
- [SerializeField] TextMeshProUGUI Nos;
- [SerializeField] TextMeshProUGUI A方s;
- [SerializeField] TextMeshProUGUI B方s;
- [SerializeField] TextMeshProUGUI 聲請人s;
- [SerializeField] TextMeshProUGUI 請購單號s;
- [SerializeField] TextMeshProUGUI 合約號和驗證碼;
- [SerializeField] TMP_InputField 備註s;
- [SerializeField] TMP_InputField 驗證碼;
- [SerializeField] TMP_InputField 備註ss;
- [SerializeField] Button 備註導入;
- [SerializeField] TMP_Dropdown 倉名下拉;
- [SerializeField] RawImage rowImage;
- [SerializeField] Image 末項_輸入數量;
- [SerializeField] TextMeshProUGUI 是否有合約號;
- [SerializeField] TextMeshProUGUI 選擇甲方;
- [SerializeField] TextMeshProUGUI 選擇合約;
-
-
-
- public Sprite 沒圖;
- private List<GameObject> copy = new List<GameObject>();
- private List<GameObject> copy1 = new List<GameObject>();
- private List<GameObject> copy2 = new List<GameObject>();
- private List<GameObject> copy3 = new List<GameObject>();
- private List<GameObject> copy4 = new List<GameObject>();
- private List<GameObject> copy5 = new List<GameObject>();
- private TextMeshProUGUI[] texts1;
- private TextMeshProUGUI[] texts2;
- private TextMeshProUGUI[] texts3;
- private Button[] bts;
- private Button[] bts1;
- string 合約號s;
- bool 有無合約號;
- string[] strArray = new string[4];
- string[] 倉儲 = new string[2];
-
- public CanvasScaler canvasScaler;
- public float idleTime = 300f; // 5分鐘的閒置時間
- private float timeSinceLastInteraction = 0f;
-
- private JSONNode jsonData;
-
- private float timer = 0f;
- private float interval = 60f;
- // Start is called before the first frame update
- [SerializeField] GameObject 讀取面板;
- [SerializeField] TextMeshProUGUI 讀取;
- private string loadingText = "";
- private int dotCount = 0;
-
- [SerializeField] GameObject 網頁面板;
- UniWebView webView;
- public GameObject panel;
- float scale = 0;
- float xbar = 0;
- float ybar = 0;
- RectTransform panelRectTransform;
-
- bool L;
- bool W;
- bool M;
-
- void Start()
- {
- Main.Global.qwe=true;
- Screen.autorotateToPortrait = false;
- Screen.orientation = ScreenOrientation.LandscapeLeft;
-
- 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;
- }
- if (canvasScaler.matchWidthOrHeight == 0f)
- {
- scale = screenWidth / 1600;
- xbar=0;
- ybar=(screenHeight-(1000*scale))/2;
- }
- else
- {
- scale = screenHeight/ 1000;
- xbar=(screenWidth-(1600*scale))/2;
- ybar=0;
- }
-
- panelRectTransform = panel.GetComponent<RectTransform>();
-
- 畫面一.SetActive(true);
- 畫面二.SetActive(false);
- 畫面三.SetActive(false);
- 購物按鈕.SetActive(false);
- 申請按鈕.SetActive(false);
- //初始化系統語言();
- //Main.Global.系統語言="繁體中文";
- 系統語言轉換();
- 語言選擇按鈕();
- //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.人員="李協叡";
- //Main.Global.預設伺服器路徑="tw";
- StartCoroutine(判斷更新());
- StartCoroutine(AnimateText());
- Main.Global.有無清單=false;
- DateTime currentDate = DateTime.Now;
- 申請日期s.text=currentDate.ToString("yyyy/MM/dd");
- DateTime today = DateTime.Today;
- DateTime sevenDaysLater = today.AddDays(7);
- 需求日期s.text=sevenDaysLater.ToString("yyyy/MM/dd");
- 讀取面板.SetActive(true);
- 網頁(panelRectTransform, scale, xbar, ybar);
- 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)
- {
- string qwe = 請購單號s.text;
- StartCoroutine(刪除請購單(qwe));
- change_Secen(1);
- }
- }
- }
- }
- 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 == "系統更新")
- {
- string qwe = 請購單號s.text;
- StartCoroutine(刪除請購單(qwe));
- change_Secen(1);
- }
- }
- IEnumerator 採購合約清單(string asd)
- {
- string strcon1 = "採購合約清單";
- string se = Main.Global.預設伺服器路徑;
-
- string strUrl1 = string.Format(Main.Global.阿帕契路徑+"comm={0}&se={1}&甲={2}", strcon1, se, asd);
- 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);
- int sum = 0;
- for (int i = 0; i < json.Count; i++)
- {
- GameObject buttonObj = Instantiate(buttonPrefab) as GameObject;
- buttonObj.GetComponent<RectTransform>().anchoredPosition = new Vector2(2, -sum);
- buttonObj.transform.SetParent(buttonParent, false);
- Button newButton = buttonObj.GetComponentInChildren<Button>();
- string idname = json[i][0].ToString();
- idname=idname.Trim('"');
- newButton.onClick.AddListener(() => OnClick(idname));
- texts = buttonObj.GetComponentsInChildren<TextMeshProUGUI>();
- if (Main.Global.系統語言=="繁體中文" || Main.Global.系統語言=="簡體中文")
- {
- texts[0].text=json[i][0];
- texts[1].text=json[i][1];
- }
- else
- {
- texts[0].text=json[i][0];
- texts[1].text=json[i][2];
- }
-
- sum+=75;
- copy.Add(buttonObj);
- }
- buttonceneter.GetComponent<RectTransform>().sizeDelta = new Vector2(buttonceneter.GetComponent<RectTransform>().sizeDelta.x, sum);
- 讀取面板.SetActive(false);
- }
- IEnumerator 採購甲方讀取()
- {
-
- string strcon1 = "採購甲方讀取";
- string se = Main.Global.預設伺服器路徑;
- 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);
- for (int i = 0; i<json.Count; i++)
- {
- GameObject buttonObj = Instantiate(buttonPrefab1) as GameObject;
- float xPos = i % 4 * 350f;
- float yPos = i / 4 * -150f;
- buttonObj.GetComponent<RectTransform>().anchoredPosition = new Vector2(xPos, yPos);
- buttonObj.transform.SetParent(buttonParent1, false);
- Button newButton = buttonObj.GetComponentInChildren<Button>();
- string idname = json[i].ToString();
- idname=idname.Trim('"');
- buttonObj.GetComponentInChildren<TextMeshProUGUI>().text = idname;
- newButton.onClick.AddListener(() => OnClick1(idname));
- }
- 讀取面板.SetActive(false);
- }
-
- IEnumerator 倉名讀取()
- {
- List<TMP_Dropdown.OptionData> options1 = new List<TMP_Dropdown.OptionData>();
- 倉名下拉.options.Clear();
- string strcon1 = "倉名讀取";
- string se = Main.Global.預設伺服器路徑;
- 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);
- options1.Add(new TMP_Dropdown.OptionData(""));
- for (int i = 0; i<json.Count; i++)
- {
- string str = json[i].ToString();
- str=str.Trim('"');
- options1.Add(new TMP_Dropdown.OptionData(str));
- }
- 倉名下拉.AddOptions(options1);
- yield return StartCoroutine(採購甲方讀取());
- }
- public void DeletetextCopy()
- {
- // 刪除複製出來的物件
- foreach (GameObject i in copy)
- {
- Destroy(i);
- }
- copy.Clear();
- }
- public void DeletetextCopy1()
- {
- // 刪除複製出來的物件
- foreach (GameObject i in copy1)
- {
- Destroy(i);
- }
- copy1.Clear();
- }
- public void DeletetextCopy2()
- {
- // 刪除複製出來的物件
- foreach (GameObject i in copy2)
- {
- Destroy(i);
- }
- copy2.Clear();
- }
- public void DeletetextCopy5()
- {
- // 刪除複製出來的物件
- foreach (GameObject i in copy5)
- {
- Destroy(i);
- }
- copy5.Clear();
- }
- public void DeletetextCopy34()
- {
- // 刪除複製出來的物件
- foreach (GameObject i in copy3)
- {
- Destroy(i);
- }
- copy3.Clear();
- foreach (GameObject i in copy4)
- {
- Destroy(i);
- }
- copy4.Clear();
- }
-
- public void 讀取倉儲()
- {
- StartCoroutine(倉儲資料());
- }
- IEnumerator 倉儲資料()
- {
- string strcon1 = "倉儲資料";
- string se = Main.Global.預設伺服器路徑;
- string pa = 倉名下拉.options[倉名下拉.value].text;
- string strUrl1 = string.Format(Main.Global.阿帕契路徑+"comm={0}&se={1}&PA22={2}", strcon1, se, pa);
- 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);
- 倉儲[0]=json[0];
- 倉儲[1]=json[1];
- //Debug.Log(倉儲[1]);
- }
-
- public void OnClick(string name)
- {
- 合約號s=name;
- 畫面一.SetActive(false);
- 畫面二.SetActive(false);
- 畫面三.SetActive(false);
- 畫面四.SetActive(true);
- 購物按鈕.SetActive(true);
- 申請按鈕.SetActive(true);
- 合約號和驗證碼.text=name;
- string[] substrings = name.Split(' ');
- string[] result = new string[substrings.Length * 2];
- for (int i = 0; i < substrings.Length; i++)
- {
- string[] parts = substrings[i].Split('-');
- result[i * 2] = parts[0];
- result[i * 2 + 1] = parts[1];
- }
- B方s.text=result[0];
- A方s.text=result[1];
- Dates.text=result[2];
- Nos.text=result[3];
- if (copy5 != null)
- {
- DeletetextCopy5();
- }
- StartCoroutine(流水號查詢());
- }
- public void 無合約button()
- {
- 有無合約號=false;
- 畫面一.SetActive(false);
- 畫面二.SetActive(false);
- 畫面三.SetActive(false);
- 畫面四.SetActive(true);
- 購物按鈕.SetActive(true);
- 申請按鈕.SetActive(true);
- 畫面驗證碼.SetActive(true);
-
-
- }
- public void 有合約button()
- {
- 有無合約號=true;
- 畫面一.SetActive(false);
- 畫面二.SetActive(true);
- 畫面三.SetActive(false);
- 畫面四.SetActive(false);
- 畫面驗證碼.SetActive(false);
-
-
- }
- public void 申請完成按鈕Y1()
- {
- if (Main.Global.系統語言=="繁體中文")
- {
- 彈出s.text="確認數量修改後是否儲存";
- }
- else if (Main.Global.系統語言=="簡體中文")
- {
- 彈出s.text="确认数量更改后是否保存";
- }
- else if (Main.Global.系統語言=="English")
- {
- 彈出s.text="Confirm to save the quantity changes";
- }
- else
- {
- 彈出s.text="Konfirmasi untuk menyimpan perubahan kuantitas";
- }
- 彈窗按鈕_底圖1.SetActive(true);
- 彈窗按鈕_底圖2.SetActive(true);
- 彈窗按鈕_Y1.SetActive(false);
- 彈窗按鈕_N1.SetActive(false);
- 彈窗按鈕X.SetActive(true);
- 彈窗按鈕_Y.SetActive(true);
- 彈窗按鈕_N.SetActive(true);
- }
- public void 申請完成按鈕N1()
- {
- 彈窗按鈕X.SetActive(true);
- 畫面彈出.SetActive(false);
- 彈窗按鈕_Y1.SetActive(false);
- 彈窗按鈕_N1.SetActive(false);
- 彈窗按鈕_底圖1.SetActive(false);
- 彈窗按鈕_底圖2.SetActive(false);
- string qwe = 請購單號s.text;
- StartCoroutine(刪除請購單(qwe));
- 購物按鈕.SetActive(false);
- 申請按鈕.SetActive(false);
- Main.Global.有無清單=false;
- if (有無合約號==true)
- {
- 聲請人s.text="";
- 備註s.text="";
- 請購單號s.text="";
- 合約號和驗證碼.text="";
- B方s.text="";
- A方s.text="";
- Dates.text="";
- Nos.text="";
- 倉名下拉.value = 0;
- 倉儲[0]="";
- 倉儲[1]="";
- 畫面一.SetActive(false);
- 畫面二.SetActive(false);
- 畫面三.SetActive(true);
- 畫面四.SetActive(false);
- }
- else
- {
- 聲請人s.text="";
- 請購單號s.text="";
- 合約號和驗證碼.text="";
- 備註s.text="";
- 驗證碼.text="";
- 倉名下拉.value = 0;
- 倉儲[0]="";
- 倉儲[1]="";
- 畫面一.SetActive(true);
- 畫面二.SetActive(false);
- 畫面三.SetActive(false);
- 畫面四.SetActive(false);
- }
- }
- public void 上一頁()
- {
- if (畫面二.activeSelf)
- {
- 畫面一.SetActive(true);
- 畫面二.SetActive(false);
- 畫面三.SetActive(false);
- 畫面四.SetActive(false);
- }
- if (畫面三.activeSelf)
- {
- if (copy != null)
- {
- DeletetextCopy();
- }
- 畫面一.SetActive(false);
- 畫面二.SetActive(true);
- 畫面三.SetActive(false);
- 畫面四.SetActive(false);
- }
- if (畫面四.activeSelf)
- {
- if (Main.Global.有無清單==true)
- {
- 畫面彈出.SetActive(true);
- if (Main.Global.系統語言=="繁體中文")
- {
- 彈出s.text="有讀取到清單是否要完成申請";
- }
- else if (Main.Global.系統語言=="簡體中文")
- {
- 彈出s.text="有读取到清单是否要完成申请";
- }
- else if (Main.Global.系統語言=="English")
- {
- 彈出s.text="Do you want to complete the application since the list has been loaded";
- }
- else
- {
- 彈出s.text="Apakah Anda ingin menyelesaikan aplikasi karena daftar telah dimuat";
- }
- 彈窗按鈕_Y1.SetActive(true);
- 彈窗按鈕_N1.SetActive(true);
- 彈窗按鈕_底圖1.SetActive(true);
- 彈窗按鈕_底圖2.SetActive(true);
- 彈窗按鈕X.SetActive(false);
- }
- else
- {
- string qwe = 請購單號s.text;
- StartCoroutine(刪除請購單(qwe));
- 購物按鈕.SetActive(false);
- 申請按鈕.SetActive(false);
- if (有無合約號==true)
- {
- 聲請人s.text="";
- 備註s.text="";
- 請購單號s.text="";
- 合約號和驗證碼.text="";
- B方s.text="";
- A方s.text="";
- Dates.text="";
- Nos.text="";
- 倉名下拉.value = 0;
- 倉儲[0]="";
- 倉儲[1]="";
- 畫面一.SetActive(false);
- 畫面二.SetActive(false);
- 畫面三.SetActive(true);
- 畫面四.SetActive(false);
- }
- else
- {
- 聲請人s.text="";
- 請購單號s.text="";
- 合約號和驗證碼.text="";
- 備註s.text="";
- 驗證碼.text="";
- 倉名下拉.value = 0;
- 倉儲[0]="";
- 倉儲[1]="";
- 畫面一.SetActive(true);
- 畫面二.SetActive(false);
- 畫面三.SetActive(false);
- 畫面四.SetActive(false);
- }
- }
-
- }
- if (畫面五.activeSelf)
- {
- 畫面一.SetActive(false);
- 畫面二.SetActive(false);
- 畫面三.SetActive(false);
- 購物按鈕.SetActive(true);
- 申請按鈕.SetActive(true);
- 畫面四.SetActive(true);
- 畫面五.SetActive(false);
- 畫面六.SetActive(false);
- if (copy5 != null)
- {
- DeletetextCopy5();
- }
- StartCoroutine(明細表清單());
- }
- if (畫面六.activeSelf)
- {
- if (copy2 != null)
- {
- DeletetextCopy2();
- }
- 畫面一.SetActive(false);
- 畫面二.SetActive(false);
- 畫面三.SetActive(false);
- 畫面四.SetActive(false);
- 畫面五.SetActive(true);
- 畫面六.SetActive(false);
- }
- if (畫面七.activeSelf)
- {
- if (copy3 != null)
- {
- DeletetextCopy34();
- }
- rowImage.texture = Texture2D.blackTexture;
- 畫面一.SetActive(false);
- 畫面二.SetActive(false);
- 畫面三.SetActive(false);
- 畫面四.SetActive(false);
- 畫面五.SetActive(false);
- 畫面六.SetActive(true);
- 畫面七.SetActive(false);
- }
- }
-
-
- public void OnClick1(string asd)
- {
- 讀取面板.SetActive(true);
- if (copy != null)
- {
- DeletetextCopy();
- }
- StartCoroutine(採購合約清單(asd));
- 畫面一.SetActive(false);
- 畫面二.SetActive(false);
- 畫面三.SetActive(true);
- 畫面四.SetActive(false);
- }
- public void 購物()
- {
- if (畫面四.activeSelf)
- {
- if (倉名下拉.value == 0)
- {
- 畫面彈出.SetActive(true);
-
- if (Main.Global.系統語言=="繁體中文")
- {
- 彈出s.text="請選擇倉名";
- }
- else if (Main.Global.系統語言=="簡體中文")
- {
- 彈出s.text="请选择仓名";
- }
- else if (Main.Global.系統語言=="English")
- {
- 彈出s.text="Please select a warehouse name";
- }
- else
- {
- 彈出s.text="Silakan pilih nama gudang";
- }
- }
- else
- {
- 畫面五.SetActive(true);
- 購物按鈕.SetActive(false);
- 申請按鈕.SetActive(false);
- 畫面四.SetActive(false);
- }
- }
- }
- public void 關閉畫面驗證碼()
- {
- 畫面一.SetActive(true);
- 畫面二.SetActive(false);
- 畫面三.SetActive(false);
- 畫面四.SetActive(false);
- 畫面驗證碼.SetActive(false);
-
- }
-
- public void 關閉彈出視窗()
- {
- 畫面彈出.SetActive(false);
- 彈窗按鈕_Y.SetActive(false);
- 彈窗按鈕_N.SetActive(false);
- 彈窗按鈕_底圖1.SetActive(false);
- 彈窗按鈕_底圖2.SetActive(false);
- 彈出s.text="";
- }
- public void 驗證授權碼()
- {
- string qwe = 驗證碼.text;
- StartCoroutine(驗證碼查詢(qwe));
-
- }
- IEnumerator 驗證碼查詢(string qwe)
- {
- Debug.Log(qwe);
- string strcon = "授權碼驗證";
- string se = Main.Global.預設伺服器路徑;
- string strUrl = string.Format(Main.Global.阿帕契路徑+"comm={0}&se={1}&PA9={2}", strcon, se, qwe);
- UnityWebRequest request = UnityWebRequest.Get(strUrl);
- yield return request.SendWebRequest();
- if (request.result == UnityWebRequest.Result.ConnectionError)
- {
- //Debug.Log(request.error);
- yield break;
- }
- string res = request.downloadHandler.text;
- Debug.Log(res);
- if (res == "有")
- {
- 畫面驗證碼.SetActive(false);
- 合約號和驗證碼.text= qwe;
- StartCoroutine(流水號查詢());
- }
- else
- {
- 驗證碼.text="";
- 畫面一.SetActive(true);
- 畫面二.SetActive(false);
- 畫面三.SetActive(false);
- 畫面四.SetActive(false);
- 畫面驗證碼.SetActive(false);
-
-
- }
-
-
- }
- IEnumerator 流水號查詢()
- {
- DateTime td = DateTime.Now;
- string dateString = td.ToString("yyyyMMdd");
- string qwe = "";
- for (int i = 1; i<=999; i++)
- {
- if (i<10)
- {
- qwe = "CR-"+dateString+"-00"+i.ToString();
- }
- else if (i>=10 && i<100)
- {
- qwe = "CR-"+dateString+"-0"+i.ToString();
- }
- else if (i>99)
- {
- qwe = "CR-"+dateString+"-"+i.ToString();
- }
- string strcon = "流水號查詢";
- string se = Main.Global.預設伺服器路徑;
- string strUrl = string.Format(Main.Global.阿帕契路徑+"comm={0}&se={1}&PA={2}", strcon, se, qwe);
- UnityWebRequest request = UnityWebRequest.Get(strUrl);
- yield return request.SendWebRequest();
- if (request.result == UnityWebRequest.Result.ConnectionError)
- {
- //Debug.Log(request.error);
- yield break;
- }
- string res = request.downloadHandler.text;
- if (res == "有")
- {
- continue;
- }
- else
- {
- break;
- }
- }
- //Debug.Log(qwe);
- StartCoroutine(新增請購單(qwe));
- 聲請人s.text=Main.Global.人員;
- 請購單號s.text=qwe;
- }
- IEnumerator 新增請購單(string asd)
- {
- string strcon = "新增請購單";
- string pa = asd;
- string pa1 = Main.Global.人員;
- DateTime Date = DateTime.Now;
- string pa2 =Date.ToString("yyyy/MM/dd-HH:mm:ss");
- string pa3 = 合約號和驗證碼.text;
- string pa4 = "";
- string pa5 = B方s.text;
- string pa6 = A方s.text;
- string pa7 = Dates.text;
- string pa8 = Nos.text;
- string se = Main.Global.預設伺服器路徑;
- string strUrl = string.Format(Main.Global.阿帕契路徑+"comm={0}&se={1}&PA={2}&PA1={3}&PA2={4}&PA3={5}&PA4={6}&PA5={7}&PA6={8}&PA7={9}&PA8={10}"
- , strcon, se, pa, pa1, pa2, pa3, pa4, pa5, pa6, pa7, pa8);
- UnityWebRequest request = UnityWebRequest.Get(strUrl);
- yield return request.SendWebRequest();
- if (request.result != UnityWebRequest.Result.Success)
- {
- Debug.LogError(request.error);
- }
- else
- {
- 畫面彈出.SetActive(true);
- if (Main.Global.系統語言=="繁體中文")
- {
- 彈出s.text="請購單 " +asd+ " 新增成功";
- }
- else if (Main.Global.系統語言=="簡體中文")
- {
- 彈出s.text="请购单 " +asd+ " 新增成功";
- }
- else if (Main.Global.系統語言=="English")
- {
- 彈出s.text="Purchase order " +asd+ " added successfully";
- }
- else
- {
- 彈出s.text="Pesanan pembelian " +asd+ " berhasil ditambahkan";
- }
- StartCoroutine(加需求日期());
- }
- //Debug.Log(Main.Global.有無清單);
- }
- IEnumerator 加需求日期()
- {
- string strcon1 = "需求日期修改";
- string se = Main.Global.預設伺服器路徑;
- string pa1 = 請購單號s.text;
- string pa = 需求日期s.text;
- string strUrl1 = string.Format(Main.Global.阿帕契路徑+"comm={0}&se={1}&PA27={2}&PA28={3}", strcon1, se, pa, pa1);
- UnityWebRequest request1 = UnityWebRequest.Get(strUrl1);
- yield return request1.SendWebRequest();
- if (request1.result == UnityWebRequest.Result.ConnectionError)
- {
- //Debug.Log(request.error);
- yield break;
- }
- }
- IEnumerator 刪除請購單(string asd)
- {
- string strcon = "刪除請購單";
- string pa = asd;
- string se = Main.Global.預設伺服器路徑;
- string strUrl = string.Format(Main.Global.阿帕契路徑+"comm={0}&se={1}&PA={2}", strcon, se, pa);
- UnityWebRequest request = UnityWebRequest.Get(strUrl);
- yield return request.SendWebRequest();
- if (request.result != UnityWebRequest.Result.Success)
- {
- Debug.LogError(request.error);
- }
- yield return StartCoroutine(刪除請購單明細(asd));
- 畫面彈出.SetActive(true);
- if (Main.Global.系統語言=="繁體中文")
- {
- 彈出s.text="請購單 " +asd+ " 刪除成功";
- }
- else if (Main.Global.系統語言=="簡體中文")
- {
- 彈出s.text="请购单 " +asd+ " 删除成功";
- }
- else if (Main.Global.系統語言=="English")
- {
- 彈出s.text="Purchase order " +asd+ " deleted successfully";
- }
- else
- {
- 彈出s.text="Pesanan pembelian " +asd+ " berhasil dihapus";
- }
-
- }
- IEnumerator 刪除請購單明細(string asd)
- {
-
- string pa = asd;
- string se = Main.Global.預設伺服器路徑;
- string strcon1 = "刪除請購單明細";
- string strUrl1 = string.Format(Main.Global.阿帕契路徑+"comm={0}&se={1}&PA={2}", strcon1, se, pa);
- UnityWebRequest request1 = UnityWebRequest.Get(strUrl1);
- yield return request1.SendWebRequest();
- if (request1.result != UnityWebRequest.Result.Success)
- {
- Debug.LogError(request1.error);
- }
- }
-
- public void exit_click()
- {
- StartCoroutine(回首頁刪單());
- }
- private IEnumerator 回首頁刪單()
- {
- string qwe = 請購單號s.text;
- yield return StartCoroutine(刪除請購單(qwe));
- change_Secen(3);
- }
- public void change_Secen(int _screenNum)
- {
-
- SceneManager.LoadScene(_screenNum);
- }
- public void 管材()
- {
- if (copy1 != null)
- {
- DeletetextCopy1();
- }
- StartCoroutine(物料群組("管材"));
- 畫面五.SetActive(false);
- 畫面六.SetActive(true);
- }
- public void 電線()
- {
- if (copy1 != null)
- {
- DeletetextCopy1();
- }
- StartCoroutine(物料群組("電線"));
- 畫面五.SetActive(false);
- 畫面六.SetActive(true);
- }
- public void 電料()
- {
- if (copy1 != null)
- {
- DeletetextCopy1();
- }
- StartCoroutine(物料群組("電料"));
- 畫面五.SetActive(false);
- 畫面六.SetActive(true);
- }
- public void 槽架()
- {
- if (copy1 != null)
- {
- DeletetextCopy1();
- }
- StartCoroutine(物料群組("槽架"));
- 畫面五.SetActive(false);
- 畫面六.SetActive(true);
- }
- public void 建材()
- {
- if (copy1 != null)
- {
- DeletetextCopy1();
- }
- StartCoroutine(物料群組("建材"));
- 畫面五.SetActive(false);
- 畫面六.SetActive(true);
- }
- public void 五金()
- {
- if (copy1 != null)
- {
- DeletetextCopy1();
- }
- StartCoroutine(物料群組("五金"));
- 畫面五.SetActive(false);
- 畫面六.SetActive(true);
- }
- public void 設備()
- {
- if (copy1 != null)
- {
- DeletetextCopy1();
- }
- StartCoroutine(物料群組("設備"));
- 畫面五.SetActive(false);
- 畫面六.SetActive(true);
- }
- public void 工具()
- {
- if (copy1 != null)
- {
- DeletetextCopy1();
- }
- StartCoroutine(物料群組("工具"));
- 畫面五.SetActive(false);
- 畫面六.SetActive(true);
- }
- public void 日用()
- {
- if (copy1 != null)
- {
- DeletetextCopy1();
- }
- StartCoroutine(物料群組("日用"));
- 畫面五.SetActive(false);
- 畫面六.SetActive(true);
- }
- public void 其他()
- {
- if (copy1 != null)
- {
- DeletetextCopy1();
- }
- StartCoroutine(物料群組("其他"));
- 畫面五.SetActive(false);
- 畫面六.SetActive(true);
- }
- IEnumerator 物料群組(string pa)
- {
- 讀取面板.SetActive(true);
- string strcon1 = "物料群組";
- string se = Main.Global.預設伺服器路徑;
- string pa1 = "";
- if (Main.Global.系統語言=="簡體中文")
- {
- pa1 = "繁體中文";
- }
- else
- {
- pa1 = Main.Global.系統語言;
- }
- string strUrl1 = string.Format(Main.Global.阿帕契路徑+"comm={0}&se={1}&PA10={2}&PA11={3}", strcon1, se, pa, pa1);
- 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);
-
- int sum = 0;
- for (int i = 0; i < json.Count; i++)
- {
- GameObject buttonObj = Instantiate(buttonPrefab2) as GameObject;
- buttonObj.GetComponent<RectTransform>().anchoredPosition = new Vector2(0, -sum);
- buttonObj.transform.SetParent(buttonParent2, false);
- string idname = json[i][1].ToString();
- idname=idname.Trim('"');
- buttonObj.GetComponentInChildren<TextMeshProUGUI>().text = idname;
- byte[] bytes = System.Convert.FromBase64String(json[i][2]);
- Texture2D texture = new Texture2D(2, 2);
- texture.LoadImage(bytes);
- Button newButton = buttonObj.GetComponentInChildren<Button>();
- string idname1 = json[i][0].ToString();
- idname1=idname1.Trim('"');
- newButton.onClick.AddListener(() => OnClick2(idname1));
- buttonObj.GetComponentInChildren<RawImage>().texture = texture;
- sum+=350;
- copy1.Add(buttonObj);
- }
- buttonceneter2.GetComponent<RectTransform>().sizeDelta = new Vector2(buttonceneter2.GetComponent<RectTransform>().sizeDelta.x, sum);
- 讀取面板.SetActive(false);
- }
- public void OnClick2(string asd)
- {
- if (copy2 != null)
- {
- DeletetextCopy2();
- }
- StartCoroutine(物料清單(asd));
- }
- IEnumerator 物料清單(string pa)
- {
- 讀取面板.SetActive(true);
- string strcon1 = "物料清單";
- string se = Main.Global.預設伺服器路徑;
- string pa1 = "";
- if (Main.Global.系統語言=="簡體中文")
- {
- pa1 = "繁體中文";
- }
- else
- {
- pa1 = Main.Global.系統語言;
- }
- string strUrl1 = string.Format(Main.Global.阿帕契路徑+"comm={0}&se={1}&PA12={2}&PA13={3}", strcon1, se, pa, pa1);
- 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);
- int sum = 2;
- for (int i = 0; i < json.Count; i++)
- {
- GameObject buttonObj = Instantiate(buttonPrefab3) as GameObject;
- buttonObj.GetComponent<RectTransform>().anchoredPosition = new Vector2(2, -sum);
- buttonObj.transform.SetParent(buttonParent3, false);
- texts1 =buttonObj.GetComponentsInChildren<TextMeshProUGUI>();
- texts1[0].text=(i+1).ToString();
- string str = json[i][2].ToString();
- str=str.Trim('"');
- texts1[1].text=str;
- string str1 = json[i][3].ToString();
- str1=str1.Trim('"');
- texts1[2].text=str1;
- //byte[] bytes = System.Convert.FromBase64String(json[i][4]);
- string asd = json[i][4].ToString().Trim('"');
- string qwe = json[i][5].ToString().Trim('"');
-
- string path = Application.persistentDataPath + "/image/"+asd +"_"+qwe+".jpg";
- if (File.Exists(path))
- {
- // 讀取圖片
- byte[] bytes = File.ReadAllBytes(path);
- Texture2D texture = new Texture2D(2, 2);
- texture.LoadImage(bytes);
- buttonObj.GetComponentInChildren<RawImage>().texture = texture;
- }
- else
- {
- buttonObj.GetComponentInChildren<RawImage>().texture = 沒圖.texture;
- }
- Button newButton = buttonObj.GetComponentInChildren<Button>();
- string idname1 = json[i][1].ToString();
- idname1=idname1.Trim('"');
- string idname = json[i][0].ToString();
- idname=idname.Trim('"');
- newButton.onClick.AddListener(() => OnClick3(idname1, idname, str));
-
- sum+=150;
- copy2.Add(buttonObj);
- }
- buttonceneter3.GetComponent<RectTransform>().sizeDelta = new Vector2(buttonceneter3.GetComponent<RectTransform>().sizeDelta.x, sum);
- 讀取面板.SetActive(false);
- }
- public void OnClick3(string asd, string asd1, string asd2)
- {
- strArray[3]=asd;
- strArray[2]=asd1;
- strArray[0]=asd2;
- 畫面六.SetActive(false);
- 畫面七.SetActive(true);
- StartCoroutine(物料規格讀取(asd));
- }
- IEnumerator 物料規格讀取(string pa)
- {
- 讀取面板.SetActive(true);
- string strcon1 = "物料規格讀取";
- string se = Main.Global.預設伺服器路徑;
- string strUrl1 = string.Format(Main.Global.阿帕契路徑+"comm={0}&se={1}&PA14={2}", strcon1, se, pa);
- 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 str = json[4].ToString();
- str=str.Trim('"');
- string str1 = json[2].ToString();
- str1=str1.Trim('"');
- string str2 = json[1].ToString();
- str2=str2.Trim('"');
- string str3 = json[3].ToString();
- str3=str3.Trim('"');
- strArray[1]=str3;
- StartCoroutine(物料規格抬頭讀取(str, str3, str1, str2));
- StartCoroutine(物料圖檔讀取(str1, str2));
- }
- IEnumerator 物料規格抬頭讀取(string pa, string str3, string str1, string str2)
- {
- string strcon1 = "物料規格抬頭讀取";
- string se = Main.Global.預設伺服器路徑;
- string pa1 = "";
- if (Main.Global.系統語言=="簡體中文")
- {
- pa1 = "繁體中文";
- }
- else
- {
- pa1 = Main.Global.系統語言;
- }
- string strUrl1 = string.Format(Main.Global.阿帕契路徑+"comm={0}&se={1}&PA15={2}&PA16={3}", strcon1, se, pa, pa1);
- 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);
- float count = 0; // 要創建的Image數量
- float spacing = 2; // Image之間的間隔
- if (str3=="SQLB03")
- {
- count = 3;
- }
- else if (str3=="SQLB04")
- {
- count = 4;
- }
- else if (str3=="SQLB05")
- {
- count = 5;
- }
- else if (str3=="SQLB06")
- {
- count = 6;
- }
- else if (str3=="SQLB07")
- {
- count = 7;
- }
- else if (str3=="SQLB08")
- {
- count = 8;
- }
- float imageWidth = (1498 -202 - 94 - (count + 2) * spacing) / count; // 計算每個Image的寬度
- for (int i = 0; i < count; i++)
- {
- // 創建新的Image
- GameObject newImage = Instantiate(imagePrefab, paneltransform);
- // 設置Image的寬度和位置
- RectTransform rt = newImage.GetComponent<RectTransform>();
- rt.sizeDelta = new Vector2(imageWidth, 73);
- rt.anchoredPosition = new Vector2(98 + i * (imageWidth + spacing), -2);
- rt.GetComponentInChildren<TextMeshProUGUI>().text =json[i+1];
- copy3.Add(newImage);
- }
- 末項_輸入數量.transform.SetAsLastSibling();
-
- StartCoroutine(物料規格(str1, str2, count));
- }
- IEnumerator 物料規格(string pa, string pa1, float count)
- {
- string strcon1 = "物料規格";
- string se = Main.Global.預設伺服器路徑;
- string strUrl1 = string.Format(Main.Global.阿帕契路徑+"comm={0}&se={1}&PA17={2}&PA18={3}", strcon1, se, pa, pa1);
- UnityWebRequest request1 = UnityWebRequest.Get(strUrl1);
- yield return request1.SendWebRequest();
- if (request1.result == UnityWebRequest.Result.ConnectionError)
- {
- //Debug.Log(request.error);
- yield break;
- }
- jsonData = JSON.Parse(request1.downloadHandler.text);
- JSONNode json = JSON.Parse(request1.downloadHandler.text);
-
- int sum = 0;
- for (int i = 0; i < json.Count; i++)
- {
- jsonData[i][14]="0";
- GameObject buttonObj = Instantiate(buttonPrefab4) as GameObject;
- buttonObj.GetComponent<RectTransform>().anchoredPosition = new Vector2(2, -sum);
- buttonObj.transform.SetParent(buttonParent4, false);
- bts1 =buttonObj.GetComponentsInChildren<Button>();
- texts2 =buttonObj.GetComponentsInChildren<TextMeshProUGUI>();
- TMP_InputField inputField = buttonObj.GetComponentInChildren<TMP_InputField>();
- inputField.contentType = TMP_InputField.ContentType.IntegerNumber;
- inputField.onValidateInput += delegate (string input, int charIndex, char addedChar)
- {
- if (!char.IsDigit(addedChar)) // 如果輸入字符不是數字,則不顯示在輸入欄位中
- {
- return '\0';
- }
- return addedChar;
- };
- texts2[0].text=(i+1).ToString();
- for (int j = 0; j < count; j++)
- {
-
- texts2[j+1].text=json[i][j+4];
- }
- texts2[(int)count+1].text="";
- inputField.text="0";
- string 料號 = json[i][2].ToString();
- 料號=料號.Trim('"');
- Button firstButton1 = bts1[0];
- Button firstButton2 = bts1[1];
- //TextMeshProUGUI Text = texts2[(int)count+1];
- TMP_InputField ttt1 = inputField;
- int row = i;
- ttt1.onValueChanged.AddListener((string text) => {
- jsonData[row][14]= ttt1.text;
- });
-
- firstButton1.onClick.AddListener(() =>
- {
- int kk = Int32.Parse(ttt1.text.ToString());
- kk+=1;
- ttt1.text = kk.ToString();
- jsonData[row][14]= kk.ToString();
- });
- firstButton2.onClick.AddListener(() =>
- {
- int kk = Int32.Parse(ttt1.text.ToString());
- if (kk>0)
- {
- kk-=1;
- }
- ttt1.text = kk.ToString();
- jsonData[row][14]= kk.ToString();
- });
- ttt1.image.color = new Color(ttt1.image.color.r, ttt1.image.color.g, ttt1.image.color.b, 1f);
- firstButton1.image.color = new Color(firstButton1.image.color.r, firstButton1.image.color.g, firstButton1.image.color.b, 1f);
- firstButton2.image.color = new Color(firstButton2.image.color.r, firstButton2.image.color.g, firstButton2.image.color.b, 1f);
- sum+=75;
- copy4.Add(buttonObj);
- }
- buttonceneter4.GetComponent<RectTransform>().sizeDelta = new Vector2(buttonceneter4.GetComponent<RectTransform>().sizeDelta.x, sum);
- 讀取面板.SetActive(false);
-
- }
- public void 規格表格()
- {
- JSONNode json = jsonData;
- StartCoroutine(規格表格Coroutine(json));
- }
-
- private IEnumerator 規格表格Coroutine(JSONNode json)
- {
- for (int i = 0; i < json.Count; i++)
- {
- // Debug.Log(json[i][14]);
- if (json[i][14] != "0")
- {
-
- string asd = json[i][14].ToString().Trim('"');
- string qwe = json[i][15].ToString().Trim('"');
- yield return StartCoroutine(新增物料驗證(qwe, asd));
- }
- }
-
- if (copy3 != null)
- {
- DeletetextCopy34();
- }
- rowImage.texture = Texture2D.blackTexture;
- 畫面一.SetActive(false);
- 畫面二.SetActive(false);
- 畫面三.SetActive(false);
- 畫面四.SetActive(false);
- 畫面五.SetActive(false);
- 畫面六.SetActive(true);
- 畫面七.SetActive(false);
- 畫面彈出.SetActive(true);
- if (Main.Global.系統語言=="繁體中文")
- {
- 彈出s.text="物料新增成功";
- }
- else if (Main.Global.系統語言=="簡體中文")
- {
- 彈出s.text="物料添加成功";
- }
- else if (Main.Global.系統語言=="English")
- {
- 彈出s.text="Material added successfully";
- }
- else
- {
- 彈出s.text="Bahan berhasil ditambahkan";
- }
- }
-
- IEnumerator 物料圖檔讀取(string pa, string pa1)
- {
- string strcon1 = "物料圖檔讀取";
- string se = Main.Global.預設伺服器路徑;
- string strUrl1 = string.Format(Main.Global.阿帕契路徑+"comm={0}&se={1}&PA17={2}&PA18={3}", strcon1, se, pa, pa1);
- UnityWebRequest request1 = UnityWebRequest.Get(strUrl1);
- yield return request1.SendWebRequest();
- if (request1.result == UnityWebRequest.Result.ConnectionError)
- {
- Debug.Log(request1.error);
- yield break;
- }
-
- JSONNode json = JSON.Parse(request1.downloadHandler.text);
- string asd = json[0].ToString().Trim('"');
- string qwe = json[1].ToString().Trim('"');
- string path = Application.persistentDataPath + "/image/"+asd +"_"+qwe+".jpg";
- string folderPath = Application.persistentDataPath + "/image/";
- // Debug.Log(asd+qwe);
- if (File.Exists(path))
- {
- // 讀取圖片
- byte[] bytes = File.ReadAllBytes(path);
- Texture2D texture = new Texture2D(2, 2);
- texture.LoadImage(bytes);
- rowImage.texture = texture;
- }
- else
- {
- rowImage.texture = 沒圖.texture;
- byte[] bytes = System.Convert.FromBase64String(json[2]);
- string[] files = Directory.GetFiles(folderPath, asd+"*");
- if (files.Length > 0)
- {
- foreach (string file in files)
- {
- File.Delete(file); // 刪除符合條件的檔案
- }
-
- }
- File.WriteAllBytes(path, bytes);
-
-
- }
- }
-
- IEnumerator 新增物料驗證(string a1 ,string a2)
- {
- string strcon1 = "新增物料驗證";
- string se = Main.Global.預設伺服器路徑;
- string pa = 請購單號s.text;
- string pa1 = a1;
- string strUrl1 = string.Format(Main.Global.阿帕契路徑+"comm={0}&se={1}&PA20={2}&PA21={3}", strcon1, se, pa, pa1);
- UnityWebRequest request1 = UnityWebRequest.Get(strUrl1);
- yield return request1.SendWebRequest();
- if (request1.result == UnityWebRequest.Result.ConnectionError)
- {
- yield break;
- }
-
- string strcon = "明細表項次最後一筆";
- string strUrl = string.Format(Main.Global.阿帕契路徑+"comm={0}&se={1}&PA20={2}", strcon, se, pa);
- UnityWebRequest request = UnityWebRequest.Get(strUrl);
- yield return request.SendWebRequest();
- if (request.result == UnityWebRequest.Result.ConnectionError)
- {
- yield break;
- }
- string htm1 = request.downloadHandler.text;
- string htm2 = request1.downloadHandler.text;
- //Debug.Log(htm1);
- // Debug.Log(htm2);
- string 項次 = "";
- if (htm2=="n")
- {
- if (htm1=="n")
- {
- 項次="01";
- }
- else
- {
- int num = Int32.Parse(htm1);
-
- num+=1;
- //Debug.Log(num);
- if (num < 10)
- {
- 項次="0"+num.ToString();
- }
- else if (num > 9 && num<100)
- {
- 項次=num.ToString();
- }
- // Debug.Log(項次);
-
- }
- //Debug.Log(項次);
- StartCoroutine(新增明細表(項次, a1, a2));
- }
- }
- IEnumerator 新增明細表(string str,string b1,string b2)
- {
- string strcon2 = "明細表新增";
- string se = Main.Global.預設伺服器路徑;
- string a = 請購單號s.text;
- string a1 = strArray[0];
- string a2 = strArray[1];
- string a3 = "";
- string a4 = b2;
- string a5 = "";
- string a6 = 倉儲[1];
- string a7 = str;
- string a8 = strArray[2];
- string a9 = strArray[3];
- string a10 = b1;
- string strUrl2 = string.Format(Main.Global.阿帕契路徑+"comm={0}&se={1}&PA={2}&PA1={3}&PA2={4}&PA3={5}&PA4={6}&PA5={7}&PA6={8}&PA7={9}&PA8={10}&PA9={11}&PA10={12}"
- , strcon2, se, a, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10);
- UnityWebRequest request2 = UnityWebRequest.Get(strUrl2);
- yield return request2.SendWebRequest();
- if (request2.result == UnityWebRequest.Result.ConnectionError)
- {
- yield break;
- }
- }
- IEnumerator 明細表清單()
- {
- 讀取面板.SetActive(true);
- Main.Global.有無清單=true;
- string strcon1 = "明細表清單";
- string se = Main.Global.預設伺服器路徑;
- string pa = 請購單號s.text;
- string pa1 = "";
- if (Main.Global.系統語言=="簡體中文")
- {
- pa1 = "繁體中文";
- }
- else
- {
- pa1 = Main.Global.系統語言;
- }
- string strUrl1 = string.Format(Main.Global.阿帕契路徑+"comm={0}&se={1}&PA20={2}&PA16={3}", strcon1, se, pa, pa1);
- 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);
- // Debug.Log(json.Count);
- if (json.Count ==0)
- {
- Main.Global.有無清單=false;
- }
- //Debug.Log(json.Count);
- int sum = 0;
- for (int i = 0; i < json.Count; i++)
- {
- GameObject buttonObj = Instantiate(textPrefab) as GameObject;
- buttonObj.GetComponent<RectTransform>().anchoredPosition = new Vector2(0, -sum);
- buttonObj.transform.SetParent(textParent, false);
- texts3 =buttonObj.GetComponentsInChildren<TextMeshProUGUI>();
- bts=buttonObj.GetComponentsInChildren<Button>();
- for (int j = 0; j < 7; j++)
- {
- if (j==3)
- {
- double amo = double.Parse(json[i][j+2]);
- int iamo = (int)Math.Round(amo);
- texts3[j].text= iamo.ToString();
- }
- if (j==0)
- {
- texts3[j].text=json[i][j+1];
- }
- if (j==1)
- {
- texts3[j].text=json[i][j+1];
- }
- if (j==2)
- {
- texts3[j].text=json[i][j+1];
- }
- if (j==4)
- {
- texts3[j].text=json[i][j+2];
- }
-
- }
- string asd = json[i][13].ToString().Trim('"');
- string qwe = json[i][14].ToString().Trim('"');
- string path = Application.persistentDataPath + "/image/"+asd +"_"+qwe+".jpg";
- if (File.Exists(path))
- {
- // 讀取圖片
- byte[] bytes = File.ReadAllBytes(path);
- Texture2D texture = new Texture2D(2, 2);
- texture.LoadImage(bytes);
- buttonObj.GetComponentInChildren<RawImage>().texture = texture;
- }
- else
- {
- buttonObj.GetComponentInChildren<RawImage>().texture = 沒圖.texture;
- }
- Button firstButton = bts[0];
- Button firstButton1 = bts[1];
- Button firstButton2 = bts[2];
- Button firstButton3 = bts[3];
- Button firstButton4 = bts[4];
- TextMeshProUGUI fourthText = texts3[3];
- TextMeshProUGUI zeroText = texts3[0];
-
- TextMeshProUGUI fiveText = texts3[5];
- firstButton.onClick.AddListener(() =>
- {
- int kk = Int32.Parse(fourthText.text.ToString());
- kk+=1;
- fourthText.text = kk.ToString();
- });
- firstButton1.onClick.AddListener(() =>
- {
- int kk = Int32.Parse(fourthText.text.ToString());
- if (kk>1)
- {
- kk-=1;
- }
- fourthText.text = kk.ToString();
- });
- firstButton3.onClick.AddListener(() =>
- {
- string it = zeroText.text.ToString();
- //Debug.Log(it);
- StartCoroutine(明細表單項刪除(it, json.Count));
- });
- firstButton2.onClick.AddListener(() =>
- {
- string it = zeroText.text.ToString();
- int kk = Int32.Parse(fourthText.text.ToString());
- string it1 = fiveText.text.ToString();
- StartCoroutine(明細表修改(kk.ToString(), it,it1));
- });
- int index = i;
- firstButton4.onClick.AddListener(() =>
- {
- 備註寫入葉面.SetActive(true);
- 畫面彈出.SetActive(true);
- 備註ss.text=fiveText.text;
- 備註導入.onClick.RemoveAllListeners();
- 備註導入.onClick.AddListener(() =>
- {
- if (備註ss.text.ToString() != "")
- {
- fiveText.text = 備註ss.text;
- }
- 備註寫入葉面.SetActive(false);
- 備註ss.text="";
- });
- });
-
- sum+=100;
- copy5.Add(buttonObj);
- }
- textceneter.GetComponent<RectTransform>().sizeDelta = new Vector2(textceneter.GetComponent<RectTransform>().sizeDelta.x, sum);
- 讀取面板.SetActive(false);
- }
- IEnumerator 明細表修改(string a1, string a2, string a3)
- {
- string strcon1 = "明細表修改";
- string se = Main.Global.預設伺服器路徑;
- string pa = 請購單號s.text;
- string pa1 = a1;
- string pa2 = a2;
- string pa3 = a3;
- string strUrl1 = string.Format(Main.Global.阿帕契路徑+"comm={0}&se={1}&PA23={2}&PA24={3}&PA25={4}&PA30={5}", strcon1, se, pa1, pa, pa2,pa3);
- UnityWebRequest request1 = UnityWebRequest.Get(strUrl1);
- yield return request1.SendWebRequest();
- if (request1.result == UnityWebRequest.Result.ConnectionError)
- {
- //Debug.Log(request.error);
- yield break;
- }
- 畫面彈出.SetActive(true);
-
- if (Main.Global.系統語言=="繁體中文")
- {
- 彈出s.text="數量/備註修改成功";
- }
- else if (Main.Global.系統語言=="簡體中文")
- {
- 彈出s.text="数量/备注修改成功";
- }
- else if (Main.Global.系統語言=="English")
- {
- 彈出s.text="Quantity/remark updated successfully";
- }
- else
- {
- 彈出s.text="Kuantitas/keterangan berhasil diperbarui";
- }
- }
- IEnumerator 明細表單項刪除(string a1, int a)
- {
- string strcon1 = "明細表單項刪除";
- string se = Main.Global.預設伺服器路徑;
- string pa = 請購單號s.text;
- string pa1 = a1;
- string strUrl1 = string.Format(Main.Global.阿帕契路徑+"comm={0}&se={1}&PA24={2}&PA25={3}", strcon1, se, pa, pa1);
- UnityWebRequest request1 = UnityWebRequest.Get(strUrl1);
- yield return request1.SendWebRequest();
- if (request1.result == UnityWebRequest.Result.ConnectionError)
- {
- //Debug.Log(request.error);
- yield break;
- }
- 畫面彈出.SetActive(true);
- 彈出s.text="項次"+a1+"刪除成功";
- if (Main.Global.系統語言=="繁體中文")
- {
- 彈出s.text="項次"+a1+"刪除成功";
- }
- else if (Main.Global.系統語言=="簡體中文")
- {
- 彈出s.text="项次"+a1+"删除成功";
- }
- else if (Main.Global.系統語言=="English")
- {
- 彈出s.text="No"+a1+" deleted successfully.";
- }
- else
- {
- 彈出s.text="No"+a1+" Pilih Tanggal";
- }
- int k1 = Int32.Parse(a1);
- if (a>k1)
- {
- for (int i = k1; i<a; i++)
- {
- string ori = "";
- string newi = "";
- int j = 0;
- j=i+1;
- if (i < 10)
- {
- newi="0"+i.ToString();
- }
- else if (i > 9 && i<100)
- {
- newi=i.ToString();
- }
- if (j < 10)
- {
- ori="0"+j.ToString();
- }
- else if (j > 9 && j<100)
- {
- ori=j.ToString();
- }
- yield return StartCoroutine(項次修改(ori, newi));
- }
- }
- else
- {
- if (copy5 != null)
- {
- DeletetextCopy5();
- }
- StartCoroutine(明細表清單());
- }
- }
- IEnumerator 項次修改(string a1, string a2)
- {
- string strcon1 = "項次修改";
- string se = Main.Global.預設伺服器路徑;
- string pa = 請購單號s.text;
- string pa1 = a1;
- string pa2 = a2;
- string strUrl1 = string.Format(Main.Global.阿帕契路徑+"comm={0}&se={1}&PA24={2}&PA25={3}&PA26={4}", strcon1, se, pa, pa1, pa2);
- UnityWebRequest request1 = UnityWebRequest.Get(strUrl1);
- yield return request1.SendWebRequest();
- if (request1.result == UnityWebRequest.Result.ConnectionError)
- {
- //Debug.Log(request.error);
- yield break;
- }
- if (copy5 != null)
- {
- DeletetextCopy5();
- }
-
- StartCoroutine(明細表清單());
- }
- public void 網頁(RectTransform panelRectTransform, float scale, float xbar, float ybar)
- {
- var webViewGameObject = new GameObject("UniWebView");
- webView = webViewGameObject.AddComponent<UniWebView>();
- webView.Frame =new Rect(panelRectTransform.anchoredPosition.x*scale+xbar, (-panelRectTransform.anchoredPosition.y*scale)+ybar, panelRectTransform.sizeDelta.x*scale, panelRectTransform.sizeDelta.y*scale);
- if (Main.Global.系統語言=="繁體中文" || Main.Global.系統語言=="簡體中文")
- {
- webView.Load("https://gcm-smart.com/2023/06/14/hx-pgs-erp-app-9/");
- }
- else
- {
- webView.Load("https://gcm-smart.com/2023/06/14/hx-pgs-erp-app-10/");
- }
- StartCoroutine(說明顯示查詢());
-
- //webView.Show();
- }
- IEnumerator 說明顯示查詢()
- {
- string strcon1 = "說明顯示查詢";
- string se = Main.Global.預設伺服器路徑;
- string pb1 = Main.Global.人員;
- string pb2 = "APP-9-10";
- DateTime currentDate = DateTime.Now;
- int year = currentDate.Year;
- string ys = year.ToString();
- int month = currentDate.Month;
- string ms = "";
- if (month < 10)
- {
- ms = "0"+month.ToString();
- }
- else
- {
- ms = month.ToString();
- }
- string strUrl1 = string.Format(Main.Global.阿帕契路徑+"comm={0}&se={1}&PB1={2}&PB2={3}&PB5={4}&PB6={5}", strcon1, se, pb1, pb2, ys, ms);
- 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);
- int 開啟, 公告;
- bool 是否新增 = false;
- if (json.Count>0)
- {
- float floatValue = float.Parse(json[2].ToString().Trim('"'));
- 開啟 = Mathf.RoundToInt(floatValue);
- float floatValue1 = float.Parse(json[3].ToString().Trim('"'));
- 公告 = Mathf.RoundToInt(floatValue1);
- if (開啟<3)
- {
- 網頁面板.SetActive(true);
- webView.Show();
- 開啟+=1;
- 公告+=1;
- }
- else
- {
- 開啟+=1;
- }
- }
- else
- {
- 網頁面板.SetActive(true);
- webView.Show();
- 開啟 = 1;
- 公告 = 1;
- 是否新增 = true;
- }
-
- if (是否新增==true)
- {
- yield return StartCoroutine(說明顯示新增(開啟, 公告));
- }
- else
- {
- yield return StartCoroutine(說明顯示修改(開啟, 公告));
- }
- }
- IEnumerator 說明顯示新增(int a1, int a2)
- {
- string strcon1 = "說明顯示新增";
- string se = Main.Global.預設伺服器路徑;
- string pb1 = Main.Global.人員;
- string pb2 = "APP-9-10";
- string pb3 = a1.ToString();
- string pb4 = a2.ToString();
- DateTime currentDate = DateTime.Now;
- int year = currentDate.Year;
- string ys = year.ToString();
- int month = currentDate.Month;
- string ms = "";
- if (month < 10)
- {
- ms = "0"+month.ToString();
- }
- else
- {
- ms = month.ToString();
- }
- string strUrl1 = string.Format(Main.Global.阿帕契路徑+"comm={0}&se={1}&PB1={2}&PB2={3}&PB3={4}&PB4={5}&PB5={6}&PB6={7}", strcon1, se, pb1, pb2, pb3, pb4, ys, ms);
- UnityWebRequest request1 = UnityWebRequest.Get(strUrl1);
- yield return request1.SendWebRequest();
- if (request1.result == UnityWebRequest.Result.ConnectionError)
- {
- //Debug.Log(request.error);
- yield break;
- }
- }
- IEnumerator 說明顯示修改(int a1, int a2)
- {
- string strcon1 = "說明顯示修改";
- string se = Main.Global.預設伺服器路徑;
- string pb1 = Main.Global.人員;
- string pb2 = "APP-9-10";
- string pb3 = a1.ToString();
- string pb4 = a2.ToString();
- DateTime currentDate = DateTime.Now;
- int year = currentDate.Year;
- string ys = year.ToString();
- int month = currentDate.Month;
- string ms = "";
- if (month < 10)
- {
- ms = "0"+month.ToString();
- }
- else
- {
- ms = month.ToString();
- }
- string strUrl1 = string.Format(Main.Global.阿帕契路徑+"comm={0}&se={1}&PB1={2}&PB2={3}&PB3={4}&PB4={5}&PB5={6}&PB6={7}", strcon1, se, pb1, pb2, pb3, pb4, ys, ms);
- UnityWebRequest request1 = UnityWebRequest.Get(strUrl1);
- yield return request1.SendWebRequest();
- if (request1.result == UnityWebRequest.Result.ConnectionError)
- {
- //Debug.Log(request.error);
- yield break;
- }
- }
- public void 網頁面板關閉()
- {
- 網頁面板.SetActive(false);
- webView.Hide();
- //Destroy(webView);
- }
- public void 網頁面板開啟()
- {
- 網頁面板.SetActive(true);
- webView.Show();
- //Destroy(webView);
- }
- public void 備註修改()
- {
-
- StartCoroutine(控制表備註修改());
- 畫面彈出.SetActive(true);
-
- if (Main.Global.系統語言=="繁體中文")
- {
- 彈出s.text="備註修改成功";
- }
- else if (Main.Global.系統語言=="簡體中文")
- {
- 彈出s.text="备注修改成功";
- }
- else if (Main.Global.系統語言=="English")
- {
- 彈出s.text="Remark modified successfully";
- }
- else
- {
- 彈出s.text="Keterangan berhasil diubah";
- }
- }
- IEnumerator 控制表備註修改()
- {
- string strcon1 = "控制表備註修改";
- string se = Main.Global.預設伺服器路徑;
- string pa = 請購單號s.text;
- string pa1 = 備註s.text;
- string strUrl1 = string.Format(Main.Global.阿帕契路徑+"comm={0}&se={1}&PA={2}&PA3={3}", strcon1, se, pa, pa1);
- UnityWebRequest request1 = UnityWebRequest.Get(strUrl1);
- yield return request1.SendWebRequest();
- if (request1.result == UnityWebRequest.Result.ConnectionError)
- {
- //Debug.Log(request.error);
- yield break;
- }
- }
- public void 申請完成按鈕()
- {
- if (Main.Global.有無清單==true)
- {
- 畫面彈出.SetActive(true);
- if (Main.Global.系統語言=="繁體中文")
- {
- 彈出s.text="確認數量修改/加入備註後是否儲存";
- }
- else if (Main.Global.系統語言=="簡體中文")
- {
- 彈出s.text="确认数量修改/添加备注后是否保存";
- }
- else if (Main.Global.系統語言=="English")
- {
- 彈出s.text="Save after modifying/adding notes to the confirmed quantity";
- }
- else
- {
- 彈出s.text="Simpan setelah memodifikasi/menambah catatan ke kuantitas yang dikonfirmasi";
- }
- 彈窗按鈕_Y.SetActive(true);
- 彈窗按鈕_N.SetActive(true);
- 彈窗按鈕_底圖1.SetActive(true);
- 彈窗按鈕_底圖2.SetActive(true);
- }
- else
- {
- 畫面彈出.SetActive(true);
- if (Main.Global.系統語言=="繁體中文")
- {
- 彈出s.text="清單無任何物料";
- }
- else if (Main.Global.系統語言=="簡體中文")
- {
- 彈出s.text="清单中没有任何物品";
- }
- else if (Main.Global.系統語言=="English")
- {
- 彈出s.text="No items in the list";
- }
- else
- {
- 彈出s.text="Tidak ada item dalam daftar";
- }
- }
-
-
- }
- public void 申請完成按鈕Y()
- {
- StartCoroutine(倉儲修改());
- }
- public void 申請完成按鈕N()
- {
- 畫面彈出.SetActive(false);
- 彈窗按鈕_Y.SetActive(false);
- 彈窗按鈕_N.SetActive(false);
- 彈窗按鈕_底圖1.SetActive(false);
- 彈窗按鈕_底圖2.SetActive(false);
- 彈出s.text="";
- }
- IEnumerator 倉儲修改()
- {
-
- string strcon1 = "倉儲修改";
- string se = Main.Global.預設伺服器路徑;
- string pa1 = 請購單號s.text;
- string pa = 倉儲[1];
- string strUrl1 = string.Format(Main.Global.阿帕契路徑+"comm={0}&se={1}&PA1={2}&PA2={3}", strcon1, se, pa, pa1);
- //Debug.Log(strUrl1);
- UnityWebRequest request1 = UnityWebRequest.Get(strUrl1);
- yield return request1.SendWebRequest();
- if (request1.result == UnityWebRequest.Result.ConnectionError)
- {
- //Debug.Log(request.error);
- yield break;
- }
- yield return StartCoroutine(需求日期修改());
- }
- IEnumerator 需求日期修改()
- {
- string strcon1 = "需求日期修改";
- string se = Main.Global.預設伺服器路徑;
- string pa1 = 請購單號s.text;
- string pa = 需求日期s.text;
- string strUrl1 = string.Format(Main.Global.阿帕契路徑+"comm={0}&se={1}&PA27={2}&PA28={3}", strcon1, se, pa, pa1);
- UnityWebRequest request1 = UnityWebRequest.Get(strUrl1);
- yield return request1.SendWebRequest();
- if (request1.result == UnityWebRequest.Result.ConnectionError)
- {
- //Debug.Log(request.error);
- yield break;
- }
- if (Main.Global.登入位置==true)
- {
- yield return StartCoroutine(人員級別讀取());
- }
- else
- {
- change_Secen(3);
- }
-
- }
- IEnumerator 人員級別讀取()
- {
- string strcon1 = "級別";
- string se = Main.Global.預設伺服器路徑;
- string pa = 聲請人s.text;
- string strUrl1 = string.Format(Main.Global.阿帕契路徑+"comm={0}&se={1}&姓名={2}", strcon1, se, pa);
- UnityWebRequest request1 = UnityWebRequest.Get(strUrl1);
- yield return request1.SendWebRequest();
- if (request1.result == UnityWebRequest.Result.ConnectionError)
- {
- //Debug.Log(request.error);
- yield break;
- }
- string str = request1.downloadHandler.text.ToString();
- int 級 = int.Parse(str);
- yield return StartCoroutine(人員主管清單(級));
- }
- IEnumerator 人員主管清單(int 級)
- {
- string strcon1 = "主管";
- string se = Main.Global.預設伺服器路徑;
- string pa = 聲請人s.text;
- string strUrl1 = string.Format(Main.Global.阿帕契路徑+"comm={0}&se={1}&姓名={2}&LE={3}", strcon1, se, pa,級);
- 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 json1 = json["rows"].AsArray;
- if (json1.Count == 1)
- {
- string 姓名 = json1[0][0].ToString().Trim('"');
- yield return StartCoroutine(LINE_搜尋符合通知對象("CC207", 姓名));
- }
- else if (json1.Count > 1)
- {
- for (int i = 0; i < json1.Count; i++)
- {
- string 姓名 = json1[0][0].ToString().Trim('"');
- yield return StartCoroutine(LINE_搜尋符合通知對象("CC207", 姓名));
- }
- }
- yield return StartCoroutine(LINE_搜尋符合通知對象("CC207", "李協叡"));
- change_Secen(3);
- }
-
- IEnumerator LINE_搜尋符合通知對象(string 代號, string 姓名)
- {
- string strcon1 = "LINE_搜尋符合通知對象";
- string se = Main.Global.預設伺服器路徑;
- string strUrl1 = string.Format(Main.Global.阿帕契路徑+"comm={0}&se={1}&PA9={2}&PA10={3}", strcon1, se, 代號, 姓名);
- UnityWebRequest request1 = UnityWebRequest.Get(strUrl1);
- yield return request1.SendWebRequest();
- if (request1.result == UnityWebRequest.Result.ConnectionError)
- {
- Debug.Log(request1.error);
- yield break;
- }
- JSONNode json = JSON.Parse(request1.downloadHandler.text);
- if (json != null)
- {
- string token = json[1].ToString().Trim('"');
- string 語言 = json[2].ToString().Trim('"');
-
- string strcon = "LINE_通知內容";
- string strUrl = string.Format(Main.Global.阿帕契路徑+"comm={0}&se={1}&PA9={2}", strcon, 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);
- string 內容 = "";
- if (json1[1].ToString().Trim('"')== "A+X+B+Y+C")
- {
- string pa1 = 聲請人s.text.ToString();
- string pa2 = "二日內";
- 內容=json1[2].ToString().Trim('"')+ pa1+json1[3].ToString().Trim('"')+ pa2+json1[4].ToString().Trim('"');
- }
- if (json[6]==1)
- {
- L=true;
-
- }
- else
- {
- L=false;
- }
- if (json[7]==1)
- {
- W=true;
-
- }
- else
- {
- W=false;
- }
- if (json[8]==1)
- {
- M=true;
-
- }
- else
- {
- M=false;
- }
- if (L==true)
- {
- yield return StartCoroutine(LINE_發送內容(內容, token, 語言, "Line"));
- }
- string g1 = json[3].ToString().Trim('"');
- string g2 = json[4].ToString().Trim('"');
- string g3 = json[5].ToString().Trim('"');
- if (W==true)
- {
- if (g1 != "")
- {
- yield return StartCoroutine(LINE_發送內容(內容, g1, 語言, "WhatsApp"));
- }
- if (g2 != "")
- {
- yield return StartCoroutine(LINE_發送內容(內容, g2, 語言, "WhatsApp"));
- }
- if (g3 != "")
- {
- yield return StartCoroutine(LINE_發送內容(內容, g3, 語言, "WhatsApp"));
- }
- }
- if (M==true)
- {
- if (g1 != "")
- {
- yield return StartCoroutine(LINE_發送內容(內容, g1, 語言, "Message"));
- }
- if (g2 != "")
- {
- yield return StartCoroutine(LINE_發送內容(內容, g2, 語言, "Message"));
- }
- if (g3 != "")
- {
- yield return StartCoroutine(LINE_發送內容(內容, g3, 語言, "Message"));
- }
- }
- }
-
- }
- IEnumerator LINE_發送內容(string a1, string a2, string a3, string a4)
- {
- string a = SQL_LINE_RandomCode();
- string strcon1 = "LINE_發送內容";
- string se = Main.Global.預設伺服器路徑;
- string strUrl1 = string.Format(Main.Global.阿帕契路徑+"comm={0}&se={1}&PA4={2}&PA5={3}&PA6={4}&PA7={5}&PA8={6}", strcon1, se, a2, a1, a, a3, a4);
- Debug.Log(strUrl1);
- UnityWebRequest request1 = UnityWebRequest.Get(strUrl1);
- yield return request1.SendWebRequest();
- if (request1.result == UnityWebRequest.Result.ConnectionError)
- {
- Debug.Log(request1.error);
- yield break;
- }
- }
- public string SQL_LINE_RandomCode()
- {
- string rancode;
- System.Random RndNum = new System.Random();
- rancode = DateTime.Now.Year.ToString().Trim().PadLeft(4, '0') +
- DateTime.Now.Month.ToString().Trim().PadLeft(2, '0') +
- DateTime.Now.Day.ToString().Trim().PadLeft(2, '0') +
- DateTime.Now.Hour.ToString().Trim().PadLeft(2, '0') +
- DateTime.Now.Minute.ToString().Trim().PadLeft(2, '0') +
- DateTime.Now.Second.ToString().Trim().PadLeft(2, '0') +
- RndNum.Next(1000).ToString().Trim().PadLeft(4, '0');
- return rancode;
- }
-
- private void OnApplicationQuit()
- {
- string qwe = 請購單號s.text;
- StartCoroutine(刪除請購單(qwe));
- StartCoroutine(刪除請購單明細(qwe));
- }
- public void setting_中()
- {
- Main.Global.系統語言="繁體中文";
- 系統語言轉換();
- 語言選擇按鈕();
- 語言選擇面板.SetActive(false);
- webView.Load("https://gcm-smart.com/2023/06/14/hx-pgs-erp-app-9/");
- }
- public void setting_簡()
- {
- Main.Global.系統語言="簡體中文";
- 系統語言轉換();
- 語言選擇按鈕();
- 語言選擇面板.SetActive(false);
- webView.Load("https://gcm-smart.com/2023/06/14/hx-pgs-erp-app-9/");
- }
- public void setting_英()
- {
- Main.Global.系統語言="English";
- 系統語言轉換();
- 語言選擇按鈕();
- 語言選擇面板.SetActive(false);
-
- webView.Load("https://gcm-smart.com/2023/06/14/hx-pgs-erp-app-10/");
- }
- public void setting_印()
- {
- Main.Global.系統語言="Indonesian";
- 系統語言轉換();
- 語言選擇按鈕();
- 語言選擇面板.SetActive(false);
- webView.Load("https://gcm-smart.com/2023/06/14/hx-pgs-erp-app-10/");
-
- }
- public void setting_click()
- {
- 語言選擇面板.SetActive(true);
- }
- public void setting_exit()
- {
- 語言選擇面板.SetActive(false);
- }
- 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);
- }
-
- }
- }
- private void 系統語言轉換()
- {
-
- string 介面 = "H07";
- if (Main.Global.系統語言=="繁體中文")
- {
- 中.text = Main.Global.系統語言字典[介面+"00CH"];
- 英.text = Main.Global.系統語言字典[介面+"01CH"];
- 印.text = Main.Global.系統語言字典[介面+"02CH"];
- 簡.text = Main.Global.系統語言字典[介面+"04CH"];
- 選擇語言.text = Main.Global.系統語言字典[介面+"03CH"];
- 是否有合約號.text = Main.Global.系統語言字典[介面+"05CH"];
- 選擇甲方.text = Main.Global.系統語言字典[介面+"06CH"];
- 選擇合約.text = Main.Global.系統語言字典[介面+"07CH"];
- 輸入授權碼.text = Main.Global.系統語言字典[介面+"09CH"];
- 指定倉庫.text = Main.Global.系統語言字典[介面+"10CH"];
- 申請人.text = Main.Global.系統語言字典[介面+"11CH"];
- 請購單號.text = Main.Global.系統語言字典[介面+"12CH"];
- 合約號.text = Main.Global.系統語言字典[介面+"13CH"];
- 申請日期.text = Main.Global.系統語言字典[介面+"14CH"];
- 需求日期.text = Main.Global.系統語言字典[介面+"15CH"];
- 備註.text = Main.Global.系統語言字典[介面+"16CH"];
- 項次.text = Main.Global.系統語言字典[介面+"17CH"];
- 品名.text = Main.Global.系統語言字典[介面+"18CH"];
- 規格.text = Main.Global.系統語言字典[介面+"19CH"];
- 數量.text = Main.Global.系統語言字典[介面+"20CH"];
- 單位.text = Main.Global.系統語言字典[介面+"21CH"];
- 圖片.text = Main.Global.系統語言字典[介面+"22CH"];
- 修改.text = Main.Global.系統語言字典[介面+"23CH"];
- 刪除.text = Main.Global.系統語言字典[介面+"24CH"];
- 管材s.text = Main.Global.系統語言字典[介面+"25CH"];
- 電線s.text = Main.Global.系統語言字典[介面+"26CH"];
- 電料s.text = Main.Global.系統語言字典[介面+"27CH"];
- 槽架s.text = Main.Global.系統語言字典[介面+"28CH"];
- 建材s.text = Main.Global.系統語言字典[介面+"29CH"];
- 五金s.text = Main.Global.系統語言字典[介面+"30CH"];
- 設備s.text = Main.Global.系統語言字典[介面+"31CH"];
- 工具s.text = Main.Global.系統語言字典[介面+"32CH"];
- 日用s.text = Main.Global.系統語言字典[介面+"33CH"];
- 其他s.text = Main.Global.系統語言字典[介面+"34CH"];
- 選擇主項.text = Main.Global.系統語言字典[介面+"35CH"];
- 選擇物料.text = Main.Global.系統語言字典[介面+"36CH"];
- 選擇規格數量.text = Main.Global.系統語言字典[介面+"37CH"];
- }
-
- else if (Main.Global.系統語言=="簡體中文")
- {
- 中.text = Main.Global.系統語言字典[介面+"00CS"];
- 英.text = Main.Global.系統語言字典[介面+"01CS"];
- 印.text = Main.Global.系統語言字典[介面+"02CS"];
- 簡.text = Main.Global.系統語言字典[介面+"04CS"];
- 選擇語言.text = Main.Global.系統語言字典[介面+"03CS"];
- 是否有合約號.text = Main.Global.系統語言字典[介面+"05CS"];
- 選擇甲方.text = Main.Global.系統語言字典[介面+"06CS"];
- 選擇合約.text = Main.Global.系統語言字典[介面+"07CS"];
- 輸入授權碼.text = Main.Global.系統語言字典[介面+"09CS"];
- 指定倉庫.text = Main.Global.系統語言字典[介面+"10CS"];
- 申請人.text = Main.Global.系統語言字典[介面+"11CS"];
- 請購單號.text = Main.Global.系統語言字典[介面+"12CS"];
- 合約號.text = Main.Global.系統語言字典[介面+"13CS"];
- 申請日期.text = Main.Global.系統語言字典[介面+"14CS"];
- 需求日期.text = Main.Global.系統語言字典[介面+"15CS"];
- 備註.text = Main.Global.系統語言字典[介面+"16CS"];
- 項次.text = Main.Global.系統語言字典[介面+"17CS"];
- 品名.text = Main.Global.系統語言字典[介面+"18CS"];
- 規格.text = Main.Global.系統語言字典[介面+"19CS"];
- 數量.text = Main.Global.系統語言字典[介面+"20CS"];
- 單位.text = Main.Global.系統語言字典[介面+"21CS"];
- 圖片.text = Main.Global.系統語言字典[介面+"22CS"];
- 修改.text = Main.Global.系統語言字典[介面+"23CS"];
- 刪除.text = Main.Global.系統語言字典[介面+"24CS"];
- 管材s.text = Main.Global.系統語言字典[介面+"25CS"];
- 電線s.text = Main.Global.系統語言字典[介面+"26CS"];
- 電料s.text = Main.Global.系統語言字典[介面+"27CS"];
- 槽架s.text = Main.Global.系統語言字典[介面+"28CS"];
- 建材s.text = Main.Global.系統語言字典[介面+"29CS"];
- 五金s.text = Main.Global.系統語言字典[介面+"30CS"];
- 設備s.text = Main.Global.系統語言字典[介面+"31CS"];
- 工具s.text = Main.Global.系統語言字典[介面+"32CS"];
- 日用s.text = Main.Global.系統語言字典[介面+"33CS"];
- 其他s.text = Main.Global.系統語言字典[介面+"34CS"];
- 選擇主項.text = Main.Global.系統語言字典[介面+"35CS"];
- 選擇物料.text = Main.Global.系統語言字典[介面+"36CS"];
- 選擇規格數量.text = Main.Global.系統語言字典[介面+"37CS"];
- }
- else if (Main.Global.系統語言=="English")
- {
- 中.text = Main.Global.系統語言字典[介面+"00EN"];
- 英.text = Main.Global.系統語言字典[介面+"01EN"];
- 印.text = Main.Global.系統語言字典[介面+"02EN"];
- 簡.text = Main.Global.系統語言字典[介面+"04EN"];
- 選擇語言.text = Main.Global.系統語言字典[介面+"03EN"];
- 是否有合約號.text = Main.Global.系統語言字典[介面+"05EN"];
- 選擇甲方.text = Main.Global.系統語言字典[介面+"06EN"];
- 選擇合約.text = Main.Global.系統語言字典[介面+"07EN"];
- 輸入授權碼.text = Main.Global.系統語言字典[介面+"09EN"];
- 指定倉庫.text = Main.Global.系統語言字典[介面+"10EN"];
- 申請人.text = Main.Global.系統語言字典[介面+"11EN"];
- 請購單號.text = Main.Global.系統語言字典[介面+"12EN"];
- 合約號.text = Main.Global.系統語言字典[介面+"13EN"];
- 申請日期.text = Main.Global.系統語言字典[介面+"14EN"];
- 需求日期.text = Main.Global.系統語言字典[介面+"15EN"];
- 備註.text = Main.Global.系統語言字典[介面+"16EN"];
- 項次.text = Main.Global.系統語言字典[介面+"17EN"];
- 品名.text = Main.Global.系統語言字典[介面+"18EN"];
- 規格.text = Main.Global.系統語言字典[介面+"19EN"];
- 數量.text = Main.Global.系統語言字典[介面+"20EN"];
- 單位.text = Main.Global.系統語言字典[介面+"21EN"];
- 圖片.text = Main.Global.系統語言字典[介面+"22EN"];
- 修改.text = Main.Global.系統語言字典[介面+"23EN"];
- 刪除.text = Main.Global.系統語言字典[介面+"24EN"];
- 管材s.text = Main.Global.系統語言字典[介面+"25EN"];
- 電線s.text = Main.Global.系統語言字典[介面+"26EN"];
- 電料s.text = Main.Global.系統語言字典[介面+"27EN"];
- 槽架s.text = Main.Global.系統語言字典[介面+"28EN"];
- 建材s.text = Main.Global.系統語言字典[介面+"29EN"];
- 五金s.text = Main.Global.系統語言字典[介面+"30EN"];
- 設備s.text = Main.Global.系統語言字典[介面+"31EN"];
- 工具s.text = Main.Global.系統語言字典[介面+"32EN"];
- 日用s.text = Main.Global.系統語言字典[介面+"33EN"];
- 其他s.text = Main.Global.系統語言字典[介面+"34EN"];
- 選擇主項.text = Main.Global.系統語言字典[介面+"35EN"];
- 選擇物料.text = Main.Global.系統語言字典[介面+"36EN"];
- 選擇規格數量.text = Main.Global.系統語言字典[介面+"37EN"];
- }
- else
- {
- 中.text = Main.Global.系統語言字典[介面+"00ID"];
- 英.text = Main.Global.系統語言字典[介面+"01ID"];
- 印.text = Main.Global.系統語言字典[介面+"02ID"];
- 簡.text = Main.Global.系統語言字典[介面+"04ID"];
- 選擇語言.text = Main.Global.系統語言字典[介面+"03ID"];
- 是否有合約號.text = Main.Global.系統語言字典[介面+"05ID"];
- 選擇甲方.text = Main.Global.系統語言字典[介面+"06ID"];
- 選擇合約.text = Main.Global.系統語言字典[介面+"07ID"];
- 輸入授權碼.text = Main.Global.系統語言字典[介面+"09ID"];
- 指定倉庫.text = Main.Global.系統語言字典[介面+"10ID"];
- 申請人.text = Main.Global.系統語言字典[介面+"11ID"];
- 請購單號.text = Main.Global.系統語言字典[介面+"12ID"];
- 合約號.text = Main.Global.系統語言字典[介面+"13ID"];
- 申請日期.text = Main.Global.系統語言字典[介面+"14ID"];
- 需求日期.text = Main.Global.系統語言字典[介面+"15ID"];
- 備註.text = Main.Global.系統語言字典[介面+"16ID"];
- 項次.text = Main.Global.系統語言字典[介面+"17ID"];
- 品名.text = Main.Global.系統語言字典[介面+"18ID"];
- 規格.text = Main.Global.系統語言字典[介面+"19ID"];
- 數量.text = Main.Global.系統語言字典[介面+"20ID"];
- 單位.text = Main.Global.系統語言字典[介面+"21ID"];
- 圖片.text = Main.Global.系統語言字典[介面+"22ID"];
- 修改.text = Main.Global.系統語言字典[介面+"23ID"];
- 刪除.text = Main.Global.系統語言字典[介面+"24ID"];
- 管材s.text = Main.Global.系統語言字典[介面+"25ID"];
- 電線s.text = Main.Global.系統語言字典[介面+"26ID"];
- 電料s.text = Main.Global.系統語言字典[介面+"27ID"];
- 槽架s.text = Main.Global.系統語言字典[介面+"28ID"];
- 建材s.text = Main.Global.系統語言字典[介面+"29ID"];
- 五金s.text = Main.Global.系統語言字典[介面+"30ID"];
- 設備s.text = Main.Global.系統語言字典[介面+"31ID"];
- 工具s.text = Main.Global.系統語言字典[介面+"32ID"];
- 日用s.text = Main.Global.系統語言字典[介面+"33ID"];
- 其他s.text = Main.Global.系統語言字典[介面+"34ID"];
- 選擇主項.text = Main.Global.系統語言字典[介面+"35ID"];
- 選擇物料.text = Main.Global.系統語言字典[介面+"36ID"];
- 選擇規格數量.text = Main.Global.系統語言字典[介面+"37ID"];
- }
- }
- 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");
- }
-
- }
- }
- }
|