Пример #1
0
        /// <summary>
        /// insertes user comments
        /// </summary>
        /// <param name="userFeedback">FeedbackDAO</param>
        /// <returns></returns>
        public int InsertProductComment(FeedbackDAO userFeedback)
        {
            Database  database      = null;
            DbCommand insertCommand = null;

            try
            {
                database      = DatabaseFactory.CreateDatabase();
                insertCommand = database.GetStoredProcCommand("uspInsertProductComment");
                database.AddInParameter(insertCommand, "userId", DbType.String, userFeedback.UserID);
                database.AddInParameter(insertCommand, "productId", DbType.String, userFeedback.ProductId);
                database.AddInParameter(insertCommand, "description", DbType.String, userFeedback.Description);
                return(database.ExecuteNonQuery(insertCommand));
            }
            catch (Exception ex)
            {
                SpencerLogger.Error("ProductDBLL->InsertProductComment()", ex);
                throw new BaseException("DBInsert");
            }
            finally
            {
                if (insertCommand.Connection.State == ConnectionState.Open)
                {
                    insertCommand.Connection.Close();
                }
                insertCommand = null;
                database      = null;
            }
        }
Пример #2
0
 public ActionResult Create(Feedback feedback, string tempstatus)
 {
     if (ModelState.IsValid)
     {
         if (tempstatus == "Kích Hoạt")
         {
             feedback.Status = true;
         }
         else
         {
             feedback.Status = false;
         }
         feedback.CreateDate = DateTime.Now;
         FeedbackDAO feedbackDAO = new FeedbackDAO();
         var         check       = feedbackDAO.Create(feedback);
         if (check > 0)
         {
             TempData["msg"] = MessageBox.Show("Create Success");
             return(RedirectToAction("Create", "FeedBack"));
         }
         else
         {
             ModelState.AddModelError("", "Thêm Không Thành Công");
         }
     }
     return(View());
 }
Пример #3
0
 public ActionResult Edit(Feedback feedback, string tempstatus)
 {
     if (ModelState.IsValid)
     {
         if (tempstatus == "Kích Hoạt")
         {
             feedback.Status = true;
         }
         else
         {
             feedback.Status = false;
         }
         FeedbackDAO feedbackDAO = new FeedbackDAO();
         int         check       = feedbackDAO.Edit(feedback);
         if (check > 0)
         {
             TempData["msg"] = MessageBox.Show("Edit Thành Công");
             return(RedirectToAction("Index"));
         }
         else
         {
             ModelState.AddModelError("", "Edit Không Thành Công");
         }
     }
     return(View(feedbackeditting));
 }
Пример #4
0
        public JsonResult Send(string name, string mobile, string address, string email, string content)
        {
            Feedback fb = new Feedback();

            fb.Name       = name;
            fb.Phone      = mobile;
            fb.Address    = address;
            fb.Email      = email;
            fb.Content    = content;
            fb.CreateDate = DateTime.Now;

            var result = new FeedbackDAO().Insert(fb);

            if (result > 0)
            {
                return(Json(new
                {
                    status = true
                }));
            }
            else
            {
                return(Json(new
                {
                    status = false
                }));
            }
        }
        // GET: Admin/FeedBack
        public ActionResult Index(int page = 1, int pagesize = 10)
        {
            var dao   = new FeedbackDAO();
            var model = dao.ListAllPage(page, pagesize);

            return(View(model));
        }
Пример #6
0
        public BarChartCM getBarChartData()
        {
            var modelChart = new BarChartCM();
            var labels     = new List <string>();

            var datasets   = new List <BarChartChildCM>();
            var childModel = new BarChartChildCM();

            childModel.label                = "Comments";
            childModel.backgroundColor      = @"#4e73df";
            childModel.hoverBackgroundColor = @"#2e59d9";
            childModel.borderColor          = @"#4e73df";
            var            feedbackdao = new FeedbackDAO();
            List <int>     dataList    = new List <int>();
            List <ChartCM> res         = feedbackdao.getQuantityCommentOfYears();

            for (var i = 0; i < res.Count; i++)
            {
                labels.Add(res[i].year);
                dataList.Add(res[i].quantityCM);
            }
            childModel.data = dataList;
            datasets.Add(childModel);
            modelChart.labels   = labels;
            modelChart.datasets = datasets;
            return(modelChart);
        }
