public ActionResult ClearAllIndex() { IndexManagementModels model = new IndexManagementModels(); IdxIndexDAO indexDAO = new IdxIndexDAO(this.mapper); if (indexDAO.DeleteAllIndex()) { model.infoMessage = PsMModel.Resource.MsgSuccess; } else { model.errorMessage = PsMModel.Resource.CommonErrMsg; } return View("IndexManagement", model); }
/** * Create bar chart * **/ public FileResult CreateColumnChart(string indexCode, int width, int height, string fontSize, string term) { indexCode = StringUtils.base64Decode(indexCode); SeriesChartType chartType = SeriesChartType.Column; Chart chart = new Chart(); chart.Width = width;//900; chart.Height = height;//300; //chart.BackColor = Color.FromArgb(211, 223, 240); chart.BackColor = ColorTranslator.FromHtml("#80C0DB"); chart.BorderlineDashStyle = ChartDashStyle.Solid; chart.BackSecondaryColor = Color.White; chart.BackGradientStyle = GradientStyle.TopBottom; chart.BorderlineWidth = 1; chart.Palette = ChartColorPalette.BrightPastel; chart.BorderlineColor = Color.FromArgb(26, 59, 105); chart.RenderType = RenderType.BinaryStreaming; chart.BorderSkin.SkinStyle = BorderSkinStyle.Emboss; chart.AntiAliasing = AntiAliasingStyles.All; chart.TextAntiAliasingQuality = TextAntiAliasingQuality.Normal; MemoryStream ms = new MemoryStream(); // Check index MstIndexDAO mstIndexDAO = new MstIndexDAO(this.mapper); string userCode = string.Empty; if (Session != null) { SysUserModels userSession = (SysUserModels) Session["UserSession"]; if (userSession != null && userSession.userCode != null) { userCode = userSession.userCode; } } // If not right -> redirect to Rule page if (!mstIndexDAO.IsUserHasIndexRight(userCode, indexCode)) { chart.Titles.Add(this.CreateNoAuthorizeTitle()); chart.SaveImage(ms); return File(ms.GetBuffer(), @"image/png"); } IdxIndexDAO indexDAO = new IdxIndexDAO(this.mapper); DateTime? indexTime = null; //if (StringUtils.IsEmpty(userCode)) //{ // indexTime = DateUtils.GetLastFriday(); //} IList<IndexChartModels> indexList = indexDAO.GetIndexListChart(indexCode, indexTime, term); IList<MoneyChartModels> moneyList = indexDAO.GetMoneyListChart(indexCode, indexTime, term); if (indexList.Count != 0) { chart.Titles.Add(this.CreateColumnTitle(indexCode, float.Parse(fontSize), indexList[indexList.Count - 1].strIndexTime, term)); } else { chart.Titles.Add(this.CreateColumnTitle(indexCode, float.Parse(fontSize), string.Empty, term)); } //chart.Legends.Add(this.CreateLegend()); chart.Series.Add(this.CreateColumnSeries(indexList, chartType)); if (this.isShowMoneyLine(moneyList)) { chart.Series.Add(this.CreateLineSeries(moneyList, SeriesChartType.Line)); } // *** The following code should not normally be modified *** chart.ChartAreas.Add(this.CreateColumnChartArea()); chart.SaveImage(ms); return File(ms.GetBuffer(), @"image/png"); }
public ActionResult UploadMoneyFile(MoneyFileUploadModels model) { SysUserModels userSession = (SysUserModels)Session["UserSession"]; IdxIndexDAO indexDAO = new IdxIndexDAO(this.mapper); model.moneyFile = Request.Files["moneyFile"]; string uploadFolder = Server.MapPath(Constants.File.UploadIndexFolder); indexDAO.ReadMoneyFile(model, userSession, uploadFolder); return View(model); }
public ActionResult AddLike(string indexCode) { IdxIndexDAO indexDAO = new IdxIndexDAO(this.mapper); SysUserModels userSession = (SysUserModels)Session["UserSession"]; return this.Json(indexDAO.saveLikeIndexCodeUser(userSession.userCode, StringUtils.base64Decode(indexCode), Constants.Flag.HasRight), JsonRequestBehavior.AllowGet); }
public ActionResult ShowLikeIndex(string t, string i, string p) { IdxIndexDAO indexDAO = new IdxIndexDAO(this.mapper); string indexTypeCode = ""; string indexCode = ""; bool isDetail = false; if (!StringUtils.IsEmpty(t)) { indexTypeCode = StringUtils.base64Decode(t); isDetail = true; } if (!StringUtils.IsEmpty(i)) { indexCode = StringUtils.base64Decode(i); } SysUserModels userSession = (SysUserModels)Session["UserSession"]; IndexShowModels model = indexDAO.ShowLikeIndex(indexTypeCode, indexCode, p, userSession.userCode); model.isDetail = isDetail; return View(model); }
public ActionResult IndexManagement(IndexManagementModels model) { MstIndexTypeDAO indexTypeDAO = new MstIndexTypeDAO(this.mapper); model.indexTypeList = indexTypeDAO.GetIndexTypeList(null, Constants.Status.Active); MstIndexTypeModels allType = new MstIndexTypeModels(); model.indexTypeList.Insert(0, allType); IdxIndexDAO indexDAO = new IdxIndexDAO(this.mapper); indexDAO.DeleteIndex(model.indexTypeCode, model.indexCode, model.fromTime, model.toTime, model.term); model.infoMessage = PsMModel.Resource.MsgSuccess; return View(model); }
public ActionResult GetIndexMaster(string indexTypeCode, string term) { IdxIndexDAO idxIndexDAO = new IdxIndexDAO(this.mapper); Dictionary<string, MstIndexModels> data = idxIndexDAO.GetIndexMasterList(indexTypeCode, null, term); return this.Json(data, JsonRequestBehavior.AllowGet); }
public ActionResult GetFreeIndexMaster() { IdxIndexDAO idxIndexDAO = new IdxIndexDAO(this.mapper); Dictionary<string, MstIndexModels> data = idxIndexDAO.GetIndexMasterList(null, Constants.Type.Public, null); return this.Json(data, JsonRequestBehavior.AllowGet); }
public ActionResult GetIndex(string indexTypeCode, string indexCode, string term) { IdxIndexDAO indexDAO = new IdxIndexDAO(this.mapper); IDictionary<string, object> data = indexDAO.GetIndexList( indexTypeCode , indexCode , DateTime.MinValue // fromTime , DateTime.MaxValue // toTime , "" //limit , term // term ); return this.Json(data, JsonRequestBehavior.AllowGet); }