示例#1
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            try
            {
                selectedUser = string.IsNullOrEmpty(hdfEditStatus.Value) ? new MyRabbit.Entity.User() : selectedUser;

                DESEncrypt desEncrypt = new DESEncrypt();
                selectedUser.NickName  = txtNickName.Text;
                selectedUser.LoginName = txtLoginName.Text;
                selectedUser.Email     = txtEmail.Text;
                selectedUser.Password  = desEncrypt.Encrypt(txtPassword.Text);
                //selectedUser.RoleId = Int32.Parse(dplUserRole.SelectedValue);
                if (selectedUser.Id > 0)
                {
                    userService.Update(selectedUser);
                }
                else
                {
                    userService.Create(selectedUser);
                }

                //write operation log
                //string message = string.IsNullOrEmpty(hdfEditStatus.Value) ? "新增用户:" : "变更用户:";
                //message += txtUserName.Text;
                //OperationLogType type = selectedUser.Id.Equals(0) ? OperationLogType.Insert : OperationLogType.Update;
                //WriteOperationLog(type, message);

                BindData(1);

                ShowMessage("保存成功。");
            }
            catch (Exception ex)
            {
                SysLog.Error(ex);
                RedirectToErrorPage();
            }
        }
        //초기화
        public async void GetAutoCoinSetting()
        {
            try
            {
                using (RequestTradingCoinAutoTradeSelModel req = new RequestTradingCoinAutoTradeSelModel())
                {
                    req.userEmail = MainViewModel.LoginDataModel.userEmail;

                    using (ResponseTradingCoinAutoTradeSelModel res = await WebApiLib.AsyncCall <ResponseTradingCoinAutoTradeSelModel, RequestTradingCoinAutoTradeSelModel>(req))
                    {
                        ResponseTradingCoinAutoTradeSelDataModel catTemp = res.data;

                        SelCoin = StringEnum.ToEnum <EnumLib.ExchangeCurrencyCode>(catTemp.selCnKndCd).ToString();
                        ChgCoin = StringEnum.ToEnum <EnumLib.ExchangeCurrencyCode>(catTemp.chgCnKndCd).ToString();

                        CoinAutoTradeContent = catTemp;
                    }
                }
            }
            catch (Exception ex)
            {
                SysLog.Error("Message[{0}], StackTrace[{1}]", ex.Message, ex.StackTrace);
            }
        }
 public void Loaded()
 {
     try
     {
         if (exchangeList != null)
         {
             ResponseArbitrageGetSignInfoListModel item = exchangeList.Where(x => x.mainYn == "Y").FirstOrDefault();
             if (item != null)
             {
                 SelExchangeItem = item;
                 sSelectEnabled  = false;
             }
             else
             {
                 SelExchangeItem = exchangeList[0];
                 sSelectEnabled  = true;
             }
         }
     }
     catch (Exception ex)
     {
         SysLog.Error("Message[{0}], StackTrace[{1}]", ex.Message, ex.StackTrace);
     }
 }
示例#4
0
 public void CmdSelect(string code)
 {
     try
     {
         foreach (var item in Coin)
         {
             if (item.sCode.Equals(code))
             {
                 item.sBackColor = "#0090d5";
                 item.sForeColor = "#FFF";
                 GetData(item.sCode);
             }
             else
             {
                 item.sBackColor = "#e5e5e5";
                 item.sForeColor = "#333";
             }
         }
     }
     catch (Exception ex)
     {
         SysLog.Error("Message[{0}], StackTrace[{1}]", ex.Message, ex.StackTrace);
     }
 }
示例#5
0
        public void CmdSendCard()
        {
            try
            {
                if (bOnline)
                {
                    DepositMth1Visible = Visibility.Visible;
                    DepositMth2Visible = Visibility.Collapsed;

                    cardReqPrc = cardReqPrcOri + deliveryFee;
                }
                else if (bOffline)
                {
                    DepositMth1Visible = Visibility.Collapsed;
                    DepositMth2Visible = Visibility.Visible;

                    cardReqPrc = cardReqPrcOri;
                }
            }
            catch (Exception ex)
            {
                SysLog.Error("Message[{0}], StackTrace[{1}]", ex.Message, ex.StackTrace);
            }
        }
示例#6
0
        //public void CmdStrVailDate(object sender, DevExpress.Xpf.Editors.ValidationEventArgs e)
        public void CmdStrNonInput(TextCompositionEventArgs e)
        {
            try
            {
                int value = 0;
                if (e.Text == null)
                {
                    return;
                }
                if (string.IsNullOrEmpty(e.Text.ToString()))
                {
                    return;
                }

                if (!int.TryParse(e.Text.ToString(), out value))
                {
                    e.Handled = true;
                }
            }
            catch (Exception ex)
            {
                SysLog.Error("Message[{0}], StackTrace[{1}]", ex.Message, ex.StackTrace);
            }
        }
示例#7
0
        public void CmdFileUpload(string sNum)
        {
            try
            {
                OpenFileDialog file = new OpenFileDialog();
                file.RestoreDirectory = true;
                file.Multiselect      = false;
                file.Filter           = "Images Files(*.jpg; *.jpeg; *.gif; *.bmp; *.png)|*.jpg;*.jpeg;*.gif;*.bmp;*.png";

                if (file.ShowDialog() == DialogResult.OK)
                {
                    long size = new FileInfo(file.FileName).Length;
                    long mb   = size / 1024 / 1024;

                    if (mb >= 2)
                    {
                        Alert alert = new Alert(Localization.Resource.CertifyMyPage_6_3, 320);
                        alert.ShowDialog();
                        return;
                    }

                    if (sNum.Equals("1"))
                    {
                        sFileName1 = file.FileName;
                    }
                    else if (sNum.Equals("2"))
                    {
                        sFileName2 = file.FileName;
                    }
                }
            }
            catch (Exception ex)
            {
                SysLog.Error("Message[{0}], StackTrace[{1}]", ex.Message, ex.StackTrace);
            }
        }
