Esempio n. 1
0
        public List <TickerInfo> getAllTicker()
        {
            List <TickerInfo> result = new List <TickerInfo>();
            string            query  = "select * from tbl_VeThang";

            try
            {
                openketnoi();
                SqlCommand    cmd    = new SqlCommand(query, con);
                SqlDataReader reader = cmd.ExecuteReader();
                // loi get du lieu
                while (reader.Read())
                {
                    var tmpTickerInfo = new TickerInfo();

                    tmpTickerInfo.tickerId = reader.GetString(0);
                    tmpTickerInfo.bienso   = reader.GetString(1);
                    tmpTickerInfo.username = reader.GetString(2);
                    tmpTickerInfo.cmnd     = reader.GetString(3);
                    tmpTickerInfo.type     = Convert.ToInt32(reader.GetValue(4));
                    tmpTickerInfo.isActive = Convert.ToInt32(reader.GetValue(5));
                    tmpTickerInfo.deadline = reader.GetString(6);
                    result.Add(tmpTickerInfo);
                }
                dongketnoi();
            }
            catch (Exception e)
            {
                dongketnoi();
            }
            return(result);
        }
        /// <summary>
        /// Sets a new ticker message
        /// </summary>
        public void setTicker(byte colour, int idx, int timer, string message, Action expireCallback)
        {       //Set the new ticker
            TickerInfo ticker = _tickers[idx] = new TickerInfo(message, timer, idx, colour, expireCallback, null);

            //Relay the change
            Helpers.Arena_Message(Players, ticker);
        }
Esempio n. 3
0
    protected void imgSaveTicker_Click(object sender, ImageClickEventArgs e)
    {
        try
        {
            TickerInfo objInf = new TickerInfo();
            if (Session["EdTickerID"] != null && Session["EdTickerID"].ToString() != string.Empty)
            {
                objInf.TickerID = Convert.ToInt32(Session["EdTickerID"].ToString());
                Session.Contents.Clear();
            }
            else
            {
                objInf.TickerID = 0;
            }
            objInf.TickerNews = txtTickerNews.Content;
            objInf.StartDate  = Convert.ToDateTime(txtStartDate.Text);
            objInf.EndDate    = Convert.ToDateTime(txtEndDate.Text);
            objInf.IsActive   = chkTickerIsActive.Checked;
            objInf.PortalID   = GetPortalID;
            objInf.StoreID    = GetStoreID;
            objInf.AddedBy    = GetUsername;
            objInf.UpdatedBy  = GetUsername;
            TickerController objC = new TickerController();
            objC.SaveTickerItem(objInf);

            LoadOngdvTickerData(GetStoreID, GetPortalID);

            divVisibility(true, false, true);
        }
        catch (Exception ex)
        {
            ProcessException(ex);
        }
        ShowMessage(SageMessageTitle.Information.ToString(), SageMessage.GetSageModuleLocalMessageByVertualPath("Modules/Ticker/ModuleLocalText", "TickerSavedSuccessFully"), "", SageMessageType.Success);
    }
 public Container2(SolveAndStoreOD_2T solveAndStoreOD, ChainInfo chainInfo, TickerInfo tickerInfo)
 {
     SolveAndStoreOD = solveAndStoreOD;
     ChainInfo       = chainInfo;
     TickerInfo      = tickerInfo;
     //FT[] _FTColl = { _fT_CN, _fT_CU };
 }
        public void reqHistDataIfValid(DateTime current, String whatToShow, Contract contract)
        {
            DateTime rtbDataStartTime = appMDManager.getRtbDataStartTime();
            //DateTime histDataEndTime = rtbDataStartTime.AddMinutes(-1);
            DateTime histReqProcessTime = rtbDataStartTime.AddSeconds(30);

            //appMDManager.setHistDataEndTime(histDataEndTime);
            if (current >= histReqProcessTime && isReqHistDataSent == false && needMergeFlag)
            {
                //string whatToShow = parentUI.GetWTS();
                string strEndTime = String.Format("{0:yyyyMMdd HH:mm:ss}", rtbDataStartTime) + " HKT";
                string duration   = "1 D";
                string barSize    = "1 min";
                int    outsideRTH = 1; //use regular trading hour

                IIBTradeAppBridge parentUI = appMDManager.getParentUI();
                TickerInfo        info     = appMDManager.tickerInfo;

                //*** 2015-12-09 big change***
                //parentUI.addHistDataRequest(contract, strEndTime, duration, barSize, info.whatToShow, 1);
                parentUI.addHistDataRequest(contract, strEndTime, duration, barSize, whatToShow, 1);
                isReqHistDataSent = true;
                isReqHistDataSent = true;
            }
        }
