private void SaveCase(string CaseBarcode)
        {
            try
            {
                string   _MESSAGE  = "VALIDATE_MAPPED_CASE~" + CaseBarcode + "}";
                string[] _RESPONSE = oNetwork.fnSendReceiveData(_MESSAGE).Split('~');
                switch (_RESPONSE[0])
                {
                case "VALID":
                    WriteFile(CaseBarcode);
                    break;

                case "INVALID":
                    Toast.MakeText(this, _RESPONSE[1], ToastLength.Long).Show();
                    break;

                case "ERROR":
                    Toast.MakeText(this, _RESPONSE[1], ToastLength.Long).Show();
                    break;

                case "NO_CONNECTION":
                    Toast.MakeText(this, "Communication server not connected", ToastLength.Long).Show();
                    break;

                default:
                    Toast.MakeText(this, "No option match from comm server", ToastLength.Long).Show();
                    break;
                }
            }
            catch (Exception ex)
            {
                clsGLB.ShowMessage(ex.Message, this, MessageTitle.ERROR);
            }
        }
Пример #2
0
        private void BindCombo()
        {
            try
            {
                string   _MESSAGE  = "GET_LINE~" + "}";
                string[] _RESPONSE = oNetwork.fnSendReceiveData(_MESSAGE).Split('~');
                // string[] _RESPONSE = "VALID~1-LINE1~2-LINE2~3-LINE3".Split('~');
                switch (_RESPONSE[0])
                {
                case "VALID":
                    for (int i = 1; i < _RESPONSE.Length; i++)
                    {
                        _ListSite.Add(_RESPONSE[i]);
                    }
                    ArrayAdapter <string> arrayAdapter = new ArrayAdapter <string>(this, Resource.Layout.Spiner, _ListSite);
                    cmbSite.Adapter = arrayAdapter;
                    if (_ListSite.Count > 0)
                    {
                        cmbSite.SetSelection(0);
                    }
                    break;

                case "INVALID":
                    clsGLB.ShowMessage(_RESPONSE[1], this, MessageTitle.INFORMATION);
                    break;

                case "ERROR":
                    clsGLB.ShowMessage(_RESPONSE[1], this, MessageTitle.INFORMATION);
                    break;

                case "NO_CONNECTION":
                    clsGLB.ShowMessage("Communication server not connected", this, MessageTitle.INFORMATION);
                    break;

                default:
                    clsGLB.ShowMessage("No option match from comm server", this, MessageTitle.INFORMATION);
                    break;
                }
            }
            catch (Exception ex)
            {
                clsGLB.ShowMessage(ex.Message, this, MessageTitle.ERROR);
            }
        }