示例#8
0
        protected AutoTradingPopAdditionalServiceViewModel()
        {
            try
            {
                coinList = new List <AutoTradingCoinList>();
                coinList.Add(ViewModelSource.Create(() => new AutoTradingCoinList()
                {
                    coinNm = CommonLib.StandardCurcyNm, coinCd = StringEnum.GetStringValue(EnumLib.ExchangeCurrencyCode.KRW), isCheck = true
                }));
                foreach (ResponseGetMkCoinListListtModel item in MainViewModel.CoinList.KRW)
                {
                    coinList.Add(ViewModelSource.Create(() => new AutoTradingCoinList()
                    {
                        coinNm = item.curcyNm, coinCd = item.curcyCd, isCheck = true
                    }));
                }

                ImageSet();
            }
            catch (Exception ex)
            {
                SysLog.Error("Message[{0}], StackTrace[{1}]", ex.Message, ex.StackTrace);
            }
        }
        //컨트롤 초기화
        public void ControlClear()
        {
            try
            {
                minReqAmt       = 0;
                maxReqAmt       = 0;
                reqAmt          = 0;
                strInterestRate = string.Empty;
                expectInterest  = 0;
                totalAmt        = 0;
                termsCheck      = false;
                termsEnable     = false;

                rPeriodMonth     = string.Empty;
                rStrInterestRate = string.Empty;

                listSize  = 10;
                rListSize = 10;
            }
            catch (Exception ex)
            {
                SysLog.Error("Message[{0}], StackTrace[{1}]", ex.Message, ex.StackTrace);
            }
        }
        public async void CmdIpCancel(string Ip)
        {
            try
            {
                //IP 등록 해재
                using (RequestIpUnRegModel req = new RequestIpUnRegModel())
                {
                    req.userEmail = MainViewModel.LoginDataModel.userEmail;
                    req.ip        = Ip;
                    req.limtHr    = 0;

                    using (ResponsetIpUnRegModel res = await WebApiLib.AsyncCall <ResponsetIpUnRegModel, RequestIpUnRegModel>(req))
                    {
                        //푸쉬전송
                        using (RequestSendPushModel req2 = new RequestSendPushModel())
                        {
                            req2.userEmail = MainViewModel.LoginDataModel.userEmail;
                            req2.regIp     = MainViewModel.LoginDataModel.regIp;
                            req2.contents  = Localization.Resource.LoginHistory_2_6 + "(" + Ip + ")";
                            req2.pushType  = "CMMC00000000427";

                            using (ResponseSendPushModel res2 = await WebApiLib.AsyncCall <ResponseSendPushModel, RequestSendPushModel>(req2))
                            {
                                GetIpList();
                                Alert alert = new Alert(Localization.Resource.LoginHistory_2_6, 300);
                                alert.ShowDialog();
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                SysLog.Error("Message[{0}], StackTrace[{1}]", ex.Message, ex.StackTrace);
            }
        }
示例#11
0
        private void RepeatTimer_Tick(object sender, EventArgs e)
        {
            try
            {
                //nowTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");

                iTime -= 1;

                //if(iTime <= 5)
                //{
                //    sTimeColor = "Red";
                //}

                if (iTime < 0)
                {
                    bTimeOver = true;
                    WindowService.Close();
                }
            }
            catch (Exception ex)
            {
                SysLog.Error("Message[{0}], StackTrace[{1}]", ex.Message, ex.StackTrace);
            }
        }
        public void CmdSelectBuySell()
        {
            try
            {
                if (bBuy.Equals(true))
                {
                    vBuyVisible    = Visibility.Visible;
                    vSellVisible   = Visibility.Collapsed;
                    sQuantityTitle = string.Format(Localization.Resource.Arbitrage_3_3, CommonLib.StandardCurcyNm);
                }
                else if (bSell.Equals(true))
                {
                    vBuyVisible    = Visibility.Collapsed;
                    vSellVisible   = Visibility.Visible;
                    sQuantityTitle = Localization.Resource.AssetsMyPage_4_2;
                }

                GetArbitrageData(_OrderCode);
            }
            catch (Exception ex)
            {
                SysLog.Error("Message[{0}], StackTrace[{1}]", ex.Message, ex.StackTrace);
            }
        }
示例#13
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                //if (!LogonUser.RoleName.Equals("Admin"))
                //{
                //    ShowMessage("你没有权限进行此操作!", "Default.aspx");
                //}

                if (!IsPostBack)
                {
                    BindData(1);

                    //if single login, show this function
                    //gvwUser.Columns[4].Visible = SingleLogin;
                    //gvwUser.Columns[6].Visible = SingleLogin;
                }
            }
            catch (Exception ex)
            {
                SysLog.Error(ex);
                RedirectToErrorPage();
            }
        }
示例#14
0
        private void uiComfirm_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                using (RequestCurrTransferModel req = new RequestCurrTransferModel())
                {
                    req.fromUserEmail = MainViewModel.LoginDataModel.userEmail;
                    req.toUserEmail   = txtUserId.Text;
                    req.wdrPrc        = _dTransferAmount;
                    req.regIp         = MainViewModel.LoginDataModel.regIp;

                    using (ResponseCurrTransferModel res = WebApiLib.SyncCall <ResponseCurrTransferModel, RequestCurrTransferModel>(req))
                    {
                        if (res.resultStrCode == "000")
                        {
                            string resultCd = res.data.failCd;

                            if (resultCd.Equals(""))
                            {
                                alert = new Alert(Localization.Resource.TransferDepositWithdraw_Common_8);
                                alert.ShowDialog();

                                this.DialogResult = true;
                                this.Close();
                            }
                            else if (resultCd.Equals("999"))
                            {
                                alert = new Alert(Localization.Resource.WithdrawDepositWithdraw_Common_18, 320);
                                alert.ShowDialog();
                            }
                            else if (resultCd.Equals("996"))
                            {
                                alert = new Alert(Localization.Resource.WithdrawDepositWithdraw_Common_21, 320);
                                alert.ShowDialog();
                            }
                            else if (resultCd.Equals("994"))
                            {
                                alert = new Alert(Localization.Resource.TransferDepositWithdraw_Common_19);
                                alert.ShowDialog();
                            }
                            else if (resultCd.Equals("993"))
                            {
                                alert = new Alert(Localization.Resource.WithdrawDepositWithdraw_Common_23);
                                alert.ShowDialog();
                            }
                            else if (resultCd.Equals("992"))
                            {
                                alert = new Alert(Localization.Resource.TransferDepositWithdraw_Common_15);
                                alert.ShowDialog();
                            }
                            else if (resultCd.Equals("991"))
                            {
                                alert = new Alert(Localization.Resource.WithdrawDepositWithdraw_Common_39);
                                alert.ShowDialog();
                            }
                            else if (resultCd.Equals("990"))
                            {
                                alert = new Alert(Localization.Resource.WithdrawDepositWithdraw_Common_27);
                                alert.ShowDialog();
                            }
                            else if (resultCd.Equals("989"))
                            {
                                alert = new Alert(Localization.Resource.WithdrawDepositWithdraw_T_Common_6);
                                alert.ShowDialog();
                            }
                            else if (resultCd.Equals("984"))
                            {
                                alert = new Alert(string.Format(Localization.Resource.WithdrawDepositWithdraw_T_Common_7 + "\n" + Localization.Resource.WithdrawDepositWithdraw_T_Common_8, CommonLib.StandardCurcyNm), 330);
                                alert.ShowDialog();
                            }
                            else if (resultCd.Equals("983"))
                            {
                                alert = new Alert(Localization.Resource.WithdrawDepositWithdraw_Common_40 + "\n" + Localization.Resource.WithdrawDepositWithdraw_Common_41, 320);
                                alert.ShowDialog();
                            }
                            else if (resultCd.Equals("982"))
                            {
                                alert = new Alert(Localization.Resource.TransferDepositWithdraw_Common_11, 320);
                                alert.ShowDialog();
                            }
                            else if (resultCd.Equals("981"))
                            {
                                alert = new Alert(Localization.Resource.TransferDepositWithdraw_Common_11, 320);
                                alert.ShowDialog();
                            }
                            else if (resultCd.Equals("979"))
                            {
                                alert = new Alert(Localization.Resource.Common_Alert_1);
                                alert.ShowDialog();
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                SysLog.Error("Message[{0}], StackTrace[{1}]", ex.Message, ex.StackTrace);
            }
        }
        //public void OnbCheckChanged()
        //{
        //    try
        //    {
        //        if (bCheck)
        //        {
        //            ini.SetCheckID(bCheck.Equals(true) ? "T" : "F", "ViewTermAgree", "Check");
        //        }
        //        else
        //        {
        //            ini.SetCheckID(string.Empty, "ViewTermAgree", "Check");
        //        }
        //    }
        //    catch (Exception ex)
        //    {
        //        SysLog.Error("Message[{0}], StackTrace[{1}]", ex.Message, ex.StackTrace);
        //    }
        //}

        #endregion

        #region Method

        public void GetArbitrageData(string OrderCode, bool bRefresh = true)
        {
            try
            {
                if (bRefresh)
                {
                    IsBusy = true;
                }

                if (string.IsNullOrEmpty(OrderCode))
                {
                    return;
                }

                _OrderCode   = OrderCode;
                arbiDataList = new ObservableCollection <ResponseArbitrageGetAssetListModel>();
                if (IsLoadData)
                {
                    IsLoadData = false;

                    //아비트리지 코인별 현재 데이터 호출
                    using (RequestArbitrageGetAssetModel req = new RequestArbitrageGetAssetModel())
                    {
                        req.userEmail = MainViewModel.LoginDataModel.userEmail;
                        req.cnKndNm   = StringEnum.ToEnum <EnumLib.ExchangeCurrencyCode>(_OrderCode).ToString();
                        if (bBuy)
                        {
                            req.type = "B";
                        }
                        else if (bSell)
                        {
                            req.type = "S";
                        }

                        using (ResponseArbitrageGetAssetModel res = WebApiLib.SyncCallEncrypt <ResponseArbitrageGetAssetModel, RequestArbitrageGetAssetModel>(req))
                        {
                            if (res.resultStrCode == "000")
                            {
                                dGap = res.data.gap ?? 0;

                                foreach (ResponseArbitrageGetAssetListModel item in res.data.list)
                                {
                                    item.sFavicon   = "/Images/" + item.exchgeNm + ".ico";
                                    item.sCoinImage = "/Images/ico_nav_" + item.cnKndCd + ".png";

                                    if (bSell)
                                    {
                                        if (item.totAmt == 0)
                                        {
                                            item.sTotAmt = item.totAmt.ToString() + " (X)";
                                        }
                                        else
                                        {
                                            item.sTotAmt = decimal.Parse(item.totAmt.ToString()).ToString("###,###,##0.########") + " (O)";
                                        }

                                        if (res.data.list.Count > 1)
                                        {
                                            res.data.list[1].sImage = "/Images/ico_up_arr_red.png";
                                            dPrcGap       = res.data.list[1].prcGap;
                                            vImageVisible = Visibility.Visible;
                                        }
                                        else if (res.data.list.Count.Equals(1))
                                        {
                                            vImageVisible = Visibility.Collapsed;
                                        }
                                    }
                                    else if (bBuy)
                                    {
                                        if (item.hasPtc == 0)
                                        {
                                            item.sHasPtc = item.hasPtc.ToString() + " (X)";
                                        }
                                        else
                                        {
                                            item.sHasPtc = decimal.Parse(item.hasPtc.ToString()).ToString("###,###,###,##0") + " (O)";
                                        }

                                        if (res.data.list.Count > 1)
                                        {
                                            res.data.list[1].sImage = "/Images/ico_down_arr_blue.png";
                                            dPrcGap       = res.data.list[1].prcGap;
                                            vImageVisible = Visibility.Visible;
                                        }
                                        else if (res.data.list.Count.Equals(1))
                                        {
                                            vImageVisible = Visibility.Collapsed;
                                        }
                                    }
                                }

                                arbiDataList = res.data.list;
                            }
                        }
                    }

                    arbiListHeight = 30 + (arbiDataList.Count * 30);
                }
            }
            catch (Exception ex)
            {
                SysLog.Error("Message[{0}], StackTrace[{1}]", ex.Message, ex.StackTrace);
            }
            finally
            {
                IsBusy     = false;
                IsLoadData = true;
            }
        }
        public void CmdTrade()
        {
            try
            {
                if (!bTotalSignCheck)
                {
                    Alert alert = new Alert(Localization.Resource.Arbitrage_Alert_1);
                    alert.ShowDialog();
                    return;
                }

                if (!bCheck)
                {
                    Alert alert = new Alert(Localization.Resource.TransferDepositWithdraw_Common_7, 350);
                    alert.ShowDialog();
                    return;
                }
                else
                {
                    string sTradeInfo = string.Empty;

                    if (arbiDataList.Count > 1)
                    {
                        ArbitragePopAdditionalService pop = new ArbitragePopAdditionalService();
                        if (bBuy)
                        {
                            sTradeInfo = "B";
                            ResponseMainAssetListModel item = MainViewModel.Asset.Where(x => x.curcyCd == StringEnum.GetStringValue(EnumLib.ExchangeCurrencyCode.KRW)).FirstOrDefault();
                            ((ArbitragePopAdditionalServiceViewModel)pop.DataContext).dNowAmountTemp = item.posCnPrc;
                        }
                        else if (bSell)
                        {
                            sTradeInfo = "S";
                            ResponseMainAssetListModel item = MainViewModel.Asset.Where(x => x.curcyCd == _OrderCode).FirstOrDefault();
                            ((ArbitragePopAdditionalServiceViewModel)pop.DataContext).dNowAmountTemp = item.posCnAmt;
                        }
                        ((ArbitragePopAdditionalServiceViewModel)pop.DataContext).sTradeInfo = sTradeInfo;
                        ((ArbitragePopAdditionalServiceViewModel)pop.DataContext).sOrderCode = _OrderCode;
                        ((ArbitragePopAdditionalServiceViewModel)pop.DataContext).sLowId     = arbiDataList[1].exchgeId;
                        ((ArbitragePopAdditionalServiceViewModel)pop.DataContext).sHighId    = arbiDataList[0].exchgeId;
                        pop.ShowDialog();

                        if (((ArbitragePopAdditionalServiceViewModel)pop.DataContext).bTrading == true)
                        {
                            bTrading = false;
                            if (bPush)
                            {
                                bTrading = true;
                                bPush    = false;
                            }
                            bCheckEnable = false;
                        }
                        else if (((ArbitragePopAdditionalServiceViewModel)pop.DataContext).bTimeOver == true)
                        {
                            bTrading     = true;
                            bCheckEnable = false;
                        }
                        else
                        {
                            bTrading     = true;
                            bCheckEnable = false;
                        }

                        CmdRefreshData();
                    }
                }
            }
            catch (Exception ex)
            {
                SysLog.Error("Message[{0}], StackTrace[{1}]", ex.Message, ex.StackTrace);
            }
        }
示例#17
0
        private void Process(string message)
        {
            try
            {
                var response = new JavaScriptSerializer().Deserialize <dynamic>(message);

                string marketType = response["mt"];
                string marketCode = response["mc"];
                string curcyCd    = response["cd"];
                string dt         = response["dt"];

                if (MainViewModel.CoinData == null)
                {
                    return;
                }

                switch (dt)
                {
                //코인별 시세
                case "cr":
                    using (var tempWsCoinPriceData = new WsCoinPriceDataModel())
                    {
                        tempWsCoinPriceData.marketType = marketType;
                        tempWsCoinPriceData.marketCode = marketCode;

                        var tempWsCoinPriceData1 = Jss.Deserialize <MqCoinPriceModel>(message).data;

                        foreach (var item in tempWsCoinPriceData1.list)
                        {
                            string floatFormat = "n8";
                            if (marketCode == CommonLib.StandardCurcyCd)
                            {
                                ResponseCoinListModel cl = MainViewModel.CoinData.list.Where(w => w.CoinCode == item.cd).FirstOrDefault();
                                floatFormat = "n" + (cl == null ? "0" : cl.CashDecimal.ToString());
                            }

                            tempWsCoinPriceData.list.Add(new WsCoinPriceListModel()
                            {
                                curcyCd = item.cd, coinPrc = item.cp, maxPrc = item.bp, minPrc = item.sp, ytdPrc = item.yp, floatFormat = floatFormat
                            });
                        }

                        if (WsCoinPriceData2.ToList().Where(w => w.Key.Key == marketCode && w.Key.Value == marketCode).Count() == 0)
                        {
                            WsCoinPriceData2.Add(new KeyValuePair <string, string>(marketCode, marketCode), tempWsCoinPriceData);
                        }
                        else
                        {
                            WsCoinPriceData2[new KeyValuePair <string, string>(marketCode, marketCode)] = tempWsCoinPriceData;
                        }

                        if (WsCoinPriceData2 != null)
                        {
                            Messenger.Default.Send(tempWsCoinPriceData);
                        }
                    };
                    break;

                //거래소 실시간 코인시세
                case "rp":
                    using (var tempCoinPriceData = new ResponseExchangeDashboardCoinDataModel())
                    {
                        tempCoinPriceData.Time       = curcyCd;
                        tempCoinPriceData.marketType = marketType;
                        tempCoinPriceData.marketCode = marketCode;

                        var tempCoinPriceData1 = Jss.Deserialize <MqExchangeDashboardCoinModel>(message).data;

                        foreach (var item in tempCoinPriceData1.list)
                        {
                            string floatFormat = "n8";
                            if (marketCode == CommonLib.StandardCurcyCd)
                            {
                                ResponseCoinListModel cl = MainViewModel.CoinData.list.Where(w => w.CoinCode == item.cd).FirstOrDefault();
                                floatFormat = "n" + (cl == null ? "0" : cl.CashDecimal.ToString());
                            }

                            tempCoinPriceData.list.Add(new ResponseExchangeDashboardCoinListModel()
                            {
                                curcyCd = item.cd, coinNm = item.cn, coinPrc = item.cp, chgPrc = item.hp, volume = item.vo, svcTranPrc = item.tc, svcTranAmt = item.sa, floatFormat = floatFormat
                            });
                        }

                        if (CoinPriceData2.ToList().Where(w => w.Key.Key == marketCode && w.Key.Value == tempCoinPriceData.Time).Count() == 0)
                        {
                            CoinPriceData2.Add(new KeyValuePair <string, string>(marketCode, tempCoinPriceData.Time), tempCoinPriceData);
                        }
                        else
                        {
                            CoinPriceData2[new KeyValuePair <string, string>(marketCode, tempCoinPriceData.Time)] = tempCoinPriceData;
                        }

                        if (tempCoinPriceData != null)
                        {
                            Messenger.Default.Send(tempCoinPriceData);
                        }
                    };
                    break;

                //전체 주문내역
                case "ob":
                    using (var tempOrderData = new ResponseExchangeDashboardOrderDataModel())
                    {
                        tempOrderData.curcyCd    = curcyCd;
                        tempOrderData.marketType = marketType;
                        tempOrderData.marketCode = marketCode;

                        var tempOrderData1 = Jss.Deserialize <MqExchangeDashboardOrderModel>(message).data;

                        string floatFormat = "n8";
                        if (marketCode == CommonLib.StandardCurcyCd)
                        {
                            ResponseCoinListModel cl = MainViewModel.CoinData.list.Where(w => w.CoinCode == curcyCd).FirstOrDefault();
                            floatFormat = "n" + (cl == null ? "0" : cl.CashDecimal.ToString());
                        }

                        foreach (var item in tempOrderData1.list)
                        {
                            tempOrderData.list.Add(new ResponseExchangeDashboardOrderListModel()
                            {
                                buyCnAmt = item.ba, buyTranPrc = item.bp, sellCnAmt = item.sa, sellTranPrc = item.sp, floatFormat = floatFormat
                            });
                        }

                        if (OrderData2.ToList().Where(w => w.Key.Key == marketCode && w.Key.Value == tempOrderData.curcyCd).Count() == 0)
                        {
                            OrderData2.Add(new KeyValuePair <string, string>(marketCode, tempOrderData.curcyCd), tempOrderData);
                        }
                        else
                        {
                            OrderData2[new KeyValuePair <string, string>(marketCode, tempOrderData.curcyCd)] = tempOrderData;
                        }

                        if (tempOrderData != null)
                        {
                            Messenger.Default.Send(tempOrderData);
                        }
                    };
                    break;

                //전체 체결 내역
                case "oc":
                    using (var tempFillData = new ResponseExchangeDashboardFillDataModel())
                    {
                        tempFillData.curcyCd    = curcyCd;
                        tempFillData.marketType = marketType;
                        tempFillData.marketCode = marketCode;

                        var tempFillData1 = Jss.Deserialize <MqExchangeDashboardFillModel>(message).data;

                        string floatFormat = "n8";
                        if (marketCode == CommonLib.StandardCurcyCd)
                        {
                            ResponseCoinListModel cl = MainViewModel.CoinData.list.Where(w => w.CoinCode == curcyCd).FirstOrDefault();
                            floatFormat = "n" + (cl == null ? "0" : cl.CashDecimal.ToString());
                        }

                        foreach (var item in tempFillData1.list)
                        {
                            tempFillData.list.Add(new ResponseExchangeDashboardFillListModel()
                            {
                                tradeTime = item.tt, coinPrc = item.cp, cnAmt = item.ca, tradePrc = item.tp, curcyCd = item.cd, orderCd = item.oc == "B" ? "CMMC00000000197" : "CMMC00000000198", floatFormat = floatFormat
                            });
                        }

                        if (FillData2.ToList().Where(w => w.Key.Key == marketCode && w.Key.Value == tempFillData.curcyCd).Count() == 0)
                        {
                            FillData2.Add(new KeyValuePair <string, string>(marketCode, tempFillData.curcyCd), tempFillData);
                        }
                        else
                        {
                            FillData2[new KeyValuePair <string, string>(marketCode, tempFillData.curcyCd)] = tempFillData;
                        }

                        if (tempFillData != null)
                        {
                            Messenger.Default.Send(tempFillData);
                        }
                    };
                    break;

                //코인 체결 정보
                case "ci":
                    using (var tempCoinInfoData = new ResponseCoinInfoDataModel())
                    {
                        var tempCoinInfoData1 = Jss.Deserialize <MqCoinInfoModel>(message).data;

                        ResponseCoinListModel cl = MainViewModel.CoinData.list.Where(w => w.CoinCode == curcyCd).FirstOrDefault();
                        string floatFormat       = "n" + (cl == null ? "0" : cl.CashDecimal.ToString());

                        tempCoinInfoData.curcyCd     = curcyCd;
                        tempCoinInfoData.marketType  = marketType;
                        tempCoinInfoData.marketCode  = marketCode;
                        tempCoinInfoData.nowPrc      = tempCoinInfoData1.cp;
                        tempCoinInfoData.ytdPrc      = tempCoinInfoData1.yp;
                        tempCoinInfoData.ytdPer      = tempCoinInfoData1.yr;
                        tempCoinInfoData.maxPrc      = tempCoinInfoData1.mp;
                        tempCoinInfoData.maxPer      = tempCoinInfoData1.mr;
                        tempCoinInfoData.minPrc      = tempCoinInfoData1.np;
                        tempCoinInfoData.minPer      = tempCoinInfoData1.nr;
                        tempCoinInfoData.totAmt      = tempCoinInfoData1.ta;
                        tempCoinInfoData.ytdAmt      = tempCoinInfoData1.ya;
                        tempCoinInfoData.totPrc      = tempCoinInfoData1.tc;
                        tempCoinInfoData.ytdTotPrc   = tempCoinInfoData1.yc;
                        tempCoinInfoData.volume      = tempCoinInfoData1.vo;
                        tempCoinInfoData.svcTranAmt  = tempCoinInfoData1.sa;
                        tempCoinInfoData.floatFormat = floatFormat;

                        if (CoinInfoData2.ToList().Where(w => w.Key.Key == marketCode && w.Key.Value == tempCoinInfoData.curcyCd).Count() == 0)
                        {
                            CoinInfoData2.Add(new KeyValuePair <string, string>(marketCode, tempCoinInfoData.curcyCd), tempCoinInfoData);
                        }
                        else
                        {
                            CoinInfoData2[new KeyValuePair <string, string>(marketCode, tempCoinInfoData.curcyCd)] = tempCoinInfoData;
                        }

                        if (tempCoinInfoData != null)
                        {
                            Messenger.Default.Send(tempCoinInfoData);
                        }
                    };
                    break;

                default:
                    break;
                }
            }
            catch (Exception ex)
            {
                SysLog.Error("Message[{0}], StackTrace[{1}]", ex.Message, ex.StackTrace);
            }
        }
示例#18
0
        //로그인 Command
        public async void Login()
        {
            try
            {
                if (IsMaintenance)
                {
                    return;
                }

                if (TempUserName != UserName)
                {
                    TempUserName     = UserName;
                    LoginSubmitCount = 0;
                    LoginSubmitCheck = true;
                }

                if (LoginSubmitCount == 5 && LoginSubmitCheck)
                {
                    using (RequestLoginFailModel req = new RequestLoginFailModel())
                    {
                        req.userEmail = UserName;

                        using (ResponseLoginFailModel res = await WebApiLib.AsyncCall <ResponseLoginFailModel, RequestLoginFailModel>(req))
                        {
                            LoginSubmitCount = 0;
                            LoginSubmitCheck = false;
                            Alert alert = new Alert(Localization.Resource.Login_4, 400);
                            alert.ShowDialog();
                            return;
                        }
                    }
                }

                if (string.IsNullOrWhiteSpace(UserName))
                {
                    Alert alert = new Alert(Localization.Resource.Login_5);
                    alert.ShowDialog();
                    return;
                }
                if (string.IsNullOrWhiteSpace(Password))
                {
                    Alert alert = new Alert(Localization.Resource.Login_6);
                    alert.ShowDialog();
                    return;
                }

                #region ID 저장 Check

                if (IsCheck)
                {
                    ini.SetCheckID(UserName.Trim(), "Login", "ID");
                }
                else
                {
                    ini.SetCheckID(string.Empty, "Login", "ID");
                }

                ini.SetCheckID(SelectedLang.Lv, "Language", "Country");

                #endregion

                IsBusy = true;

                Dictionary <string, string> dict = null;

                using (RequestPublicKeyModel req = new RequestPublicKeyModel())
                {
                    using (ResponsePublicKeyModel res = WebApiLib.SyncCall <ResponsePublicKeyModel, RequestPublicKeyModel>(req))
                    {
                        //dict = EncodingLib.AesEncrypt(Password.Trim(), res.data.pubKeyModule, res.data.pubKeyExponent);
                        dict = EncodingLib.AesEncryptKey(res.data.pubKeyModule, res.data.pubKeyExponent);
                    }
                }

                if (dict.Count == 2)
                {
                    using (RequestLoginModel req = new RequestLoginModel())
                    {
                        req.userEmail = UserName.Trim();
                        req.userPwd   = EncodingLib.AesEncrypt(Password.Trim(), dict["gid"]);
                        req.clientPe  = dict["acekey"];
                        req.langCd    = SelectedLang.Lv.ToString().Split('-')[0];
                        req.regIp     = CommonLib.Client_IP;

                        using (ResponseLoginModel res = await WebApiLib.AsyncCall <ResponseLoginModel, RequestLoginModel>(req))
                        {
                            if (res.data.loginYn.Equals("Y"))
                            {
                                if (res.data.isIpFirst.Equals("Y"))
                                {
                                    Views.NoticePopup note = new Views.NoticePopup(NoticePopup.KindNotice.HTS_IP_CHECK_1);
                                    note.Title = Localization.Resource.NoticePopup_3;
                                    if (note.ShowDialog() == true)
                                    {
                                        note       = new Views.NoticePopup(NoticePopup.KindNotice.HTS_IP_CHECK_2);
                                        note.Title = Localization.Resource.NoticePopup_3;
                                        note.ShowDialog();

                                        IsLoginView = Visibility.Collapsed;
                                        Messenger.Default.Send(res.data);
                                    }
                                    else
                                    {
                                        //IP삭제
                                        using (RequestIpRegModel req2 = new RequestIpRegModel())
                                        {
                                            req2.userEmail = UserName.Trim();
                                            req2.ip        = res.data.regIp;
                                            req2.limtHr    = 0;
                                            using (ResponseIpRegModel res2 = await WebApiLib.AsyncCall <ResponseIpRegModel, RequestIpRegModel>(req2))
                                            {
                                                //IP삭제 완료
                                            }
                                        }
                                    }
                                }
                                else
                                {
                                    IsLoginView = Visibility.Collapsed;
                                    Messenger.Default.Send(res.data);
                                }
                            }
                            else
                            {
                                IsBusy = false;
                                if (res.resultMsg != null)
                                {
                                    if (res.data.lockYn == "Y")
                                    {
                                        Alert alert = new Alert("[" + Localization.Resource.Login_20 + "]" + "\n" + Localization.Resource.Login_18 + "\n" + Localization.Resource.Login_19, 460, 180);
                                        if (alert.ShowDialog() == true)
                                        {
                                            using (RequestPwdChangeModel req2 = new RequestPwdChangeModel())
                                            {
                                                req2.userEmail = UserName.Trim();

                                                using (ResponsePwdChagneModel res2 = WebApiLib.SyncCall <ResponsePwdChagneModel, RequestPwdChangeModel>(req2))
                                                {
                                                    if (res2.resultStrCode == "000")
                                                    {
                                                        alert = new Alert(Localization.Resource.Login_23, 330);
                                                        alert.ShowDialog();
                                                    }
                                                }
                                            }
                                        }
                                    }
                                    else
                                    {
                                        if (res.data.failCd.Equals(StringEnum.GetStringValue(EnumLib.LoginFailCode.notExistPassword)))
                                        {
                                            LoginSubmitCount++;
                                            if (LoginSubmitCount == 5)
                                            {
                                                LoginSubmitCheck = true;
                                            }
                                            Alert alert = new Alert(string.Format(Localization.Resource.Login_24, LoginSubmitCount) + "\n" + Localization.Resource.Login_25, 300);
                                            alert.ShowDialog();
                                        }
                                        else if (res.data.failCd.Equals(StringEnum.GetStringValue(EnumLib.LoginFailCode.blockID)))
                                        {
                                            LoginSubmitCount = 0;
                                            LoginSubmitCheck = false;

                                            Alert alert = new Alert(Localization.Resource.Login_4, 400);
                                            alert.ShowDialog();
                                        }
                                        else if (res.data.failCd.Equals(StringEnum.GetStringValue(EnumLib.LoginFailCode.userEmailFail)))
                                        {
                                            Alert alert = new Alert(Localization.Resource.Login_11, 300);
                                            alert.ShowDialog();
                                        }
                                        else if (res.data.failCd.Equals(StringEnum.GetStringValue(EnumLib.LoginFailCode.userPasswordFail)))
                                        {
                                            Alert alert = new Alert(Localization.Resource.Login_12, 300);
                                            alert.ShowDialog();
                                        }
                                        else if (res.data.failCd.Equals(StringEnum.GetStringValue(EnumLib.LoginFailCode.notExistEmail)))
                                        {
                                            Alert alert = new Alert(Localization.Resource.Login_13, 300);
                                            alert.ShowDialog();
                                        }
                                        else if (res.data.failCd.Equals(StringEnum.GetStringValue(EnumLib.LoginFailCode.NotRegIP)))
                                        {
                                            NoticePopup note = new NoticePopup(NoticePopup.KindNotice.HTS_IP_NOT_CHECK_1);
                                            note.Title = Localization.Resource.NoticePopup_4;
                                            NoticePopupViewModel.UserName = UserName.Trim();
                                            if (note.ShowDialog() == true)
                                            {
                                                IpRegisterViewModel.regIp     = res.data.regIp;
                                                IpRegisterViewModel.userEmail = UserName.Trim();
                                                IpRegister ip = new IpRegister();
                                                ip.ShowDialog();
                                            }
                                        }
                                        else if (res.data.failCd.Equals(StringEnum.GetStringValue(EnumLib.LoginFailCode.NotUseID)))
                                        {
                                            Alert alert = new Alert(Localization.Resource.Login_16, 300);
                                            alert.ShowDialog();
                                        }
                                        else if (res.data.failCd.Equals(StringEnum.GetStringValue(EnumLib.LoginFailCode.loginFailCode)))
                                        {
                                            Alert alert = new Alert(Localization.Resource.Login_17, 350);
                                            alert.ShowDialog();
                                        }
                                        else if (res.data.failCd.Equals(StringEnum.GetStringValue(EnumLib.LoginFailCode.ReSettingPW)))
                                        {
                                            Alert alert = new Alert(Localization.Resource.Login_21, 300, 140, Localization.Resource.Login_22);
                                            if (alert.ShowDialog() == true)
                                            {
                                                using (RequestPwdChangeModel req2 = new RequestPwdChangeModel())
                                                {
                                                    req2.userEmail = UserName.Trim();

                                                    using (ResponsePwdChagneModel res2 = WebApiLib.SyncCall <ResponsePwdChagneModel, RequestPwdChangeModel>(req2))
                                                    {
                                                        if (res2.resultStrCode == "000")
                                                        {
                                                            alert = new Alert(Localization.Resource.Login_23, 330);
                                                            alert.ShowDialog();
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                        else
                                        {
                                            Alert alert = new Alert(Localization.Resource.Login_17, 350);
                                            alert.ShowDialog();
                                        }
                                    }
                                }
                                else
                                {
                                    Alert alert = new Alert(Localization.Resource.Login_7, 320);
                                    alert.ShowDialog();
                                }
                            }
                        }
                    }
                }
                else
                {
                    Alert alert = new Alert(Localization.Resource.Login_8, Alert.ButtonType.Ok);
                    alert.ShowDialog();
                }

                IsBusy = false;
            }
            catch (Exception ex)
            {
                SysLog.Error("Message[{0}], StackTrace[{1}]", ex.Message, ex.StackTrace);
                IsBusy = false;

                Alert alert = new Alert(Localization.Resource.Login_9, Alert.ButtonType.Ok);
                alert.ShowDialog();
            }
            finally
            {
                IsBusy = false;
            }
        }
示例#19
0
        public async void GetCoinAddressYn()
        {
            try
            {
                using (RequestCoinAddressTableModel req = new RequestCoinAddressTableModel())
                {
                    req.userEmail = MainViewModel.LoginDataModel.userEmail;
                    using (ResponseCoinAddressTableModel res = await WebApiLib.AsyncCall <ResponseCoinAddressTableModel, RequestCoinAddressTableModel>(req))
                    {
                        if (res != null)
                        {
                            CoinAddressHeight = 45;

                            ObservableCollection <ResponseCoinAddressTableListModel> delTemp = new ObservableCollection <ResponseCoinAddressTableListModel>();

                            foreach (var item in res.data.list)
                            {
                                if (item.curcyCd.Equals(StringEnum.GetStringValue(EnumLib.ExchangeCurrencyCode.KRW)) || item.curcyCd.Equals(EnumLib.ExchangeCurrencyCode.DestinationTag))
                                {
                                    delTemp.Add(item);
                                }

                                if (item.accNo.Equals(string.Empty))
                                {
                                    item.accNo = NonAddress;
                                }
                                else if (!item.destiTag.Equals(string.Empty))
                                {
                                    string sTag = string.Empty;
                                    if (item.curcyCd.Equals(StringEnum.GetStringValue(EnumLib.ExchangeCurrencyCode.XRP)))
                                    {
                                        sTag = "DestinationTag : ";
                                    }
                                    else if (item.curcyCd.Equals(StringEnum.GetStringValue(EnumLib.ExchangeCurrencyCode.VSTC)) || item.curcyCd.Equals(StringEnum.GetStringValue(EnumLib.ExchangeCurrencyCode.XEM)))
                                    {
                                        sTag = "Message : ";
                                    }
                                    else if (item.curcyCd.Equals(StringEnum.GetStringValue(EnumLib.ExchangeCurrencyCode.XLM)) || item.curcyCd.Equals(StringEnum.GetStringValue(EnumLib.ExchangeCurrencyCode.EOS)))
                                    {
                                        sTag = "Memo : ";
                                    }

                                    item.accNo = $"{item.accNo + " (" + sTag + item.destiTag + ")"}";
                                }

                                CoinAddressHeight += 30;
                            }

                            if (delTemp != null)
                            {
                                foreach (ResponseCoinAddressTableListModel temp in delTemp)
                                {
                                    res.data.list.Remove(temp);
                                    CoinAddressHeight -= 30;
                                }
                            }

                            CoinAddressValue = res.data.list;
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                SysLog.Error("Message[{0}], StackTrace[{1}]", ex.Message, ex.StackTrace);
            }
        }
示例#20
0
        public async void CmdSetGoogleOTP()
        {
            try
            {
                if (emailCertVisible == Visibility.Visible)
                {
                    alert = new Alert(Localization.Resource.WithdrawDepositWithdraw_Common_4, 320);
                    alert.ShowDialog();
                    return;
                }
                else if (string.IsNullOrWhiteSpace(otpNumber.Trim()))
                {
                    alert = new Alert(Localization.Resource.CertifyMyPage_Alert_5);
                    alert.ShowDialog();
                    return;
                }

                IsBusy = true;

                using (RequestSetGoogleOtpModel req = new RequestSetGoogleOtpModel())
                {
                    req.userEmail  = userEmail;
                    req.authCode   = otpNumber;
                    req.encodedKey = encodeKey;
                    req.isUpt      = "Y";

                    using (ResponseSetGoogleOtpModel res = await WebApiLib.AsyncCall <ResponseSetGoogleOtpModel, RequestSetGoogleOtpModel>(req))
                    {
                        if (res.resultStrCode == "000")
                        {
                            string sResultCd = res.data.failCd;

                            if (sResultCd.Equals(""))
                            {
                                alert = new Alert(Localization.Resource.Common_Alert_2);
                                alert.ShowDialog();

                                certifyStep2Visible = Visibility.Collapsed;
                                emailCertVisible    = Visibility.Collapsed;
                                changeStep2Visible  = Visibility.Visible;
                                qrCodeUrl           = null;
                                otpNumber           = string.Empty;

                                using (RequestUserCertModel req2 = new RequestUserCertModel())
                                {
                                    req2.userEmail = userEmail;
                                    req2.otpSerial = encodeKey;
                                    req2.otpCertYn = "N";

                                    using (ResponseUserCertModel res2 = await WebApiLib.AsyncCall <ResponseUserCertModel, RequestUserCertModel>(req2))
                                    {
                                        MainViewModel.LoginDataModel.otpNo = encodeKey;
                                        Messenger.Default.Send("CoinSetting");
                                    }
                                }
                            }
                            else
                            {
                                alert = new Alert(Localization.Resource.TransferDepositWithdraw_Common_6);
                                alert.ShowDialog();
                            }
                        }
                        else
                        {
                            alert = new Alert(Localization.Resource.CertifyMyPage_Alert_9);
                            alert.ShowDialog();
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                SysLog.Error("Message[{0}], StackTrace[{1}]", ex.Message, ex.StackTrace);
            }
            finally
            {
                IsBusy = false;
            }
        }
示例#21
0
        public void GetData()
        {
            try
            {
                //정보 호출 API
                if (sTradeInfo.Equals("B"))
                {
                    using (RequestArbitrageGetUserAssetCashModel req = new RequestArbitrageGetUserAssetCashModel())
                    {
                        req.userEmail = MainViewModel.LoginDataModel.userEmail;
                        req.regIp     = MainViewModel.LoginDataModel.regIp;
                        if (bHereTrade)
                        {
                            req.isAllYn = "N";
                        }
                        else if (bAllTrade)
                        {
                            req.isAllYn = "Y";
                        }
                        req.targetId = sLowId;
                        req.cnKndNm  = StringEnum.ToEnum <ExchangeCurrencyCode>(sOrderCode).ToString();

                        using (ResponseArbitrageGetUserAssetCashModel res = WebApiLib.SyncCallEncrypt <ResponseArbitrageGetUserAssetCashModel, RequestArbitrageGetUserAssetCashModel>(req))
                        {
                            if (res.resultStrCode == "000")
                            {
                                if (res.data.failCd.Equals(""))
                                {
                                    //if (bHereTrade)
                                    //{
                                    //    dNowAmount = (decimal)dNowAmountTemp;
                                    //}
                                    //else if (bAllTrade)
                                    //{
                                    dNowAmount = res.data.data;
                                    //}
                                    dCoinPrc  = res.data.cnPtcPrc;
                                    sExchgeNm = res.data.exchgeNm;
                                }
                            }
                        }
                    }
                }
                else if (sTradeInfo.Equals("S"))
                {
                    using (RequestArbitrageGetUserAssetCoinModel req = new RequestArbitrageGetUserAssetCoinModel())
                    {
                        req.userEmail = MainViewModel.LoginDataModel.userEmail;
                        req.regIp     = MainViewModel.LoginDataModel.regIp;
                        if (bHereTrade)
                        {
                            req.isAllYn = "N";
                        }
                        else if (bAllTrade)
                        {
                            req.isAllYn = "Y";
                        }
                        req.targetId = sLowId;
                        req.cnKndNm  = StringEnum.ToEnum <ExchangeCurrencyCode>(sOrderCode).ToString();

                        using (ResponseArbitrageGetUserAssetCoinModel res = WebApiLib.SyncCallEncrypt <ResponseArbitrageGetUserAssetCoinModel, RequestArbitrageGetUserAssetCoinModel>(req))
                        {
                            if (res.resultStrCode == "000")
                            {
                                if (res.data.failCd.Equals(""))
                                {
                                    //if (bHereTrade)
                                    //{
                                    //    dNowAmount = (decimal)dNowAmountTemp;
                                    //}
                                    //else if (bAllTrade)
                                    //{
                                    dNowAmount = res.data.data;
                                    //}
                                    dCoinPrc  = res.data.cnPtcPrc;
                                    sCnKndCd  = res.data.cnKndCd;
                                    sExchgeNm = res.data.exchgeNm;
                                }
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                SysLog.Error("Message[{0}], StackTrace[{1}]", ex.Message, ex.StackTrace);
            }
        }
示例#22
0
        public void CmdTrade()
        {
            try
            {
                if (string.IsNullOrEmpty(sOrderCode))
                {
                    return;
                }

                if (dNowAmount.Equals(0))
                {
                    if (sTradeInfo.Equals("B"))
                    {
                        alert = new Alert(Localization.Resource.Arbitrage_TradePop_Alert_2);
                        alert.ShowDialog();
                    }
                    else if (sTradeInfo.Equals("S"))
                    {
                        alert = new Alert(Localization.Resource.Arbitrage_TradePop_Alert_3);
                        alert.ShowDialog();
                    }
                    return;
                }

                alert = new Alert(Localization.Resource.Arbitrage_TradePop_Alert_1, Alert.ButtonType.YesNo);
                if (alert.ShowDialog() == true)
                {
                    //거래실행 API
                    if (sTradeInfo.Equals("B"))
                    {
                        using (RequestArbitrageBuyTradeCoinModel req = new RequestArbitrageBuyTradeCoinModel())
                        {
                            req.userEmail = MainViewModel.LoginDataModel.userEmail;
                            req.regIp     = MainViewModel.LoginDataModel.regIp;
                            if (bHereTrade)
                            {
                                req.type = "One";
                            }
                            else if (bAllTrade)
                            {
                                req.type = "All";
                            }
                            req.cnKndCd = sOrderCode;
                            req.lowId   = sLowId;
                            req.highId  = sHighId;

                            using (ResponseArbitrageBuyTradeCoinModel res = WebApiLib.SyncCallEncrypt <ResponseArbitrageBuyTradeCoinModel, RequestArbitrageBuyTradeCoinModel>(req))
                            {
                                if (res.resultStrCode == "000")
                                {
                                    if (res.data.failCd.Equals(""))
                                    {
                                        bTrading = true;
                                        alert    = new Alert(Localization.Resource.Arbitrage_Alert_2);
                                        alert.ShowDialog();
                                        WindowService.Close();
                                    }
                                    else if (res.data.failCd.Equals("778"))
                                    {
                                        RepeatTimer.Stop();
                                        alert = new Alert(Localization.Resource.Arbitrage_Alert_6, 330);
                                        alert.ShowDialog();
                                        WindowService.Close();
                                    }
                                    //else if (res.data.failCd.Equals("777"))
                                    //{
                                    //    alert = new Alert();
                                    //    alert.ShowDialog();
                                    //    return;
                                    //}
                                }
                            }
                        }
                    }
                    else if (sTradeInfo.Equals("S"))
                    {
                        using (RequestArbitrageSellTradeCoinModel req = new RequestArbitrageSellTradeCoinModel())
                        {
                            req.userEmail = MainViewModel.LoginDataModel.userEmail;
                            req.regIp     = MainViewModel.LoginDataModel.regIp;
                            if (bHereTrade)
                            {
                                req.type = "One";
                            }
                            else if (bAllTrade)
                            {
                                req.type = "All";
                            }
                            req.cnKndCd = sOrderCode;
                            req.lowId   = sHighId;
                            req.highId  = sLowId;

                            using (ResponseArbitrageSellTradeCoinModel res = WebApiLib.SyncCallEncrypt <ResponseArbitrageSellTradeCoinModel, RequestArbitrageSellTradeCoinModel>(req))
                            {
                                if (res.resultStrCode == "000")
                                {
                                    if (res.data.failCd.Equals(""))
                                    {
                                        bTrading = true;
                                        alert    = new Alert(Localization.Resource.Arbitrage_Alert_2);
                                        alert.ShowDialog();
                                        WindowService.Close();
                                    }
                                    else if (res.data.failCd.Equals("778"))
                                    {
                                        RepeatTimer.Stop();
                                        alert = new Alert(Localization.Resource.Arbitrage_Alert_6, 330);
                                        alert.ShowDialog();
                                        WindowService.Close();
                                    }
                                    //else if (res.data.failCd.Equals("777"))
                                    //{
                                    //    alert = new Alert();
                                    //    alert.ShowDialog();
                                    //    return;
                                    //}
                                }
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                SysLog.Error("Message[{0}], StackTrace[{1}]", ex.Message, ex.StackTrace);
            }
        }
        //신청하기
        public void LendingRequest()
        {
            try
            {
                if (selCurcy == null)
                {
                    return;
                }

                if (reqAmt == 0)
                {
                    alert = new Alert(Localization.Resource.Lending_Alert_3);
                    alert.ShowDialog();
                    return;
                }
                else if (minReqAmt > reqAmt)
                {
                    alert = new Alert(Localization.Resource.Lending_Alert_4, 330);
                    alert.ShowDialog();
                    return;
                }

                else if (maxReqAmt < reqAmt)
                {
                    alert = new Alert(Localization.Resource.Lending_Alert_5, 330);
                    alert.ShowDialog();
                    return;
                }

                alert = new Alert(Localization.Resource.Lending_Alert_6, Alert.ButtonType.YesNo, 330);
                if (alert.ShowDialog() == true)
                {
                    using (RequestLendingApplyModel req = new RequestLendingApplyModel())
                    {
                        req.userEmail = MainViewModel.LoginDataModel.userEmail;
                        req.cnKndCd   = selCurcy.Value;
                        req.applyDt   = fromDate.Replace("-", "").ToString();
                        req.applyAmt  = reqAmt;
                        req.mthCmt    = allMonth;
                        req.regIp     = MainViewModel.LoginDataModel.regIp;

                        using (ResponseLendingApplyModel res = WebApiLib.SyncCall <ResponseLendingApplyModel, RequestLendingApplyModel>(req))
                        {
                            if (res.resultStrCode == "000")
                            {
                                string resultCd = res.data.failCd;
                                if (resultCd.Equals(""))
                                {
                                    alert = new Alert(Localization.Resource.Common_Alert_24);
                                    alert.ShowDialog();
                                    allEnable = false;
                                    GetData();
                                    ControlClear();

                                    Messenger.Default.Send("AssetsRefresh");
                                }
                                else if (resultCd.Equals("999"))
                                {
                                    alert = new Alert(Localization.Resource.Lending_Alert_7);
                                    alert.ShowDialog();
                                }
                                else if (resultCd.Equals("998"))
                                {
                                    alert = new Alert(Localization.Resource.Lending_Alert_8);
                                    alert.ShowDialog();
                                }
                                else if (resultCd.Equals("997"))
                                {
                                    alert = new Alert(Localization.Resource.Lending_Alert_9);
                                    alert.ShowDialog();
                                }
                                else if (resultCd.Equals("996"))
                                {
                                    alert = new Alert(Localization.Resource.Lending_Alert_10);
                                    alert.ShowDialog();
                                }
                                else if (resultCd.Equals("995"))
                                {
                                    alert = new Alert(Localization.Resource.Lending_Alert_11);
                                    alert.ShowDialog();
                                }
                                else if (resultCd.Equals("994"))
                                {
                                    alert = new Alert(Localization.Resource.Lending_Alert_12);
                                    alert.ShowDialog();
                                }
                                else if (resultCd.Equals("993"))
                                {
                                    alert = new Alert(Localization.Resource.Lending_Alert_13);
                                    alert.ShowDialog();
                                }
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                SysLog.Error("Message[{0}], StackTrace[{1}]", ex.Message, ex.StackTrace);
            }
        }
        public void Loaded()
        {
            try
            {
                IsLoad   = true;
                listSize = 10;
                RepeatTimer.Start();

                //string sCheckValue = ini.GetCheckID("ViewTermAgree", "Check");
                //if (!sCheckValue.Equals(string.Empty))
                //{
                //    bCheck = true;
                //    bCheckEnable = true;
                //}
                //else
                //{
                //    bCheck = false;
                //    bCheckEnable = false;
                //}

                using (RequestArbitrageGetSignInfoModel req = new RequestArbitrageGetSignInfoModel())
                {
                    req.userEmail = MainViewModel.LoginDataModel.userEmail;

                    using (ResponseArbitrageGetSignInfoModel res = WebApiLib.SyncCallEncrypt <ResponseArbitrageGetSignInfoModel, RequestArbitrageGetSignInfoModel>(req))
                    {
                        if (res.resultStrCode == "000")
                        {
                            if (res.data.failCd.Equals(""))
                            {
                                arbiExchangeList = new ObservableCollection <ResponseArbitrageGetSignInfoListModel>();
                                arbiExchangeList = res.data.list;

                                if (res.data.list.Where(x => x.joinYn == "N").Count() + res.data.list.Where(x => x.joinYn == "F").Count() > 0)
                                {
                                    Task.Run(() =>
                                    {
                                        DispatcherService.BeginInvoke(() =>
                                        {
                                            ArbitrageSignUpPopAdditionalService pop = new ArbitrageSignUpPopAdditionalService();
                                            ((ArbitrageSignUpPopAdditionalServiceViewModel)pop.DataContext).signUpList = res.data.list;
                                            pop.ShowDialog();
                                            if (((ArbitrageSignUpPopAdditionalServiceViewModel)pop.DataContext).bDialogResult == true)
                                            {
                                                GetArbitrageData(_OrderCode);
                                                bTotalSignCheck = true;
                                            }
                                            else
                                            {
                                                bTotalSignCheck = false;
                                            }
                                        });
                                    });
                                }
                                else
                                {
                                    GetArbitrageData(_OrderCode);
                                    bTotalSignCheck = true;
                                }
                            }
                            else if (res.data.failCd.Equals("998"))
                            {
                                Alert alert = new Alert(Localization.Resource.Arbitrage_SignUpPop_Alert_1, 300, 160);
                                alert.ShowDialog();
                                return;
                            }
                        }
                    }
                }

                GetArbitrageTradeList();
            }
            catch (Exception ex)
            {
                SysLog.Error("Message[{0}], StackTrace[{1}]", ex.Message, ex.StackTrace);
            }
        }
示例#25
0
            public MenuRightList()
            {
                try
                {
                    ObservableCollection <ResponseBookMarkMenuListModel> sMenuList;
                    string SC = CommonLib.StandardCurcyNm;

                    using (RequestBookMarkMenuModel req = new RequestBookMarkMenuModel())
                    {
                        req.userEmail = MainViewModel.LoginDataModel.userEmail;

                        using (ResponseBookMarkMenuModel res = WebApiLib.SyncCall <ResponseBookMarkMenuModel, RequestBookMarkMenuModel>(req))
                        {
                            sMenuList = res.data.list;
                            sMenuList = new ObservableCollection <ResponseBookMarkMenuListModel>(sMenuList.OrderBy(x => x.sn));
                        }
                    }
                    if (sMenuList.Count.Equals(0))
                    {
                        Add(ViewModelSource.Create(() => new Menu()
                        {
                            Name = Localization.Resource.Main_QuickMenu_20, CheckState = false, Code = StringEnum.GetStringValue(EnumLib.MenuCode.BuySell)
                        }));
                        Add(ViewModelSource.Create(() => new Menu()
                        {
                            Name = string.Format(Localization.Resource.Main_QuickMenu_1, SC), CheckState = false, Code = StringEnum.GetStringValue(EnumLib.MenuCode.Recharge)
                        }));
                        Add(ViewModelSource.Create(() => new Menu()
                        {
                            Name = string.Format(Localization.Resource.Main_QuickMenu_2, SC), CheckState = false, Code = StringEnum.GetStringValue(EnumLib.MenuCode.Withdraw)
                        }));
                        Add(ViewModelSource.Create(() => new Menu()
                        {
                            Name = Localization.Resource.Main_QuickMenu_7, CheckState = false, Code = StringEnum.GetStringValue(EnumLib.MenuCode.Deposit)
                        }));
                        Add(ViewModelSource.Create(() => new Menu()
                        {
                            Name = Localization.Resource.Main_QuickMenu_8, CheckState = false, Code = StringEnum.GetStringValue(EnumLib.MenuCode.Transfer)
                        }));
                        Add(ViewModelSource.Create(() => new Menu()
                        {
                            Name = Localization.Resource.Main_QuickMenu_9, CheckState = false, Code = StringEnum.GetStringValue(EnumLib.MenuCode.TradeHistory)
                        }));
                        Add(ViewModelSource.Create(() => new Menu()
                        {
                            Name = Localization.Resource.Main_QuickMenu_10, CheckState = false, Code = StringEnum.GetStringValue(EnumLib.MenuCode.MyAssets)
                        }));
                        Add(ViewModelSource.Create(() => new Menu()
                        {
                            Name = Localization.Resource.Main_QuickMenu_12, CheckState = false, Code = StringEnum.GetStringValue(EnumLib.MenuCode.QnA)
                        }));
                    }
                    else
                    {
                        foreach (var item in sMenuList)
                        {
                            if (item.menuCd.Equals(StringEnum.GetStringValue(EnumLib.MenuCode.BuySell)))
                            {
                                Add(ViewModelSource.Create(() => new Menu()
                                {
                                    Name = Localization.Resource.Main_QuickMenu_20, CheckState = false, Code = StringEnum.GetStringValue(EnumLib.MenuCode.BuySell)
                                }));
                            }
                            else if (item.menuCd.Equals(StringEnum.GetStringValue(EnumLib.MenuCode.Recharge)))
                            {
                                Add(ViewModelSource.Create(() => new Menu()
                                {
                                    Name = string.Format(Localization.Resource.Main_QuickMenu_1, SC), CheckState = false, Code = StringEnum.GetStringValue(EnumLib.MenuCode.Recharge)
                                }));
                            }
                            else if (item.menuCd.Equals(StringEnum.GetStringValue(EnumLib.MenuCode.Withdraw)))
                            {
                                Add(ViewModelSource.Create(() => new Menu()
                                {
                                    Name = string.Format(Localization.Resource.Main_QuickMenu_2, SC), CheckState = false, Code = StringEnum.GetStringValue(EnumLib.MenuCode.Withdraw)
                                }));
                            }
                            else if (item.menuCd.Equals(StringEnum.GetStringValue(EnumLib.MenuCode.Deposit)))
                            {
                                Add(ViewModelSource.Create(() => new Menu()
                                {
                                    Name = Localization.Resource.Main_QuickMenu_7, CheckState = false, Code = StringEnum.GetStringValue(EnumLib.MenuCode.Deposit)
                                }));
                            }
                            else if (item.menuCd.Equals(StringEnum.GetStringValue(EnumLib.MenuCode.Transfer)))
                            {
                                Add(ViewModelSource.Create(() => new Menu()
                                {
                                    Name = Localization.Resource.Main_QuickMenu_8, CheckState = false, Code = StringEnum.GetStringValue(EnumLib.MenuCode.Transfer)
                                }));
                            }
                            else if (item.menuCd.Equals(StringEnum.GetStringValue(EnumLib.MenuCode.TradeHistory)))
                            {
                                Add(ViewModelSource.Create(() => new Menu()
                                {
                                    Name = Localization.Resource.Main_QuickMenu_9, CheckState = false, Code = StringEnum.GetStringValue(EnumLib.MenuCode.TradeHistory)
                                }));
                            }
                            else if (item.menuCd.Equals(StringEnum.GetStringValue(EnumLib.MenuCode.MyAssets)))
                            {
                                Add(ViewModelSource.Create(() => new Menu()
                                {
                                    Name = Localization.Resource.Main_QuickMenu_10, CheckState = false, Code = StringEnum.GetStringValue(EnumLib.MenuCode.MyAssets)
                                }));
                            }
                            else if (item.menuCd.Equals(StringEnum.GetStringValue(EnumLib.MenuCode.QnA)))
                            {
                                Add(ViewModelSource.Create(() => new Menu()
                                {
                                    Name = Localization.Resource.Main_QuickMenu_12, CheckState = false, Code = StringEnum.GetStringValue(EnumLib.MenuCode.QnA)
                                }));
                            }
                        }
                    }
                }
                catch (Exception ex)
                {
                    SysLog.Error("Message[{0}], StackTrace[{1}]", ex.Message, ex.StackTrace);
                }
            }
示例#26
0
        //선불카드 충전
        public async void CmdCardCharging()
        {
            try
            {
                //alert = new Alert(Localization.Resource.RechargeDepositWithdraw_Card_Pop_15);
                //alert.ShowDialog();
                //return;

                IsBusy = true;

                if (SelCard.Value.Equals("00"))
                {
                    alert = new Alert(Localization.Resource.RechargeDepositWithdraw_Common_10, 330);
                    alert.ShowDialog();
                    return;
                }
                else if (cardMonth.Length != 2)
                {
                    alert = new Alert(Localization.Resource.RechargeDepositWithdraw_Common_3, 330);
                    alert.ShowDialog();
                    return;
                }
                else if (cardYear.Length != 2)
                {
                    alert = new Alert(Localization.Resource.RechargeDepositWithdraw_Common_4, 330);
                    alert.ShowDialog();
                    return;
                }
                else if (cardCvc.Length != 3)
                {
                    alert = new Alert(Localization.Resource.RechargeDepositWithdraw_Common_5, 330);
                    alert.ShowDialog();
                    return;
                }
                else if (cardPw.Length != 4)
                {
                    alert = new Alert(Localization.Resource.RechargeDepositWithdraw_Common_6, 330);
                    alert.ShowDialog();
                    return;
                }
                else if (cardRemPrc < RechargePrc)
                {
                    alert = new Alert(Localization.Resource.RechargeDepositWithdraw_Common_7, 330);
                    alert.ShowDialog();
                    return;
                }
                else if (RechargePrc < 5000)
                {
                    alert = new Alert(Localization.Resource.RechargeDepositWithdraw_Common_22, 330);
                    alert.ShowDialog();
                    return;
                }
                else if (RechargePrc > 2000000)
                {
                    alert = new Alert(string.Format(Localization.Resource.RechargeDepositWithdraw_Common_29, decimal.Parse("2000000").ToString("#,#"), SC), 330);
                    alert.ShowDialog();
                    return;
                }

                //GetExRate();
                OnRechargePrcChanged();

                alert = new Alert(Localization.Resource.RechargeDepositWithdraw_Common_8, Alert.ButtonType.YesNo, 330);
                if (alert.ShowDialog() == true)
                {
                    Dictionary <string, string> dict = new Dictionary <string, string>();

                    using (RequestPublicKeyModel req2 = new RequestPublicKeyModel())
                    {
                        using (ResponsePublicKeyModel res2 = WebApiLib.SyncCall <ResponsePublicKeyModel, RequestPublicKeyModel>(req2))
                        {
                            dict = EncodingLib.AesEncryptKey(res2.data.pubKeyModule, res2.data.pubKeyExponent);
                        }
                    }

                    using (RequestDepositCardModel req = new RequestDepositCardModel())
                    {
                        req.userEmail = MainViewModel.LoginDataModel.userEmail;
                        req.crgPrc    = RechargePrc;
                        req.cardNum   = EncodingLib.AesEncrypt(SelCard.Value, dict["gid"]);
                        req.cardDate  = EncodingLib.AesEncrypt(("20" + cardYear + cardMonth), dict["gid"]);
                        req.cardCvc   = EncodingLib.AesEncrypt(cardCvc, dict["gid"]);
                        req.cardPwd   = EncodingLib.AesEncrypt(cardPw, dict["gid"]);
                        req.clientPe  = dict["acekey"];

                        using (ResponseDepositCardModel res = await WebApiLib.AsyncCall <ResponseDepositCardModel, RequestDepositCardModel>(req))
                        {
                            if (res.resultStrCode == "000")
                            {
                                string resultCd = res.data.failCd;
                                if (resultCd.Equals("999"))
                                {
                                    alert = new Alert(Localization.Resource.RechargeDepositWithdraw_Common_12, 330);
                                    alert.ShowDialog();
                                }
                                else if (resultCd.Equals("998"))
                                {
                                    alert = new Alert(Localization.Resource.RechargeDepositWithdraw_Common_13, 330);
                                    alert.ShowDialog();
                                }
                                else if (resultCd.Equals("997"))
                                {
                                    alert = new Alert(Localization.Resource.RechargeDepositWithdraw_Common_14, 330);
                                    alert.ShowDialog();
                                }
                                else if (resultCd.Equals("996"))
                                {
                                    alert = new Alert(Localization.Resource.RechargeDepositWithdraw_Common_15, 330);
                                    alert.ShowDialog();
                                }
                                else if (resultCd.Equals("995"))
                                {
                                    alert = new Alert(Localization.Resource.RechargeDepositWithdraw_Common_16, 330);
                                    alert.ShowDialog();
                                }
                                else if (resultCd.Equals("994"))
                                {
                                    alert = new Alert(Localization.Resource.RechargeDepositWithdraw_Common_17, 330);
                                    alert.ShowDialog();
                                }
                                else if (resultCd.Equals("993"))
                                {
                                    alert = new Alert(Localization.Resource.RechargeDepositWithdraw_Common_18, 330);
                                    alert.ShowDialog();
                                }
                                else if (resultCd.Equals("992"))
                                {
                                    alert = new Alert(Localization.Resource.RechargeDepositWithdraw_Common_12, 330);
                                    alert.ShowDialog();
                                }
                                else if (resultCd.Equals("991"))
                                {
                                    alert = new Alert(Localization.Resource.RechargeDepositWithdraw_Common_20, 330);
                                    alert.ShowDialog();
                                }
                                else
                                {
                                    alert = new Alert(Localization.Resource.RechargeDepositWithdraw_Common_9, 330);
                                    alert.ShowDialog();

                                    SelCard     = cardList[0];
                                    cardMonth   = string.Empty;
                                    cardYear    = string.Empty;
                                    cardCvc     = string.Empty;
                                    cardPw      = string.Empty;
                                    cardRemPrc  = 0;
                                    RechargePrc = 0;
                                    fee         = 0;
                                    ResultPrc   = 0;

                                    GetCardList();
                                    GetKrwRecharge(EnumLib.PaymentWay.prepaidCard);
                                    //GetExRate();
                                }

                                IsBusy = false;
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                SysLog.Error("Message[{0}], StackTrace[{1}]", ex.Message, ex.StackTrace);
            }
            finally
            {
                IsBusy = false;
            }
        }
示例#27
0
        private void Yes_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                Dictionary <string, string> dict = new Dictionary <string, string>();

                using (RequestPublicKeyModel req2 = new RequestPublicKeyModel())
                {
                    using (ResponsePublicKeyModel res2 = WebApiLib.SyncCall <ResponsePublicKeyModel, RequestPublicKeyModel>(req2))
                    {
                        dict = EncodingLib.AesEncryptKey(res2.data.pubKeyModule, res2.data.pubKeyExponent);
                    }
                }

                using (RequestPinNumbrInitModel req = new RequestPinNumbrInitModel())
                {
                    req.userEmail = MainViewModel.LoginDataModel.userEmail;
                    req.userPwd   = EncodingLib.AesEncrypt(userPwd.Text, dict["gid"]);
                    req.clientPe  = dict["acekey"];

                    using (ResponsePinNumbrInitModel res = WebApiLib.SyncCall <ResponsePinNumbrInitModel, RequestPinNumbrInitModel>(req))
                    {
                        if (res.resultStrCode == "000")
                        {
                            if (res.data.failCd.Equals(""))
                            {
                                alert = new Alert(Localization.Resource.MemberInfo_Pop_19 + "\n" + Localization.Resource.MemberInfo_Pop_17, 330);
                                alert.ShowDialog();

                                this.DialogResult = true;
                                this.Close();
                            }
                            else if (res.data.failCd.Equals("998"))
                            {
                                alert = new Alert(Localization.Resource.MemberInfo_Pop_18);
                                alert.ShowDialog();
                            }
                            else if (res.data.failCd.Equals("997"))
                            {
                                alert = new Alert(Localization.Resource.MemberInfo_Pop_20);
                                alert.ShowDialog();
                            }
                            else if (res.data.failCd.Equals("996"))
                            {
                                alert = new Alert(Localization.Resource.MemberInfo_Pop_16 + "\n" + Localization.Resource.MemberInfo_Pop_17, 330);
                                alert.ShowDialog();
                            }
                            else if (res.data.failCd.Equals("993"))
                            {
                                //비밀번호 미일치.
                                alert = new Alert(Localization.Resource.MemberInfo_Pop_35 + "\n" + Localization.Resource.MemberInfo_Pop_36, 330);
                                alert.ShowDialog();
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                SysLog.Error("Message[{0}], StackTrace[{1}]", ex.Message, ex.StackTrace);
            }
        }
示例#28
0
        public void CmdKYCAuth()
        {
            try
            {
                if (otpYn.Equals("Y"))
                {
                    if (string.IsNullOrWhiteSpace(MainViewModel.LoginDataModel.otpNo))
                    {
                        alert = new Alert(Localization.Resource.CertifyMyPage_Alert_8);
                        alert.ShowDialog();
                        return;
                    }
                }

                if (string.IsNullOrWhiteSpace(sFileName1) || string.IsNullOrWhiteSpace(sFileName2))
                {
                    alert = new Alert(Localization.Resource.CertifyMyPage_6_1);
                    alert.ShowDialog();
                    return;
                }
                else
                {
                    IsBusy = true;

                    using (RequestKYCAuthModel req = new RequestKYCAuthModel())
                    {
                        req.userEmail = MainViewModel.LoginDataModel.userEmail;
                        req.fileSn    = "1";

                        using (ResponseKYCAuthModel res = WebApiLib.UpLoad <ResponseKYCAuthModel, RequestKYCAuthModel>(req, sFileName1))
                        {
                            if (res.resultStrCode == "000")
                            {
                                using (RequestKYCAuthModel req2 = new RequestKYCAuthModel())
                                {
                                    if (res.resultStrCode == "000")
                                    {
                                        req2.userEmail = MainViewModel.LoginDataModel.userEmail;
                                        req2.fileSn    = "2";

                                        using (ResponseKYCAuthModel res2 = WebApiLib.UpLoad <ResponseKYCAuthModel, RequestKYCAuthModel>(req2, sFileName2))
                                        {
                                            if (res2.resultStrCode == "000")
                                            {
                                                try
                                                {
                                                    using (RequestUserCertModel req3 = new RequestUserCertModel())
                                                    {
                                                        req3.userEmail = MainViewModel.LoginDataModel.userEmail;
                                                        req3.kycCertYn = "3";

                                                        using (ResponseUserCertModel res3 = WebApiLib.SyncCall <ResponseUserCertModel, RequestUserCertModel>(req3))
                                                        {
                                                            if (res3.resultStrCode == "000")
                                                            {
                                                                alert = new Alert(Localization.Resource.CertifyMyPage_6_2);
                                                                alert.ShowDialog();

                                                                AuthEnabled         = false;
                                                                AuthVisible         = Visibility.Collapsed;
                                                                btn_kyc_cert_status = sLanguage + "btn_manager_checking.png";
                                                                MainViewModel.LoginDataModel.kycStatus = "3";

                                                                IsBusy = false;
                                                            }
                                                        }
                                                    }
                                                }
                                                catch (Exception ex)
                                                {
                                                    SysLog.Error("Message[{0}], StackTrace[{1}]", ex.Message, ex.StackTrace);
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                SysLog.Error("Message[{0}], StackTrace[{1}]", ex.Message, ex.StackTrace);
                alert = new Alert(Localization.Resource.CertifyMyPage_Alert_7, 300);
                alert.ShowDialog();
            }
            finally
            {
                IsBusy = false;
            }
        }
示例#29
0
        public void GetAsset()
        {
            try
            {
                TotAsset     = 0;
                coinTotAsset = 0;

                AssetValue  = new ObservableCollection <ResponseMainAssetListModel>();
                AssetHeight = 53;

                string CommonFloat = "n0";

                foreach (ResponseMainAssetListModel item in MainViewModel.Asset)
                {
                    if (item.trLimtAmt > 0)
                    {
                        item.trLimtColor = "Red";
                    }
                    else
                    {
                        item.trLimtColor = "Black";
                    }

                    if (item.curcyCd.Equals(StringEnum.GetStringValue(EnumLib.ExchangeCurrencyCode.KRW)))
                    {
                        item.curcyNm = CommonLib.StandardCurcyNm;

                        CommonFloat = "n" + MainViewModel.CoinData.CashDecimal;

                        item.posCn           = item.posCnPrc.ToString(CommonFloat);
                        item.impCn           = item.impCnPrc.ToString(CommonFloat);
                        item.totCn           = item.kwdPrc.ToString(CommonFloat);
                        item.trustCn         = item.trustPrc.ToString(CommonFloat);
                        item.trLimtCn        = item.trLimtAmt.ToString(CommonFloat);
                        UsdAsset             = item;
                        TotAsset            += UsdAsset.kwdPrc;
                        item.ExchangeVisible = System.Windows.Visibility.Collapsed;
                    }
                    else
                    {
                        item.curcyNm = StringEnum.ToEnum <EnumLib.ExchangeCurrencyCode>(item.curcyCd).ToString();

                        //ResponseCoinListModel cl = MainViewModel.CoinData.list.Where(w => w.CoinCode == item.curcyCd).FirstOrDefault();
                        CommonFloat = "n0";

                        coinTotAsset  = item.kwdPrc;
                        TotAsset     += item.kwdPrc;
                        item.posCn    = item.posCnAmt.ToString("#,0.00000000");
                        item.impCn    = item.impCnAmt.ToString("#,0.00000000");
                        item.totCn    = item.totCoinAmt.ToString("#,0.00000000");
                        item.trustCn  = item.trustAmt.ToString("#,0.00000000");
                        item.trLimtCn = item.trLimtAmt.ToString("#,0.00000000");

                        if (item.posCnPrc > 0)
                        {
                            item.posExchange = "( " + "≈" + item.posCnPrc.ToString(CommonFloat) + " " + CommonLib.StandardCurcyNm + ")";
                        }
                        else
                        {
                            item.posExchange = "( " + item.posCnPrc.ToString(CommonFloat) + " " + CommonLib.StandardCurcyNm + ")";
                        }
                        if (item.impCnPrc > 0)
                        {
                            item.impExchange = "( " + "≈" + item.impCnPrc.ToString(CommonFloat) + " " + CommonLib.StandardCurcyNm + ")";
                        }
                        else
                        {
                            item.impExchange = "( " + item.impCnPrc.ToString(CommonFloat) + " " + CommonLib.StandardCurcyNm + ")";
                        }
                        if (item.kwdPrc > 0)
                        {
                            item.totExchange = "( " + "≈" + item.kwdPrc.ToString(CommonFloat) + " " + CommonLib.StandardCurcyNm + ")";
                        }
                        else
                        {
                            item.totExchange = "( " + item.kwdPrc.ToString(CommonFloat) + " " + CommonLib.StandardCurcyNm + ")";
                        }

                        if (item.trustPrc > 0)
                        {
                            item.trustExchange = "( " + "≈" + item.trustPrc.ToString(CommonFloat) + " " + CommonLib.StandardCurcyNm + ")";
                        }
                        else
                        {
                            item.trustExchange = "( " + item.trustPrc.ToString(CommonFloat) + " " + CommonLib.StandardCurcyNm + ")";
                        }

                        item.ExchangeVisible = System.Windows.Visibility.Visible;
                    }

                    AssetValue.Add(item);
                    AssetHeight += 35;
                }
            }
            catch (Exception ex)
            {
                SysLog.Error("Message[{0}], StackTrace[{1}]", ex.Message, ex.StackTrace);
            }
        }
示例#30
0
        public async void CmdSubmit()
        {
            try
            {
                if (SmsComplete == Visibility.Visible)
                {
                    IsBusy = true;

                    int PeriodTime = 0;
                    if (Sel.Value.Equals(1))
                    {
                        if (radioDayChecked)
                        {
                            PeriodTime = SelDay.Value * 24;
                        }
                        else if (radioTimeChecked)
                        {
                            PeriodTime = SelTime.Value;
                        }
                    }
                    else
                    {
                        PeriodTime = 87600;
                    }

                    if (PeriodTime.Equals(0))
                    {
                        alert = new Alert(Localization.Resource.IP_Registration_4_18);
                        alert.ShowDialog();
                        return;
                    }

                    //아이피 등록
                    using (RequestIpRegModel req = new RequestIpRegModel())
                    {
                        req.userEmail = userEmail;
                        req.ip        = IP;
                        req.limtHr    = PeriodTime;
                        using (ResponseIpRegModel res = await WebApiLib.AsyncCall <ResponseIpRegModel, RequestIpRegModel>(req))
                        {
                            SubmitCheck = true;
                            WindowService.Close();

                            NoticePopup note = new NoticePopup(NoticePopup.KindNotice.HTS_IP_CHECK_2);
                            note.Title = Localization.Resource.NoticePopup_3;
                            note.ShowDialog();

                            IsBusy = false;
                        }
                    }
                }
                else
                {
                    Alert alert = new Alert(Localization.Resource.IP_Registration_4_15, 320);
                    alert.ShowDialog();
                    return;
                }
            }
            catch (Exception ex)
            {
                SysLog.Error("Message[{0}], StackTrace[{1}]", ex.Message, ex.StackTrace);
            }
            finally
            {
                IsBusy = false;
            }
        }