Esempio n. 6
0
        private void btnChinhsua_Click(object sender, EventArgs e)
        {
            TickerInfo tickerInfo = new TickerInfo();
            String     id         = txtId.Text;

            tickerInfo.tickerId = tickersListView.Rows[Index].Cells[0].Value.ToString();
            tickerInfo.bienso   = this.txtBienso.Text;
            tickerInfo.username = this.txtName.Text;
            tickerInfo.cmnd     = this.txtCmnd.Text;
            int type = 1;

            if (cbxType.Text != "Vé Tháng")
            {
                type = 0;
            }
            tickerInfo.type = type;

            int isActive = 0;

            if (cbxIsActive.Text == "Đang hoạt động")
            {
                isActive = 1;
            }
            tickerInfo.isActive = isActive;
            tickerInfo.deadline = dateDeadline.Value.ToShortDateString();
            tickersManagerInstance.updateTicker(tickerInfo, id);
        }
Esempio n. 7
0
        private void btnXoa_Click(object sender, EventArgs e)
        {
            TickerInfo tickerInfo = new TickerInfo();

            tickerInfo.tickerId = tickersListView.Rows[Index].Cells[0].Value.ToString();
            tickersManagerInstance.removeTicker(tickerInfo);
        }
Esempio n. 8
0
        private void btnThem_Click(object sender, EventArgs e)
        {
            // MessageBox.Show(dateDeadline.Value.ToLongTimeString());
            TickerInfo tickerInfo = new TickerInfo();

            tickerInfo.tickerId = this.txtId.Text;
            tickerInfo.bienso   = this.txtBienso.Text;
            tickerInfo.username = this.txtName.Text;
            tickerInfo.cmnd     = this.txtCmnd.Text;

            tickerInfo.deadline = dateDeadline.Value.ToShortDateString();
            //Convert.ToInt32(((DateTimeOffset)dateDeadline.Value.Date).ToUnixTimeSeconds());
            int type = 1;

            if (cbxType.Text != "Vé Tháng")
            {
                type = 0;
            }
            tickerInfo.type = type;

            int isActive = 0;

            if (cbxIsActive.Text == "Đang hoạt động")
            {
                isActive = 1;
            }
            tickerInfo.isActive = isActive;
            tickersManagerInstance.addTicker(tickerInfo);
        }
Esempio n. 9
0
        public async Task <NodeDataHolderDetailedModel> Get([SwaggerParameter("The ERC 725 identity for the node", Required = true)] string nodeId)
        {
            TickerInfo tickerInfo = await TickerHelper.GetTickerInfo(_cache);

            await using (var connection =
                             new MySqlConnection(OTHubSettings.Instance.MariaDB.ConnectionString))
            {
                var profile = await connection.QueryFirstOrDefaultAsync <NodeDataHolderDetailedModel>(DataHolderSql.GetDetailed, new { nodeId = nodeId,
                                                                                                                                       userID = User?.Identity?.Name });

                if (profile != null)
                {
                    profile.Identities = (await connection.QueryAsync <NodeDetailedIdentity>(
                                              @"SELECT i.Identity, bc.DisplayName BlockchainName, i.Stake, i.StakeReserved FROM otidentity i
JOIN blockchains bc ON bc.id = i.blockchainid
WHERE i.NodeId = @NodeId", new
                    {
                        nodeId = nodeId
                    })).ToArray();

                    profile.LiveTracUSDPrice = tickerInfo?.PriceUsd;
                }

                return(profile);
            }
        }
