Ejemplo n.º 1
0
        public ActionResult Detail(int id, string slug)
        {
            T_NewsServices _newServices = new T_NewsServices();
            T_News ANews = _newServices.GetByID(id);
            int GoiTKId = 1037;
            Int32.TryParse(TNVTH.Web.GlobalConfig.Instance.GetValue(TNVTH.Web.Utilities.Config.Conf_GoiThietKe_ID.ToString()), out GoiTKId);
            int SieuThiWebId = 1039;
            Int32.TryParse(TNVTH.Web.GlobalConfig.Instance.GetValue(TNVTH.Web.Utilities.Config.Conf_MauThietKe_ID.ToString()), out SieuThiWebId);

            int DichVuId = 1031;
            Int32.TryParse(TNVTH.Web.GlobalConfig.Instance.GetValue(TNVTH.Web.Utilities.Config.Conf_DichVu_ID.ToString()), out DichVuId);

            if (_newServices.IsInCategory(id, GoiTKId))
            {
                return View("XemGoiThietKeWeb", ANews);
            }

            if (_newServices.IsInCategory(id, SieuThiWebId))
            {
                return View("XemMauThietKeWeb", ANews);
            }

            if (_newServices.IsInCategory(id, DichVuId))
            {
                return View("XemChiTietDichVu", ANews);
            }

            return View(ANews);
        }
Ejemplo n.º 2
0
 public string GetString4LinkArticle(string key)
 {
     string Value = GetValue(key);
     T_NewsServices service = new T_NewsServices();
     T_News MyNews = service.GetByID(Convert.ToInt32(Value));
     if(MyNews != null)  return MyNews.ID + "/" + MyNews.Slug;
     else return Value;
 }