Пример #7
0
        public int createFeedback()
        {
            FeedbackDAO dao    = new FeedbackDAO();
            int         result = dao.Insert(this);

            return(result);
        }
Пример #8
0
        public ActionResult Edit(Feedback ne)
        {
            try
            {
                string content = System.IO.File.ReadAllText(Server.MapPath("~/Content/Client/template/neworder.html"));

                content = content.Replace("{{CustomerName}}", ne.Name);
                content = content.Replace("{{Phone}}", ne.Phone);
                content = content.Replace("{{Email}}", ne.Email);
                content = content.Replace("{{Text}}", ne.Text);
                content = content.Replace("{{Rely}}", ne.Reply);
                var toEmail = ConfigurationManager.AppSettings["ToEmailAddress"].ToString();

                new MailHelper().SendMail(ne.Email, "Trả lời phản hồi", content);

                var dao      = new FeedbackDAO();
                var feedback = db.Feedback.Find(ne.FeedbackID);
                ne.Status = !ne.Status;
                db.SaveChanges();
            }
            catch (Exception)
            {
                return(Redirect("/a"));
            }
            return(RedirectToAction("Index", "FeedBack"));
        }
Пример #9
0
        public ActionResult Remove(int feedbackid)
        {
            FeedbackDAO feedbackDAO = new FeedbackDAO();

            feedbackDAO.Remove(feedbackid);
            return(RedirectToAction("Index"));
        }
Пример #10
0
        public ActionResult Edit(int id)
        {
            FeedbackDAO feedbackDAO = new FeedbackDAO();
            var         feedback    = feedbackDAO.GetFeedback(id);

            feedbackeditting = feedback;
            return(View(feedback));
        }
Пример #11
0
        public ActionResult Index(string searchString, int page = 1, int pageSize = 10)
        {
            var dao   = new FeedbackDAO();
            var model = dao.ListAllPaging(searchString, page, pageSize);

            ViewBag.SearchString = searchString;

            return(View(model));
        }
Пример #12
0
        public JsonResult ChangeStatus(long id)
        {
            var result = new FeedbackDAO().ChangeStatus(id);

            return(Json(new
            {
                status = result
            }));
        }
Пример #13
0
        public JsonResult ChangeStatus(int feedbackID)
        {
            FeedbackDAO feedbackDAO = new FeedbackDAO();
            bool        tempstatus  = feedbackDAO.ChangeStatus(feedbackID);

            return(Json(new
            {
                status = tempstatus
            }));
        }
        // GET: Admin/Feedback
        public ActionResult Index(string searchText, int page = 1, int pageSize = 1)
        {
            var dao = new FeedbackDAO();

            ViewBag.PageSizes = Utilities.GetPageSize(pageSize);
            ViewBag.PageSize  = pageSize;
            var model = dao.ListAllPaging(searchText, page, pageSize);

            ViewBag.Search = searchText;//giữ lại chuỗi search trong input
            return(View(model));
        }
Пример #15
0
 public bool InsertFeedback(Feedback model)
 {
     try
     {
         return(FeedbackDAO.Insert(model));
     }
     catch (Exception)
     {
         return(false);
     }
 }
Пример #16
0
 public bool DeleteFeedbackv2(int id)
 {
     try
     {
         return(FeedbackDAO.Delete(id));
     }
     catch (Exception)
     {
         return(false);
     }
 }