Esempio n. 10
0
 private static void OnUSDBTCPChanged(Object tickerObject, EventArgs e)
 {
     lock (lockTicket)
     {
         ticker = (tickerObject as TickerInfo);
     }
 }
Esempio n. 11
0
 public bool deleteTicker(TickerInfo tickerInfo)
 {
     try
     {
         openketnoi();
         string     Delete = "delete tbl_VeThang from tbl_VeThang where id = '" + tickerInfo.tickerId + "'";
         SqlCommand cmd    = new SqlCommand(Delete, con);
         int        result = cmd.ExecuteNonQuery();
         dongketnoi();
         if (result == 1)
         {
             MessageBox.Show("Xóa thành công");
             return(true);
         }
         else
         {
             return(false);
         }
     }
     catch
     {
         MessageBox.Show("Lỗi xóa vé xe");
         return(false);
     }
 }
Esempio n. 12
0
 public bool addInfoTicker(TickerInfo tickerInfo)
 {
     try
     {
         openketnoi();
         string Add = "insert into tbl_VeThang values(" +
                      "'" + tickerInfo.tickerId + "'," +
                      "'" + tickerInfo.bienso + "'" +
                      ",N'" + tickerInfo.username + "'," +
                      "'" + tickerInfo.cmnd + "'," +
                      "" + tickerInfo.type + "," +
                      "" + tickerInfo.isActive + "," +
                      "'" + tickerInfo.deadline + "')";
         SqlCommand cmd    = new SqlCommand(Add, con);
         int        result = cmd.ExecuteNonQuery();
         dongketnoi();
         if (result == 1)
         {
             MessageBox.Show("Thêm vé thành công");
             return(true);
         }
         else
         {
             return(false);
         }
     }
     catch (Exception e)
     {
         MessageBox.Show("Lỗi thêm vé xe");
         return(false);
     }
 }
        public async void TickerInfo001()
        {
            TickerInfo            tickerInfo = new TickerInfo();
            blockChainInfo_ticker r          = await tickerInfo.GetAsync();

            r.USD.symbol.Should()
            .Be("$");
        }
Esempio n. 14
0
 private static void OnUSDBTCPChanged2(Object tickerObject, EventArgs e)
 {
     lock (lockTicket)
     {
         ticker = (tickerObject as TickerInfo);
         Console.WriteLine("New Price: " + ticker);
         logger.Debug(ticker);
     }
 }
Esempio n. 15
0
        private void initTickerInfo()
        {
            cmb_ticker_profile.Items.Add(AppConstant.TICK1_NAME);
            cmb_ticker_profile.Items.Add(AppConstant.TICK2_NAME);
            cmb_ticker_profile.SelectedItem = AppConstant.TICK1_NAME;
            TickerInfo info = genTickerInfo(1);

            setTickerInfo(info);
        }
