Esempio n. 1
0
        public IActionResult details(int id)
        {
            var qblog = db.Tbl_Blog.Where(a => a.Id == id && a.Language == ln).SingleOrDefault();
            /////////////////////////////////////////////////////////////////////////////////////////comment
            var qcomit = db.Tbl_Comments.Where(a => a.blog_id == id && a.State == true && a.Language == ln).ToList();

            List <Vm_Comment> com = new  List <Vm_Comment>();

            foreach (var item in qcomit)
            {
                var        name = db.Tbl_User.Where(a => a.Id == Convert.ToInt32(item.User_Id) && a.Language == ln).SingleOrDefault();
                Vm_Comment comm = new Vm_Comment()
                {
                    username   = name.UserNameUs,
                    dateshamsi = item.DateComment.ToPersianDateString(),
                    Comment    = item.Comment,
                    image      = name.ProfileImageUs
                };
                com.Add(comm);
            }
            ViewBag.comments = com.OrderByDescending(a => a.Id).ToList();
            ///////////////////////////////////////////////////////////////////////////////////////////////////////

            return(View(qblog));
        }
Esempio n. 2
0
        public IActionResult Acceptede()
        {
            if (suc != null)
            {
                ViewBag.suc = suc;
                suc         = null;
            }
            /////////////////////////////////////////////////////////////////////////////////////////comment
            var qcomit = db.Tbl_Comments.Where(a => a.State == true).ToList();

            List <Vm_Comment> com = new  List <Vm_Comment>();

            foreach (var item in qcomit)
            {
                var        name = db.Tbl_User.Where(a => a.Id == Convert.ToInt32(item.User_Id)).SingleOrDefault();
                Vm_Comment comm = new Vm_Comment()
                {
                    Id         = item.Id,
                    username   = name.UserNameUs,
                    dateshamsi = item.DateComment.ToPersianDateString(),
                    Comment    = item.Comment,
                    image      = name.ProfileImageUs,
                    Language   = item.Language,
                    product_id = item.product_id,
                    blog_id    = item.blog_id
                };
                com.Add(comm);
            }
            ViewBag.comments = com.OrderByDescending(a => a.Id).ToList();
            ///////////////////////////////////////////////////////////////////////////////////////////////////////
            return(View());
        }
Esempio n. 3
0
        public IActionResult details(int id)
        {
            /////////////////////////////////////////////////////////////////////////////////////////comment
            var qcomit = db.Tbl_Comments.Where(a => a.product_id == id && a.State == true).ToList();

            List <Vm_Comment> com = new  List <Vm_Comment>();

            foreach (var item in qcomit)
            {
                var        name = db.Tbl_User.Where(a => a.Id == Convert.ToInt32(item.User_Id)).SingleOrDefault();
                Vm_Comment comm = new Vm_Comment()
                {
                    username   = name.UserNameUs,
                    dateshamsi = item.DateComment.ToPersianDateString(),
                    Comment    = item.Comment,
                    image      = name.ProfileImageUs
                };
                com.Add(comm);
            }
            ViewBag.comments = com.OrderByDescending(a => a.Id).ToList();
            ///////////////////////////////////////////////////////////////////////////////////////////////////////

            //////////////////////////////////////////////////////////////////////////////////list
            var qproduct = db.Tbl_Product.Where(a => a.Id == id).SingleOrDefault();

            if (qproduct != null)
            {
                var qgallery = db.tb_GalleryProducts.Where(a => a.IdProduct == id).ToList();
                ViewBag.baner = qgallery.OrderByDescending(a => a.Id).ToList();
                List <string> h = new List <string> ();
                foreach (var item in qgallery)
                {
                    h.Add(item.ImagePath);
                }
                Vm_Product qp = new Vm_Product()
                {
                    Id = qproduct.Id,
                    TitleProductPro = qproduct.TitleProductPro,
                    ImageMainPro    = qproduct.ImageMainPro,
                    CategoryIdPro   = qproduct.CategoryIdPro,
                    PricePro        = qproduct.PricePro,
                    OfferPro        = qproduct.OfferPro,
                    SizePro         = qproduct.SizePro,
                    ColorPro        = qproduct.ColorPro,
                    BrandPro        = qproduct.BrandPro,
                    TypeCarPro      = qproduct.TypeCarPro,
                    MaterialPro     = qproduct.MaterialPro,
                    TotalPro        = qproduct.TotalPro,
                    DescreptionPro  = qproduct.DescreptionPro,
                    Language        = qproduct.Language,
                };
                ViewBag.img = h;
                return(View(qp));
            }
            else
            {
                return(RedirectToAction("index", "home"));
            }
        }