Пример #17
0
        public ActionResult Create(FeedbackModel model)
        {
            if (ModelState.IsValid)
            {
                var login = new FeedbackDAO();

                var user = new Feedback();
                user.id_User    = model.User_ID;
                user.id_Product = model.Product_ID;
                user.star       = model.Star;
                user.note       = model.Note;

                var result = login.Insert(user);
                if (result > 0)
                {
                    ViewBag.Success = "Đăng đánh giá bình luận thành công.";
                    return(RedirectToAction("Index", "ProductClient"));
                }
                else
                {
                    ModelState.AddModelError("", "Đăng đánh giá bình luận không thành công !!!");
                }
            }
            var listHX = new CarManufacturerDAO().ListOf();

            ViewBag.HX = listHX;

            var listTL = new CategoryDAO().ListOf();

            ViewBag.TL = listTL;

            var listPK = new CylinderCapacityDAO().ListOf();

            ViewBag.PK = listPK;

            var listCL = new ColorDAO().ListOf();

            ViewBag.CL = listCL;

            var listAllPr = new ProductDAO().ListAll();

            ViewBag.Pr = listAllPr;

            var listNews = new NewsDAO().ListAll();

            ViewBag.New = listNews;

            var listNewPr = new ProductDAO().ListNewPro();

            ViewBag.Product = listNewPr;

            return(View("Index"));
        }
Пример #18
0
 public ActionResult AddComment(Feedbacks feedback)
 {
     if (ModelState.IsValid)
     {
         var feedbackDAO = new FeedbackDAO().Insert(feedback);
         if (feedbackDAO == true)
         {
             return(RedirectToAction("Index", "ProductDetail", new { id = feedback.ProductID }));
         }
     }
     return(RedirectToAction("Index", "ProductDetail", new { id = feedback.ProductID }));
 }
Пример #19
0
        private void FeedbackAdmin_Load(object sender, EventArgs e)
        {
            FeedbackDAO ud = new FeedbackDAO();

            //sd.showData(cbxClass.Text, cbxDepartment.Text, cbxSubject.Text);

            ud.showFeedback();
            dataGridView1.DataSource = null;
            DataTable dataTable = ud.showFeedback();

            dataGridView1.DataSource = dataTable;
        }
Пример #20
0
 public object PostNewFeedback(JObject json)
 {
     try
     {
         var feedback = json.ToObject <Feedback>();
         var result   = new FeedbackDAO().InsertFeedback(feedback);
         return(new Response(result, null));
     } catch (Exception e)
     {
         Console.WriteLine(e.Message);
         return(new Response(false, null, e.Message));
     }
 }
Пример #21
0
        private void btnSend_Click(object sender, EventArgs e)
        {
            Feedbacks f = new Feedbacks();

            f.Title       = txtTitle.Text;
            f.Description = txtDescription.Text;
            f.Name        = txtFullName.Text;
            f.Room        = txtRoom.Text;

            FeedbackDAO fd = new FeedbackDAO();

            fd.sendFeedback(f);
        }
Пример #22
0
 public bool UpdateFeedback(FeedbackModel model)
 {
     try
     {
         Feedback item = FeedbackDAO.GetById(model.Id);
         item.Content = model.Content;
         item.Subject = model.Subject;
         return(FeedbackDAO.Update(item));
     }
     catch (Exception)
     {
         return(false);
     }
 }
Пример #23
0
        protected void submitBtn_Click(object sender, EventArgs e)
        {
            int         rate         = Convert.ToInt32(DropDownList1.SelectedValue);
            string      comments     = tbComments.Text.ToString();
            string      recommends   = RadioButtonList3.SelectedValue.ToString();
            Feedback    feedbackObj  = new Feedback();
            FeedbackDAO feedDAO      = new FeedbackDAO();
            string      studentAdmin = Lblno.Text;
            string      tripID       = Lblcode.Text;

            feedDAO.insertFeedbackResponse(studentAdmin, tripID, rate, comments, recommends);

            Response.Redirect("Statistics.aspx");
        }