Esempio n. 16
0
        public static async Task <TickerInfo> GetTickerInfo(IMemoryCache cache)
        {
            //This stops us spamming the API on failures
            if (_lastFailTime.HasValue && (DateTime.Now - _lastFailTime.Value).TotalMinutes <= 45)
            {
                if (_lastKnownInfo != null)
                {
                    return(_lastKnownInfo);
                }
            }

            if (!cache.TryGetValue("HomeV3Ticker", out object tickerModel))
            {
                bool success = await _lock.WaitAsync(TimeSpan.FromSeconds(1));

                if (!success)
                {
                    return(null);
                }
                try
                {
                    if (!cache.TryGetValue("HomeV3Ticker", out tickerModel))
                    {
                        CoinpaprikaAPI.Client client = new CoinpaprikaAPI.Client();
                        throw new Exception();

                        tickerModel = (await client.GetTickerForIdAsync(@"trac-origintrail")).Value;

                        cache.Set("HomeV3Ticker", tickerModel, TimeSpan.FromMinutes(3));
                        _lastFailTime = null;
                    }
                }
                catch (Exception)
                {
                    _lastFailTime = DateTime.Now;

                    if (_lastKnownInfo != null)
                    {
                        return(_lastKnownInfo);
                    }

                    return(null);
                }
                finally
                {
                    _lock.Release();
                }
            }

            var tickerInfo = _lastKnownInfo = (TickerInfo)tickerModel;

            return(tickerInfo);
        }
Esempio n. 17
0
 public void setTickerInfo(TickerInfo info)
 {
     txt_ticker_id.Text           = info.tickerID;
     txt_ticker_contract_id.Text  = info.contractID;
     txt_ticker_symbol.Text       = info.symbol;
     txt_ticker_type.Text         = info.type;
     txt_ticker_exch.Text         = info.exchange;
     txt_ticker_p_exch.Text       = info.pExchange;
     txt_ticker_curr.Text         = info.currency;
     txt_ticker_local_symb.Text   = info.lSymbol;
     txt_ticker_wts.Text          = info.whatToShow;
     txt_ticker_startTime.Text    = info.startTime;
     txt_ticker_lunchEndTime.Text = info.lunchEndTime;
     txt_ticker_endTime.Text      = info.endTime;
 }
Esempio n. 18
0
        public void test_checkIsRTBarMergeNeed_negative2()
        {
            //[Test: non-initial and negative case, initFlag is true and isRTBarMergeNeed is false => initFlag is true, getIsRTBarMergeNeed is false]
            IAppRTBSynchronizer synchronizer = getSyn_checkIsRTBarMergeNeed();
            AppMDManager        appMDManager = new AppMDManager(null);

            appMDManager.injectRTBInitFlag(true);
            TickerInfo info = new TickerInfo();

            info.startTime = "false";
            appMDManager.injectAppRTBSynchronizer(synchronizer);
            appMDManager.tickerInfo = info;
            appMDManager.checkIsRTBarMergeNeed();
            Assert.IsTrue(appMDManager.getRTBInitFlag());
            Assert.IsFalse(appMDManager.getIsRTBarMergeNeed());
        }
Esempio n. 19
0
        public void SaveTickerItem(TickerInfo objInf)
        {
            List <KeyValuePair <string, object> > Parameter = new List <KeyValuePair <string, object> >();

            Parameter.Add(new KeyValuePair <string, object>("@TickerNews", objInf.TickerNews));
            Parameter.Add(new KeyValuePair <string, object>("@StartDate", objInf.StartDate));
            Parameter.Add(new KeyValuePair <string, object>("@EndDate", objInf.EndDate));
            Parameter.Add(new KeyValuePair <string, object>("@AddedBy", objInf.AddedBy));
            Parameter.Add(new KeyValuePair <string, object>("@UpdatedBy", objInf.UpdatedBy));
            Parameter.Add(new KeyValuePair <string, object>("@PortalID", objInf.PortalID));
            Parameter.Add(new KeyValuePair <string, object>("@StoreID", objInf.StoreID));
            Parameter.Add(new KeyValuePair <string, object>("@IsActive", objInf.IsActive));
            Parameter.Add(new KeyValuePair <string, object>("@TickerID", objInf.TickerID));
            SQLHandler sqlH = new SQLHandler();

            sqlH.ExecuteNonQuery("usp_TickerSaveItem", Parameter);
        }
