private void QuotationDataProcessor(int Symbol, QuotationData Quotation) { mLock.Lock(); mLock.Unlock(); mDatas[Symbol].Copy(Quotation); mFaultTolerance[Symbol] = true; }
private void Save_Click(object sender, RoutedEventArgs e) { using (SqlConnection connection = new SqlConnection(Database.ConnectionString)) { connection.Update(newQuotationData); } QuotationData.Update(newQuotationData); this.Close(); }
protected void PopupModels(object sender, EventArgs e) { QuotationData qd = new QuotationData(); qd.Brand = ddlBrand.SelectedItem.Text; List <QuotationData> list = bi.getModels(qd); ddlModel.Items.Clear(); ddlModel.Items.Add(new ListItem("Select Model", "0")); foreach (var item in list) { ddlModel.Items.Add(new ListItem(item.Model, item.QDid.ToString())); } }
public static void PushQuotationDataInHub(int Symbol, QuotationData Quotation) { SymbolData CurData = mDatas[Symbol]; CurData.mLock.Lock(); CurData.mBase.Copy(Quotation.Base); CurData.mCrossQuotes.Copy(Quotation.CrossQuotes); StatisticsStatus Statistics = new StatisticsStatus(); Statistics.Copy(Quotation.Statistics); CurData.mStatistics.Add(Statistics); CurData.mLock.Unlock(); }
protected void DisplayPrice(object sender, EventArgs e) { QuotationData qd = new QuotationData(); if (rbTwoWheeler.Checked) { qd.VehicleType = "two wheeler"; } else { qd.VehicleType = "four wheeler"; } qd.Brand = ddlBrand.SelectedItem.Text; qd.Model = ddlModel.SelectedItem.Text; Label4.Text = bi.getPrice(qd).ToString(); }
public ActionResult QuotationContent(string customer, string manufacturer, string keywords, int staff_Id, string helper, DateTime startDate, DateTime endDate) { if (Request.IsAjaxRequest()) { QuotationData data = new QuotationData(); var results = data.GetSpecificWordGroup(customer, manufacturer, keywords, staff_Id, helper, startDate, endDate); if (results.Count() == 0) { return(PartialView("_NoResult")); } else { return(PartialView("_ReadableQuotationContent", results)); } } return(Content("Ajax通信以外のアクセスはできません")); }
public double getPrice(QuotationData qd) { SqlCommand cmd = dbc.getSqlCommand("GetPrice"); SqlParameter p1 = cmd.Parameters.AddWithValue("@v_type", qd.VehicleType); SqlParameter p2 = cmd.Parameters.AddWithValue("@brand", qd.Brand); SqlParameter p3 = cmd.Parameters.AddWithValue("@model", qd.Model); dbc.con.Open(); SqlDataReader reader = cmd.ExecuteReader(); while (reader.Read()) { QuotationData QDobj = new QuotationData(); qd.ExShowroomPrice = Convert.ToDouble(reader.GetValue(0)); } reader.Close(); dbc.con.Close(); return(qd.ExShowroomPrice); }
public List <QuotationData> getBrandNames(QuotationData qd) { SqlCommand cmd = dbc.getSqlCommand("GetBrands"); SqlParameter p1 = cmd.Parameters.AddWithValue("@v_type", qd.VehicleType); dbc.con.Open(); SqlDataReader reader = cmd.ExecuteReader(); List <QuotationData> list = new List <QuotationData>(); while (reader.Read()) { QuotationData QDobj = new QuotationData(); QDobj.QDid = Convert.ToInt32(reader.GetValue(0)); QDobj.Brand = reader.GetValue(1).ToString(); list.Add(QDobj); } reader.Close(); dbc.con.Close(); return(list); }
public bool ParseQuotationData(String Message, ref QuotationData Quotation) { String[] SubMessage = Message.Split(new char[] { ',' }); if (SubMessage.Length != 66 || SubMessage[8] != "PZ") { return(false); } Quotation.TradingTime = SubMessage[2] + " " + SubMessage[1]; Quotation.Base.LastClose = (float)Convert.ToDouble(SubMessage[3]); Quotation.Base.OpenPrice = (float)Convert.ToDouble(SubMessage[4]); Quotation.Base.HighPrice = (float)Convert.ToDouble(SubMessage[5]); Quotation.Base.LowPrice = (float)Convert.ToDouble(SubMessage[6]); Quotation.Base.NowPrice = (float)Convert.ToDouble(SubMessage[7]); Quotation.Base.Status = ConvertToTradingStatus(SubMessage[8]); Quotation.Statistics.TransactionCount = Convert.ToInt32(SubMessage[9]); Quotation.Statistics.TotalVolume = Convert.ToInt32(SubMessage[10]) / 100; Quotation.Statistics.TotalAmount = (float)Convert.ToDouble(SubMessage[11]); Quotation.Statistics.CurBidAmount = (float)Convert.ToDouble(SubMessage[12]); Quotation.Statistics.AverBidPrice = (float)Convert.ToDouble(SubMessage[13]); Quotation.Statistics.CurAskAmount = (float)Convert.ToDouble(SubMessage[14]); Quotation.Statistics.AverAskPrice = (float)Convert.ToDouble(SubMessage[15]); Quotation.Statistics.CancelBidNum = Convert.ToInt32(SubMessage[16]); Quotation.Statistics.CancelBidAmount = (float)Convert.ToDouble(SubMessage[17]); Quotation.Statistics.CancelAskNum = Convert.ToInt32(SubMessage[19]); Quotation.Statistics.CancelAskAmount = (float)Convert.ToDouble(SubMessage[20]); Quotation.Statistics.TotalBidNum = Convert.ToInt32(SubMessage[22]); Quotation.Statistics.TotalAskNum = Convert.ToInt32(SubMessage[23]); for (int i = 0, n = 26; i < 10; ++i, ++n) { Quotation.CrossQuotes.BidPrice[i] = (float)Convert.ToDouble(SubMessage[n]); Quotation.CrossQuotes.BidVolume[i] = Convert.ToInt32(SubMessage[n + 10]) / 100; Quotation.CrossQuotes.AskPrice[i] = (float)Convert.ToDouble(SubMessage[n + 20]); Quotation.CrossQuotes.AskVolume[i] = Convert.ToInt32(SubMessage[n + 30]) / 100; } return(true); }
private void Save_Click(object sender, RoutedEventArgs e) { bool isNull = false; var message = "Please Enter:"; if (newQuotationData.PowerVoltage == null || newQuotationData.PowerVoltage == "") { message += $"\n Power Voltage."; isNull = true; } if (newQuotationData.Phase == null || newQuotationData.Phase == "") { message += $"\n Phase."; isNull = true; } if (newQuotationData.Frequency == null || newQuotationData.Frequency == "") { message += $"\n Frequency."; isNull = true; } if (newQuotationData.NetworkSystem == null || newQuotationData.NetworkSystem == "") { message += $"\n Network System."; isNull = true; } if (newQuotationData.ControlVoltage == null || newQuotationData.ControlVoltage == "") { message += $"\n Control Voltage."; isNull = true; } if (newQuotationData.TinPlating == null || newQuotationData.TinPlating == "") { message += $"\n Tin Plating."; isNull = true; } if (newQuotationData.NeutralSize == null || newQuotationData.NeutralSize == "") { message += $"\n Neutral Size."; isNull = true; } if (newQuotationData.EarthSize == null || newQuotationData.EarthSize == "") { message += $"\n Earth Size."; isNull = true; } if (newQuotationData.EarthingSystem == null || newQuotationData.EarthingSystem == "") { message += $"\n Earthing System."; isNull = true; } if (!isNull) { using (SqlConnection connection = new SqlConnection(Database.ConnectionString)) { connection.Update <Quotation>(newQuotationData); } QuotationData.Update(newQuotationData); if (OpenPanelsWindow) { var panelsWindow = new PanelsWindow() { UserData = this.UserData, QuotationData = this.QuotationData }; this.Close(); panelsWindow.ShowDialog(); } else { this.Cancel_Click(sender, e); } } else { MessageWindow.Show("Error", message, MessageWindowButton.OK, MessageWindowImage.Information); } }
public double getPrice(QuotationData qd) { return(dal.getPrice(qd)); }
public List <QuotationData> getModels(QuotationData qd) { return(dal.getModelNames(qd)); }
public List <QuotationData> getbrand(QuotationData qd) { return(dal.getBrandNames(qd)); }