public void SaveStockStatsData(AISTOCK_STOCK_BUY_STATS_DATA data) { using (DaStock da = new DaStock()) { try { da.SaveStockStatsData(data.AISTOCK_STOCK_BUY_STATS); } catch (Exception ex) { throw new CommonException("保存股票信息数据时出错,请联系管理!" + ex.Message); } } }
private void Stats() { StockQueryCondition qc = new StockQueryCondition(); qc.DeserializeFromString(this.ViewState["_StockQueryCondition"].ToString()); AISTOCK_FIELD_DOMAIN_VALUE_DATA buy = new StockSystem().GetDropDownList("buy"); int indexDay = 5; string dateTo = DateTimeFunction.ConvertDate(qc.DatePickerFrom); string date = string.Empty; AISTOCK_STOCK_BUY_STATS_DATA stats = new AISTOCK_STOCK_BUY_STATS_DATA(); AISTOCK_STOCK_BASEINFO_DATA baseData = new StockSystem().GetStockBaseInfoWithoutCondition(); foreach (AISTOCK_FIELD_DOMAIN_VALUE_DATA.AISTOCK_FIELD_DOMAIN_VALUERow row in buy.AISTOCK_FIELD_DOMAIN_VALUE.Rows) { string value = row.FIELD_DOMAIN_VALUE; if (value.Equals("低档五连阳")) { indexDay = 4; date = new StockSystem().GetIndexDay(qc.DatePickerFrom, indexDay); date = DateTimeFunction.ConvertDate(DateTime.Parse(date).ToShortDateString()); AISTOCK_STOCK_LOW_FIVE_V_DATA data = new StockSystem().GetLowFiveData(date, dateTo); foreach (AISTOCK_STOCK_LOW_FIVE_V_DATA.AISTOCK_STOCK_LOW_FIVE_VRow dataRow in data.AISTOCK_STOCK_LOW_FIVE_V.Rows) { AISTOCK_STOCK_BUY_STATS_DATA.AISTOCK_STOCK_BUY_STATSRow saveRow = stats.AISTOCK_STOCK_BUY_STATS.NewAISTOCK_STOCK_BUY_STATSRow(); Guid id = Guid.NewGuid(); saveRow.STOCK_BUY_ID = id.ToString().ToUpper(); saveRow.STOCK_CODE = dataRow.STOCK_CODE; DataRow[] tmpRow = baseData.AISTOCK_STOCK_BASEINFO.Select("STOCK_CODE = '" + dataRow.STOCK_CODE + "'"); saveRow.STOCK_NAME = ((AISTOCK_STOCK_BASEINFO_DATA.AISTOCK_STOCK_BASEINFORow)tmpRow[0]).STOCK_NAME; saveRow.STOCK_TYPE = "低档五连阳"; saveRow.STOCK_DAY = dateTo; stats.AISTOCK_STOCK_BUY_STATS.AddAISTOCK_STOCK_BUY_STATSRow(saveRow); } } else if (value.Equals("双针探底")) { indexDay = 1; date = new StockSystem().GetIndexDay(qc.DatePickerFrom, indexDay); date = DateTimeFunction.ConvertDate(DateTime.Parse(date).ToShortDateString()); AISTOCK_STOCK_TWO_PIN_V_DATA data = new StockSystem().GetTwoPinData(date, dateTo); foreach (AISTOCK_STOCK_TWO_PIN_V_DATA.AISTOCK_STOCK_TWO_PIN_VRow dataRow in data.AISTOCK_STOCK_TWO_PIN_V.Rows) { AISTOCK_STOCK_BUY_STATS_DATA.AISTOCK_STOCK_BUY_STATSRow saveRow = stats.AISTOCK_STOCK_BUY_STATS.NewAISTOCK_STOCK_BUY_STATSRow(); Guid id = Guid.NewGuid(); saveRow.STOCK_BUY_ID = id.ToString().ToUpper(); saveRow.STOCK_CODE = dataRow.STOCK_CODE; saveRow.STOCK_NAME = dataRow.STOCK_NAME; saveRow.STOCK_TYPE = "双针探底"; saveRow.STOCK_DAY = dateTo; stats.AISTOCK_STOCK_BUY_STATS.AddAISTOCK_STOCK_BUY_STATSRow(saveRow); } } else if (value.Equals("十字星探底")) { indexDay = 3; date = new StockSystem().GetIndexDay(qc.DatePickerFrom, indexDay); date = DateTimeFunction.ConvertDate(DateTime.Parse(date).ToShortDateString()); AISTOCK_STOCK_SINGLE_PIN_V_DATA data = new StockSystem().GetSinglePinData(date, dateTo); foreach (AISTOCK_STOCK_SINGLE_PIN_V_DATA.AISTOCK_STOCK_SINGLE_PIN_VRow dataRow in data.AISTOCK_STOCK_SINGLE_PIN_V.Rows) { AISTOCK_STOCK_BUY_STATS_DATA.AISTOCK_STOCK_BUY_STATSRow saveRow = stats.AISTOCK_STOCK_BUY_STATS.NewAISTOCK_STOCK_BUY_STATSRow(); Guid id = Guid.NewGuid(); saveRow.STOCK_BUY_ID = id.ToString().ToUpper(); saveRow.STOCK_CODE = dataRow.STOCK_CODE; saveRow.STOCK_NAME = dataRow.STOCK_NAME; saveRow.STOCK_TYPE = "十字星探底"; saveRow.STOCK_DAY = dateTo; stats.AISTOCK_STOCK_BUY_STATS.AddAISTOCK_STOCK_BUY_STATSRow(saveRow); } } else if (value.Equals("锤子线探底")) { indexDay = 1; date = new StockSystem().GetIndexDay(qc.DatePickerFrom, indexDay); date = DateTimeFunction.ConvertDate(DateTime.Parse(date).ToShortDateString()); AISTOCK_STOCK_HAMMER_V_DATA data = new StockSystem().GetHammerData(date, dateTo); foreach (AISTOCK_STOCK_HAMMER_V_DATA.AISTOCK_STOCK_HAMMER_VRow dataRow in data.AISTOCK_STOCK_HAMMER_V.Rows) { AISTOCK_STOCK_BUY_STATS_DATA.AISTOCK_STOCK_BUY_STATSRow saveRow = stats.AISTOCK_STOCK_BUY_STATS.NewAISTOCK_STOCK_BUY_STATSRow(); Guid id = Guid.NewGuid(); saveRow.STOCK_BUY_ID = id.ToString().ToUpper(); saveRow.STOCK_CODE = dataRow.STOCK_CODE; saveRow.STOCK_NAME = dataRow.STOCK_NAME; saveRow.STOCK_TYPE = "锤子线探底"; saveRow.STOCK_DAY = dateTo; stats.AISTOCK_STOCK_BUY_STATS.AddAISTOCK_STOCK_BUY_STATSRow(saveRow); } } else if (value.Equals("早晨之星")) { indexDay = 2; date = new StockSystem().GetIndexDay(qc.DatePickerFrom, indexDay); date = DateTimeFunction.ConvertDate(DateTime.Parse(date).ToShortDateString()); string twoDate = new StockSystem().GetIndexDay(qc.DatePickerFrom, 1); twoDate = DateTimeFunction.ConvertDate(DateTime.Parse(twoDate).ToShortDateString()); AISTOCK_STOCK_MORNING_STAR_V_DATA data = new StockSystem().GetMorningStarData(date, twoDate, dateTo); foreach (AISTOCK_STOCK_MORNING_STAR_V_DATA.AISTOCK_STOCK_MORNING_STAR_VRow dataRow in data.AISTOCK_STOCK_MORNING_STAR_V.Rows) { AISTOCK_STOCK_BUY_STATS_DATA.AISTOCK_STOCK_BUY_STATSRow saveRow = stats.AISTOCK_STOCK_BUY_STATS.NewAISTOCK_STOCK_BUY_STATSRow(); Guid id = Guid.NewGuid(); saveRow.STOCK_BUY_ID = id.ToString().ToUpper(); saveRow.STOCK_CODE = dataRow.STOCK_CODE; saveRow.STOCK_NAME = dataRow.STOCK_NAME; saveRow.STOCK_TYPE = "早晨之星"; saveRow.STOCK_DAY = dateTo; stats.AISTOCK_STOCK_BUY_STATS.AddAISTOCK_STOCK_BUY_STATSRow(saveRow); } } } new StockSystem().SaveStockStatsData(stats); }
public void SaveStockStatsData(AISTOCK_STOCK_BUY_STATS_DATA data) { new Stock().SaveStockStatsData(data); }