Esempio n. 20
0
        private TickerInfo getTickerInfo()
        {
            TickerInfo info = new TickerInfo();

            info.tickerID     = "";
            info.contractID   = "";
            info.symbol       = "HSI";
            info.type         = "FUT";
            info.exchange     = "HKFE";
            info.pExchange    = "";
            info.currency     = "HKD";
            info.lSymbol      = "HSIZ15";
            info.whatToShow   = "TRADES";
            info.startTime    = "09:15:00";
            info.lunchEndTime = "13:00:00";
            return(info);
        }
Esempio n. 21
0
        public static TickerInfo RetrieveTickerData()
        {
            var currentTicker = new TickerInfo();

            HtmlWeb      web = new HtmlWeb();
            HtmlDocument doc = new HtmlDocument();

            doc = web.Load("https://finance.yahoo.com");
            HtmlNodeCollection tickerNodes = doc.DocumentNode.SelectNodes("//span[@class='Trsdu(0.3s) Fz(s) Mt(4px) Mb(0px) Fw(b) D(ib)']");

            currentTicker.DatePulled  = DateTime.UtcNow;
            currentTicker.SPValue     = tickerNodes[0].InnerHtml.ToString();
            currentTicker.DowValue    = tickerNodes[1].InnerHtml.ToString();
            currentTicker.NasdaqValue = tickerNodes[2].InnerHtml.ToString();

            return(currentTicker);
        }
Esempio n. 22
0
        private void cmb_ticker_profile_SelectedIndexChanged(object sender, EventArgs e)
        {
            String selectedProfile = cmb_ticker_profile.GetItemText(cmb_ticker_profile.SelectedItem);
            int    profileIndex    = 0;

            if (AppConstant.TICK1_NAME.Equals(selectedProfile))
            {
                profileIndex = 1;
            }
            if (AppConstant.TICK2_NAME.Equals(selectedProfile))
            {
                profileIndex = 2;
            }
            TickerInfo info = genTickerInfo(profileIndex);

            setTickerInfo(info);
        }
Esempio n. 23
0
        public TickerInfo getTickerInfo()
        {
            TickerInfo info = new TickerInfo();

            info.tickerID     = txt_ticker_id.Text;
            info.contractID   = txt_ticker_contract_id.Text;
            info.symbol       = txt_ticker_symbol.Text;
            info.type         = txt_ticker_type.Text;
            info.exchange     = txt_ticker_exch.Text;
            info.pExchange    = txt_ticker_p_exch.Text;
            info.currency     = txt_ticker_curr.Text;
            info.lSymbol      = txt_ticker_local_symb.Text;
            info.whatToShow   = txt_ticker_wts.Text;
            info.startTime    = txt_ticker_startTime.Text;
            info.lunchEndTime = txt_ticker_lunchEndTime.Text;
            info.endTime      = txt_ticker_endTime.Text;
            return(info);
        }
Esempio n. 24
0
        public void handleResetRTBRequest(AppTimeEvent timeEvent)
        {
            //Contract contract = stgManager.CurrentContract;
            Contract contract = stgManager.ParentUI.GetMDContract();
            IRealTimeBarsManagerBridge RTBManager = stgManager.ParentUI.getRealTimeBarsManager();

            if (contract == null)
            {
                return;
            }
            if (RTBManager == null)
            {
                return;
            }

            TickerInfo tickerInfo     = stgManager.ParentUI.getTickerInfo();
            String     strStartTime   = String.Format("{0:yyyyMMdd}", timeEvent.eventTime) + "  " + tickerInfo.startTime;
            DateTime   startTime      = DateTime.ParseExact(strStartTime, "yyyyMMdd  HH:mm:ss", CultureInfo.InvariantCulture, DateTimeStyles.AssumeLocal);
            DateTime   startTime_from = startTime.AddMinutes(-3);
            DateTime   startTime_to   = startTime.AddMinutes(-2);

            if (timeEvent.eventTime > startTime_from && timeEvent.eventTime < startTime_to && !morningTimeRTBReset)
            {
                log.Info("Morning Reset RTBar Start.");
                resetRTBRequest(RTBManager);
                morningTimeRTBReset = true;
                log.Info("Morning Reset RTBar End.");
                return;
            }

            String   strLunchTime   = String.Format("{0:yyyyMMdd}", timeEvent.eventTime) + "  " + tickerInfo.lunchEndTime;
            DateTime lunchTime      = DateTime.ParseExact(strLunchTime, "yyyyMMdd  HH:mm:ss", CultureInfo.InvariantCulture, DateTimeStyles.AssumeLocal);
            DateTime lunchTime_from = lunchTime.AddMinutes(-3);
            DateTime lunchTime_to   = lunchTime.AddMinutes(-2);

            if (timeEvent.eventTime > lunchTime_from && timeEvent.eventTime < lunchTime_to && !lunchTimeRTBReset)
            {
                log.Info("Lunch Reset RTBar Start.");
                resetRTBRequest(RTBManager);
                lunchTimeRTBReset = true;
                log.Info("Lunch Reset RTBar End.");
                return;
            }
        }
