Exemplo n.º 1
0
        public ActionResult EditCommentary(int id)
        {
            CommentaryDataStore Obj = new CommentaryDataStore();
            SA_Commentary       obj = Obj.GetCommentaryByid(id);

            return(View("AddIndustry", obj));
        }
Exemplo n.º 2
0
        public ActionResult SaveCommentaryMarket(SA_Commentary UserNews)
        {
            CommentaryDataStore Obj = new CommentaryDataStore();

            for (int i = 0; i < Request.Files.Count; i++)
            {
                var file = Request.Files[i];

                if (file != null && file.ContentLength > 0)
                {
                    var fileName = Path.GetFileName(file.FileName);

                    var path = Path.Combine(Server.MapPath("~/ProductImages"), fileName);
                    file.SaveAs(path);
                    UserNews.ImgPath = fileName;
                }
            }

            if (UserNews.id == 0)
            {
                UserNews.Type = "Market Analysis";
                Obj.AddCommentary(UserNews);
            }
            else
            {
                Obj.EditCommentary(UserNews);
            }
            return(RedirectToAction("ShowCommentaryList", "Admin"));
        }
Exemplo n.º 3
0
        public ActionResult ShowCommentaryList()
        {
            CommentaryDataStore  Obj          = new CommentaryDataStore();
            List <SA_Commentary> IndustryList = Obj.GetCommentaryList();

            return(View("commentary-list", IndustryList));
        }
Exemplo n.º 4
0
        public ActionResult DeleteCommentary(int id)
        {
            CommentaryDataStore Obj = new CommentaryDataStore();

            if (Obj.DeleteCommentary(id) == true)
            {
                return(RedirectToAction("ShowCommentaryList", "Admin"));
            }
            else
            {
                return(View("ErrorEventArgs"));
            }
        }
Exemplo n.º 5
0
        public ActionResult AddCommentaryMarket(int id = 0)
        {
            CommentaryDataStore Obj = new CommentaryDataStore();
            SA_Commentary       obj = new SA_Commentary();

            if (id > 0)
            {
                obj = Obj.GetCommentaryByid(id);
            }

            if (obj == null)
            {
                obj = new SA_Commentary();
            }
            return(View(obj));
        }
Exemplo n.º 6
0
 public ActionResult LoadCommentaryData()
 {
     try
     {
         ProductDataStore    ObjProduct = new ProductDataStore();
         CommentaryDataStore Obj        = new CommentaryDataStore();
         var CommentaryList             = Obj.GetCommentaryList().Select(w => new IndustryVM
         {
             id         = w.id,
             Title      = w.Title,
             Type       = w.Type,
             CreateTime = w.CreatedTime != null ? w.CreatedTime.ToString("dd/MM/yyyy") : "",
             Product    = w.Product != null ? ObjProduct.GetProductByid(w.Product).ProductName : "",
         });
         return(Json(new { data = CommentaryList }, JsonRequestBehavior.AllowGet));
     }
     catch (Exception)
     {
         throw;
     }
 }