Exemple #1
0
        public Task <string> CheckLocationCode(string code)
        {
            var    tcs = new TaskCompletionSource <string>();
            string rv  = "";

            Task.Run(async() =>
            {
                try
                {
                    if (!string.IsNullOrEmpty(code))
                    {
                        string code1 = code.Trim().ToUpper();
                        int exist    = await NAV.GetLocationCount(code1, false, ACD.Default);
                        if (exist > 0)
                        {
                            rv = AppResources.LocationNewPage_CodeAlreadyExist;
                        }
                    }
                    tcs.SetResult(rv);
                }
                catch
                {
                    tcs.SetResult(rv);
                }
            });
            return(tcs.Task);
        }
Exemple #2
0
        public async Task CheckLocationCode()
        {
            if (CreateMode)
            {
                CodeWarningText = "";
                if (Code != "")
                {
                    int exist = await NAV.GetLocationCount(Code, false, ACD.Default);

                    if (exist > 0)
                    {
                        CodeWarningText = AppResources.LocationNewPage_CodeAlreadyExist;
                    }
                }
            }
        }