Esempio n. 25
0
        public TickerInfo ticker(string id, string biensoVao)
        {
            TickerInfo ticker = new TickerInfo();
            string     query  = "select * from tbl_VeThang where id = '" + id + "'";

            try
            {
                openketnoi();
                SqlCommand    cmd    = new SqlCommand(query, con);
                SqlDataReader reader = cmd.ExecuteReader();
                reader.Read();
                string biensoDK = reader["bienso"].ToString();
                if (biensoDK != null && biensoDK != "")
                {
                    if (biensoDK == biensoVao)
                    {
                        ticker.tickerId = reader["id"].ToString();
                        ticker.bienso   = biensoDK;
                        ticker.type     = int.Parse(reader["type"].ToString());
                        //ticker.userName = username;
                        //userInfo.role = int.Parse(reader["role"].ToString());
                        //userInfo.isActive = int.Parse(reader["isActive"].ToString());
                        TickerInforManager updateTickerInfo = TickerInforManager.getTickerInfoManagerInstance();
                        updateTickerInfo.updateTickerInfo(ticker);
                    }
                    else
                    {
                        MessageBox.Show("Biển số không khớp với biển số đăng ký");
                    }
                }
                else
                {
                    MessageBox.Show("ID Thẻ không tồn tại");
                }
                dongketnoi();
            }
            // Mã thẻ sai
            catch
            {
                dongketnoi();
                // MessageBox.Show("ID Thẻ không tồn tại");
            }
            return(ticker);
        }
Esempio n. 26
0
        public void handleDailyDayEndExport(AppTimeEvent timeEvent)
        {
            TickerInfo tickerInfo = stgManager.ParentUI.getTickerInfo();
            String     strEndTime = String.Format("{0:yyyyMMdd}", timeEvent.eventTime) + "  " + tickerInfo.endTime;
            //String strEndTime = String.Format("{0:yyyyMMdd}", timeEvent.eventTime) + "  " + "16:15:00";
            DateTime endTime      = DateTime.ParseExact(strEndTime, "yyyyMMdd  HH:mm:ss", CultureInfo.InvariantCulture, DateTimeStyles.AssumeLocal);
            DateTime endTime_from = endTime.AddMinutes(+2);
            DateTime endTime_to   = endTime.AddMinutes(+3);

            if (timeEvent.eventTime > endTime_from && timeEvent.eventTime < endTime_to && !dailyDayEndExport)
            {
                log.Info("Daily Dayend Export Report Start.");
                //
                stgManager.dailyDayEndExport();
                dailyDayEndExport = true;
                log.Info("Daily Dayend Export Report End.");
                return;
            }
        }
