public ActionResult Opinion_show() { PDBC db = new PDBC("PandaMarketCMS", true); db.Connect(); using (DataTable dt = db.Select("SELECT [id_MProduct],[id_Customer],[id_AccByAdmin],[CreateDate],[DateAccepted],[Is_Accepted],[OpinionDescription],[Rate],[ISDELETE],[id_Opinion] FROM [dbo].[tbl_Product_Opinion]")) { for (int i = 0; i < dt.Rows.Count; i++) { data_op = new opinion(); string str = dt.Rows[i]["ISDELETE"].ToString(); if (dt.Rows[i]["ISDELETE"].ToString() == "0") { data_op.id_Opinion = dt.Rows[i]["id_Opinion"].ToString(); data_op.id_MProduct = dt.Rows[i]["id_MProduct"].ToString(); data_op.id_Customer = dt.Rows[i]["id_Customer"].ToString(); data_op.CreateDate = dt.Rows[i]["CreateDate"].ToString(); data_op.Is_Accepted = dt.Rows[i]["Is_Accepted"].ToString(); data_op.OpinionDescription = dt.Rows[i]["OpinionDescription"].ToString(); data_op.Rate = dt.Rows[i]["Rate"].ToString(); list_op.Add(data_op); } } ViewBag.opin = list_op; }; return(View()); }
public ActionResult Opinion_show() { string SSSession = ""; if (HttpContext.Request.Cookies["TSHPANDAControll" + StaticLicense.LicName] != null) { HttpCookie cookie = HttpContext.Request.Cookies.Get("TSHPANDAControll" + StaticLicense.LicName); if (cookie != null) { SSSession = cookie.Value; } else { SSSession = "N.A"; } } else { SSSession = "N.A"; } CheckAccess check = new CheckAccess(SSSession); if (check.HasAccess) { PDBC db = new PDBC("PandaMarketCMS", true); db.Connect(); using (DataTable dt = db.Select("SELECT [id_MProduct],[id_Customer],[id_AccByAdmin],[CreateDate],[DateAccepted],[Is_Accepted],[OpinionDescription],[Rate],[ISDELETE],[id_Opinion] FROM [dbo].[tbl_Product_Opinion]")) { db.DC(); for (int i = 0; i < dt.Rows.Count; i++) { data_op = new opinion(); string str = dt.Rows[i]["ISDELETE"].ToString(); if (dt.Rows[i]["ISDELETE"].ToString() == "0") { data_op.id_Opinion = dt.Rows[i]["id_Opinion"].ToString(); data_op.id_MProduct = dt.Rows[i]["id_MProduct"].ToString(); data_op.id_Customer = dt.Rows[i]["id_Customer"].ToString(); data_op.CreateDate = dt.Rows[i]["CreateDate"].ToString(); data_op.Is_Accepted = dt.Rows[i]["Is_Accepted"].ToString(); data_op.OpinionDescription = dt.Rows[i]["OpinionDescription"].ToString(); data_op.Rate = dt.Rows[i]["Rate"].ToString(); list_op.Add(data_op); } } ViewBag.opin = list_op; }; return(View()); } else { return(RedirectToAction("NotAccess")); } }