Example #1
0
        private async void RequestRegisterCode(string code)
        {
            try
            {
                JObject paramObj = new JObject();
                paramObj.Add(HTTPPacket.Param_Device_ID, code);

                JObject obj = await httpClient.Requester(HTTPPacket.Url_Register_ID, "POST", paramObj);

                string resCode = obj.GetValue(HTTPPacket.Param_Res_Code).ToString();
                Console.WriteLine("[Register] - Register Product Result.\n{0}", obj.ToString());
                if (resCode.Equals(HTTPPacket.Res_Success))
                {
                    SystemEnv.SetProductKey(code);
                    this.DialogResult = true;
                    this.Close();
                }
                else
                {
                    ShowErrorMessage("제품 등록에 실패하였습니다.");
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
                ShowErrorMessage("서버와 연결이 불안정합니다. 잠시 후 다시 시도해주세요.");
            }
        }
Example #2
0
        private bool CheckProductCode()
        {
            string productKey = SystemEnv.GetProductKey();

            if (productKey == "0")
            {
                RegisterWindow registerView = new RegisterWindow();
                registerView.Owner = this;
                Nullable <bool> result = registerView.ShowDialog();
                return(result.Value);
            }
            Console.WriteLine("Product Code : {0}", productKey);
            return(true);
        }