コード例 #1
0
        public ActionResult EditNews(int id)
        {
            NewsDataStore         Obj         = new NewsDataStore();
            SA_News               obj         = Obj.GetNewsByid(id);
            List <SelectListItem> productList = Obj.GetProductList();
            SA_NewsViewModel      objSaCatV   = new SA_NewsViewModel();

            objSaCatV.id              = obj.id;
            objSaCatV.NewsName        = obj.NewsName;
            objSaCatV.NewsDiscription = obj.NewsDiscription;
            objSaCatV.URL             = obj.URL;
            objSaCatV.MetaDiscription = obj.MetaDiscription;
            objSaCatV.Keywords        = obj.Keywords;
            objSaCatV.MetaTitle       = obj.MetaTitle;
            objSaCatV.ProductList     = productList;
            objSaCatV.Product         = obj.Product.ToString();
            objSaCatV.CreatedTime     = obj.CreatedTime;
            objSaCatV.NewsImg         = obj.NewsImg;
            ViewBag.NewsProducts      = Obj.GetNewsProduct(id);

            return(View("add-News", objSaCatV));
        }