Esempio n. 27
0
        private void BtnFillClick(object sender, EventArgs e)
        {
            if (workerForexite.IsBusy)
            {
                workerForexite.CancelAsync();
                return;
            }

            var names      = tbTickers.Text.Split(new [] { ' ', (char)9, ',', ';' }, StringSplitOptions.RemoveEmptyEntries);
            var allTickers = TickerInfo.GetTickers();
            var tickers    = allTickers.Where(t => names.Contains(t.Title)).ToList();

            if (tickers.Count == 0)
            {
                return;
            }
            FillHistoryForexiteAsync(tickers);
            btnFill.Text = "Остановить";
        }
Esempio n. 28
0
        private void InitCanImportList()
        {
            string xmlFile = null;

            // SEC companies
            xmlFile = Resources.BLSIndicatorsList;
            XmlDocument docCompanies = new XmlDocument();

            docCompanies.LoadXml(xmlFile);

            XmlNodeList xnList = docCompanies.SelectNodes("/indicators/indicator");

            foreach (XmlNode v in xnList)
            {
                TickerInfo ti = new TickerInfo();
                ti.Ticker_Symbol = v.Attributes["ticker_symbol"].Value.ToUpper();
                ti.Bls_Code      = v.Attributes["bls_code"].Value.ToUpper();
                ti.Ticker_Name   = v.Attributes["name"].Value;
                ti.Metadata      = new Dictionary <string, string>();

                string   txtMetadata = v.Attributes["metadata"].Value;
                string[] values      = txtMetadata.Split(new char[] { ';' });
                foreach (var pair in values)
                {
                    if (!string.IsNullOrEmpty(pair.Trim()))
                    {
                        string[] kv = pair.Split(new char[] { '=' });
                        if (kv.Count() >= 2)
                        {
                            string key   = kv[0];
                            string value = kv[1];
                            if (!ti.Metadata.ContainsKey(key))
                            {
                                ti.Metadata.Add(key, value);
                            }
                        }
                    }
                }

                _tickers.Add(ti.Ticker_Symbol, ti);
            }
        }
Esempio n. 29
0
    public void EditTickerByID(int TickerID)
    {
        try
        {
            TickerInfo       obj  = new TickerInfo();
            TickerController objC = new TickerController();
            obj                       = objC.getTickerObject(TickerID);
            txtEndDate.Text           = Convert.ToString(obj.EndDate);
            txtStartDate.Text         = Convert.ToString(obj.StartDate);
            txtTickerNews.Content     = obj.TickerNews;
            chkTickerIsActive.Checked = obj.IsActive;

            divVisibility(false, true, false);
            Session["EdTickerID"] = TickerID;
        }
        catch (Exception ex)
        {
            ProcessException(ex);
        }
    }
Esempio n. 30
0
 public bool updateInfoTicker(TickerInfo tickerInfo, String id)
 {
     try
     {
         if (tickerInfo.tickerId == null)
         {
             MessageBox.Show("Chưa chọn vé để cập nhật");
         }
         else
         {
             openketnoi();
             string Update = "update tbl_VeThang " +
                             "set bienso ='" + tickerInfo.bienso + "'," +
                             "id = '" + id + "'," +
                             "username = N'" + tickerInfo.username + "'," +
                             " cmnd = '" + tickerInfo.cmnd + "'," +
                             " type = '" + tickerInfo.type + "'," +
                             "isActive ='" + tickerInfo.isActive + "'," +
                             "ngayhethan = '" + tickerInfo.deadline + "'" +
                             "where id = '" + tickerInfo.tickerId + "'";
             SqlCommand cmd    = new SqlCommand(Update, con);
             int        result = cmd.ExecuteNonQuery();
             dongketnoi();
             if (result == 1)
             {
                 MessageBox.Show("Cập nhật vé thành công");
                 return(true);
             }
             else
             {
                 return(false);
             }
         }
     }
     catch
     {
         MessageBox.Show("Lỗi cập nhật vé xe");
         return(false);
     }
     return(true);
 }