Пример #24
0
        /// <summary>
        /// insertes user comments
        /// </summary>
        /// <param name="userFeedback">FeedbackDAO</param>
        /// <returns></returns>
        public int InsertProductComment(FeedbackDAO userFeedback)
        {
            IFeedbackDatabaseService feedbackDatabaseService = null;

            try
            {
                feedbackDatabaseService = DBDelegateFactory.Current.FeedbackDatabaseService;
                return(feedbackDatabaseService.InsertProductComment(userFeedback));
            }
            finally
            {
                feedbackDatabaseService = null;
            }
        }
        public ActionResult Delete(int id)
        {
            bool del = new FeedbackDAO().Delete(id);

            if (del)
            {
                SetAlert("Xóa phản hồi thành công", "success");
            }
            else
            {
                SetAlert("Xóa phản hồi không thành công", "error");
            }
            return(RedirectToAction("Index", "Feedback"));
        }
Пример #26
0
 private void btExcluirFeedback_Click(object sender, EventArgs e)
 {
     try
     {
         var         feedback    = (feedbacks)dataGridFeedback.CurrentRow.DataBoundItem; //Pegar linha selecionado
         FeedbackDAO feedbackdao = new FeedbackDAO();
         feedbackdao.excluirFeedback(feedback);
         MessageBox.Show("Registro excluído com sucesso!");
         carregaDadosFeedbacks();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
Пример #27
0
        public ActionResult FilmBoInformation(string id)
        {
            var filmDao           = new FilmDAO();
            var feedbackDao       = new FeedbackDAO();
            var filmEpDao         = new FilmEpisodeDAO();
            var filmModel         = filmDao.getFilmByID(id);
            var feedBackListModel = feedbackDao.listAll(filmModel.filmID);
            var FeedbackOfAcc     = feedbackDao.listAccountFB(filmModel.filmID);

            ViewBag.filmDetail    = filmModel;
            ViewBag.filmFeedBack  = feedBackListModel;
            ViewBag.FeedBackOfAcc = FeedbackOfAcc;
            ViewBag.filmEpisode   = filmEpDao.ListAllEpisodeRelease(filmModel.filmID);
            return(View());
        }
Пример #28
0
        public ActionResult FilmLeInformation(string id)
        {
            var filmDao           = new FilmDAO();
            var epDao             = new FilmEpisodeDAO();
            var feedbackDao       = new FeedbackDAO();
            var filmModel         = filmDao.getFilmByID(id);
            var Epfilm            = epDao.getEpFilmLeByFilmID(id);
            var feedBackListModel = feedbackDao.listAll(filmModel.filmID);
            var FeedbackOfAcc     = feedbackDao.listAccountFB(filmModel.filmID);

            ViewBag.filmDetail    = filmModel;
            ViewBag.EpDetail      = Epfilm;
            ViewBag.filmFeedBack  = feedBackListModel;
            ViewBag.FeedBackOfAcc = FeedbackOfAcc;
            return(View());
        }
Пример #29
0
 // GET: Admin/FeedBack
 public ActionResult Index(string searchFeedBack = "", int page = 1, int pagesize = 2)
 {
     ViewBag.searchFeedBack = searchFeedBack;
     if (searchFeedBack == "")
     {
         FeedbackDAO feedbackDAO = new FeedbackDAO();
         var         feedBack    = feedbackDAO.SelectAll().ToPagedList(page, pagesize);
         return(View(feedBack));
     }
     else
     {
         FeedbackDAO feedbackDAO = new FeedbackDAO();
         var         feedBack    = feedbackDAO.SelectCondition(searchFeedBack).ToPagedList(page, pagesize);
         return(View(feedBack));
     }
 }
Пример #30
0
        public ActionResult Index(Feedback feedBack)
        {
            var dao = new FeedbackDAO();

            if (ModelState.IsValid)
            {
                if (dao.InsertFeedback(feedBack))
                {
                    return(RedirectToAction("Index"));
                }
                else
                {
                    ModelState.AddModelError("", "Have an error when add feedback");
                }
            }
            return(View());
        }