Beispiel #1
0
    private void LoadFeedback()
    {
        FeedBackBLL          fbb   = new FeedBackBLL();
        int                  total = 0;
        List <FeedBackModel> list  = new List <FeedBackModel>();

        if (Common.CheckPermission(Common.Module_Feedback, Common.Permission_View, HttpContext.Current))
        {
            try
            {
                if (user.Type == AdminType.Managers)
                {
                    fbb.GetFeedBackList(1, 5, null, null, null, null, null, out total, out list);
                }
                else
                {
                    fbb.GetFeedBackList(1, 5, null, null, null, user.AdminId, true, out total, out list);
                }

                for (int i = 0; i < list.Count; i++)
                {
                    FeedBackModel model = list[i];
                    fbbody = fbbody + "<tr><td>" + model.CreateTime + "</td><td><a target=\"_blank\" href=\"feedback.aspx?id=" + model.Title + "\">" + model.Title + "</a></td></tr>";
                }
            }
            catch (Exception ex)
            {
                WriteLog.WriteExceptionLog("LoadFeedback", ex);
            }
        }
        else
        {
            feedbackpl.Visible = false;
        }
    }
Beispiel #2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!Common.CheckPermission(Common.Module_Feedback, Common.Permission_View, HttpContext.Current))
     {
         Response.Redirect("nopermission.aspx");
     }
     else
     {
         string idstr = Request.QueryString["id"];
         int    id    = 0;
         int.TryParse(idstr, out id);
         if (id > 0)
         {
             FeedBackBLL          fbb   = new FeedBackBLL();
             int                  total = 0;
             List <FeedBackModel> list  = new List <FeedBackModel>();
             fbb.GetFeedBackList(1, 1, id, null, null, null, null, out total, out list);
             if (list.Count == 1)
             {
                 FeedBackModel model = list[0];
                 title_txt.Text   = model.Title;
                 content_txt.Text = model.Content;
                 contact_txt.Text = model.Name;
                 mobile_txt.Text  = model.Mobile;
                 email_txt.Text   = model.Email;
                 date_txt.Text    = string.Format("{0:yyyy-MM-dd}", model.CreateTime);
             }
         }
     }
 }
        public JsonResult Send(FeedBackDTO feedbackDTO)
        {
            var feedback = new FeedBack
            {
                Name    = feedbackDTO.Name,
                Email   = feedbackDTO.Email,
                Phone   = feedbackDTO.Phone,
                Content = HttpUtility.HtmlEncode(feedbackDTO.Content),
                Address = feedbackDTO.Address
            };
            var result = FeedBackBLL.InsertFeedback(feedback);

            return(result > 0 ? Json(new { status = true }, JsonRequestBehavior.AllowGet) :
                   Json(new { status = false }, JsonRequestBehavior.AllowGet));
        }