Ejemplo n.º 1
0
        public JsonResult PingPort(SysCodeModel sysmodel)
        {
            GenericResultModel AccListResult2 = new GenericResultModel();

            AccListResult2.Status  = "SUCESS";
            AccListResult2.Remarks = "SUCESS";
            return(Json(AccListResult2, JsonRequestBehavior.AllowGet));
        }
        private void _viewModel_ContractChanged(object sender, EventArgs e)
        {
            SysCodeModel model = sender as SysCodeModel;

            if (model != null)
            {
                ScrollIntoView(model);
            }
        }
Ejemplo n.º 3
0
 public void ScrollIntoView(SysCodeModel stock)
 {
     if (stock == null || (_mainVM.SelectItemViewModel != null && string.Equals(_mainVM.SelectItemViewModel.ContractCode, stock.SystemName)))
     {
         return;
     }
     if (!TradeQuotesViewModel.GetInstance(null).IsInternationalCheck)
     {
         TradeQuotesViewModel.GetInstance(null).InternationalCheckType = 1;
         TradeQuotesViewModel.GetInstance(null).IsInternationalCheck   = true;
     }
     ContractChanged?.Invoke(stock, EventArgs.Empty);
 }
Ejemplo n.º 4
0
        public JsonResult FetchSystemCodes(SysCodeModel sysmodel)
        {
            string errMessage = string.Empty;

            if (ModelState.IsValid)
            {
                var validation = SecurityController.ValidateToken(sysmodel.TokenCode);
                try
                {
                    if (validation.Validated == true)
                    {
                        var SysListResult = _db.Query <SysCodeDetailModel>(";Exec Supreme_getSystemCodes @SubCodeID", new { SubCodeID = sysmodel.SubCodeID, }).ToList();

                        return(Json(SysListResult, JsonRequestBehavior.AllowGet));
                    }
                    else
                    {
                        GenericResultModel AccListResult2 = new GenericResultModel();
                        AccListResult2.Status  = "Fail";
                        AccListResult2.Remarks = validation.Errors[0].ToString();
                        return(Json(AccListResult2, JsonRequestBehavior.AllowGet));
                    }
                }
                catch (Exception ee)
                {
                    GenericResultModel AccListResult2 = new GenericResultModel();
                    AccListResult2.Status  = "Fail";
                    AccListResult2.Remarks = ee.Message;
                    GeneralService.WriteErrorLog(ref ee);
                    return(Json(AccListResult2, JsonRequestBehavior.AllowGet));
                }
            }
            else
            {
                var message = string.Join(" | ", ModelState.Values
                                          .SelectMany(v => v.Errors)
                                          .Select(e => e.ErrorMessage));

                GenericResultModel AccListResult2 = new GenericResultModel();
                AccListResult2.Status  = "Fail";
                AccListResult2.Remarks = message;
                return(Json(AccListResult2, JsonRequestBehavior.AllowGet));
            }
        }
        public void ScrollIntoView(SysCodeModel stock)
        {
            int i = 0;

            foreach (var item in CommHelper.ContractModelGroupList)
            {
                FuturesViewModel hkexmodel = item.Value.FirstOrDefault(o => string.Equals(o.ContractCode, stock.SystemName));
                if (hkexmodel != null)
                {
                    _viewModel.SelectedIndex = i;
                    TabItem tabItem  = AllFuturesQuota.Items[i] as TabItem;
                    var     dataGrid = (tabItem.Content as QuotesDataGrid).quotesDataGrid;
                    dataGrid.ScrollIntoView(hkexmodel);
                    dataGrid.SelectedItem = hkexmodel;
                    break;
                }
                i++;
            }
        }
Ejemplo n.º 6
0
 public void SetFuturesList()
 {
     foreach (var item in CommHelper.ContractModelGroupList)
     {
         _FuturesViewModelList.AddRange(item.Value);
         for (int i = 0; i < item.Value.Count; i++)
         {
             item.Value[i].Seq = i + 1;
             var SysVarietyCodeName = item.Value[i].ProductCode + " " + item.Value[i].ProductName;
             if (!_mainVM.VarietyList.ContainsKey(SysVarietyCodeName))
             {
                 _mainVM.VarietyList.Add(SysVarietyCodeName, new List <SysCodeModel>());
             }
             SysCodeModel model = new SysCodeModel()
             {
                 SystemName = item.Value[i].ContractCode, SysVarietyCode = item.Value[i].ContractCode
             };
             _mainVM.VarietyList[SysVarietyCodeName].Add(model);
         }
     }
 }