public ActionResult Posts(int id)
 {
     
     BRArticle obrArticle = new BRArticle();
     BEArticle oArticle = obrArticle.GetArticleById(id);
     return View(oArticle);
 }
예제 #2
0
 public ActionResult getArticlesFromLine()
 {
     string idLinea = ConfigurationManager.AppSettings["idLinea"];
     BRArticle obrArticle = new BRArticle();
     List<BEArticle> lbeArticle = obrArticle.GetPostArticlesByLine(Int32.Parse(idLinea));
     return PartialView("Articles", lbeArticle);
 }
예제 #3
0
        public ActionResult GetData(int pageIndex, int pageSize)
        {

            string idLinea = ConfigurationManager.AppSettings["idLinea"];
            BRArticle obrArticle = new BRArticle();
            List<BEArticle> lbeArticle = obrArticle.GetArticlesbyLinePaging(Int32.Parse(idLinea), pageIndex, pageSize);
            return Json(lbeArticle.ToList(), JsonRequestBehavior.AllowGet);
        }
        public ActionResult SaveArticle(BEArticle oArticulo)

        {

            int intRes = 0;
            string strModificador = "AMIGO";
            string idLinea = ConfigurationManager.AppSettings["idLinea"];
            DateTime FechaRegistro = DateTime.Now;

            //OBjeto a Registrar
            BRArticle oBRArticle = new BRArticle();
            oArticulo.FechaModificacion = DateTime.Now;
            oArticulo.idLine = Int32.Parse(idLinea);
            intRes = oBRArticle.SaveArticle(oArticulo);
  
            if (intRes > 0) return Json(new { idArticle = intRes});
            else return Json(new { success = false });

        }
        public ActionResult AddImages(int id, HttpPostedFileBase file)
        {
            int intRes = 0;
            int idArticle = id;
            string imgNameResult = "";
            foreach (string item in Request.Files)
            {
                if (file.ContentLength == 0)
                    continue;
                if (file.ContentLength > 0)
                {
                    ImageUpload imageUpload = new ImageUpload { Width = 800 };
                    ImageResult imageResult = imageUpload.RenameUploadFile(file);
                    imgNameResult = imageResult.ImageName.ToString();
                    if (imageResult.Success)
                    {

                        string strModificador = "AMIGO";
                        DateTime FechaRegistro = DateTime.Now;

                        //Guardar el Registro de la fotografía
                        BRArticle oBRArticle = new BRArticle();
                        intRes = oBRArticle.SaveImageToArticle(idArticle, imgNameResult, strModificador);
                    }
                }
            }

            return RedirectToAction("../home");
        }