Exemplo n.º 1
0
        void Feedback()
        {
            BLL.dt_feedback bll     = new BLL.dt_feedback();
            string          title   = request["title"];
            string          content = request["content"];

            try {
                Model.dt_feedback item = new Model.dt_feedback
                {
                    Title     = title,
                    Content   = content,
                    AddTime   = DateTime.Now,
                    IsDel     = 0,
                    ManagerId = 2
                };
                int re = bll.Add(item);
                if (re > 0)
                {
                    this.res = JsonHelper2.GetCommonObj(0, "反馈成功");
                }
                else
                {
                    this.res = JsonHelper2.GetCommonObj(1, "反馈失败");
                }
            }catch (Exception ex)
            {
                Log.Error(ex.Message);
                this.res = JsonHelper2.GetCommonObj(1, "系统异常");
            }
        }
Exemplo n.º 2
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            string name = txtUserName.Value;
            string sex  = "男";

            if (radio2.Checked == true)
            {
                sex = "女";
            }
            string mobile          = txtPhone.Value;
            string telNuM          = txtTel.Value;
            string EmailValue      = txtEmail.Value;
            string NoteBookContent = txtContent.Value;
            string zhuzhi          = Request.Form["chkZhuZhi"];
            string DiDian          = Request.Form["dpProvince"] + "|";

            DiDian += Request.Form["dpCity"] + "|";
            DiDian += txtWrite.Value;
            string ClassName = Request.Form["chkCatagory"];
            string GongNeng  = Request.Form["chkFunction"];
            string Money     = txtOwer.Value;
            string MianJi    = txtOwerTel.Value;

            Model.dt_feedback Model = new Model.dt_feedback();
            Model.UserID     = WEBUserCurrent.UserID;
            Model.user_name  = name;
            Model.user_qq    = sex;
            Model.user_tel   = mobile;
            Model.title      = telNuM;
            Model.user_email = EmailValue;
            Model.content    = NoteBookContent;
            Model.zhuzhi     = zhuzhi;
            //if (Model.zhuzhi == "介紹房屋出售")
            //{
            //    BLL.users User = new BLL.users();
            //    User.UpPoint(WEBUserCurrent.UserID, 5000);
            //}
            Model.user_Address  = DiDian;
            Model.user_Class    = ClassName;
            Model.user_Function = GongNeng;
            Model.user_Money    = Money;
            Model.user_MianJi   = MianJi;
            BLL.dt_feedback bll = new BLL.dt_feedback();

            bll.Add(Model);

            this.Page.ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('留言添加成功');window.location.href='index.aspx'</script>");
        }
Exemplo n.º 3
0
 protected void btnDelete_Click(object sender, EventArgs e)
 {
     ChkAdminLevel("orders", DTEnums.ActionEnum.Delete.ToString()); //檢查許可權
     BLL.dt_feedback bll = new BLL.dt_feedback();
     for (int i = 0; i < rptList.Items.Count; i++)
     {
         int      id = Convert.ToInt32(((HiddenField)rptList.Items[i].FindControl("hidId")).Value);
         CheckBox cb = (CheckBox)rptList.Items[i].FindControl("chkId");
         if (cb.Checked)
         {
             Model.dt_feedback model = bll.GetModel(id);
             if (model != null)
             {
                 bll.Delete(id);
             }
         }
     }
     JscriptMsg("留言已刪除!", Utils.CombUrlTxt("NoteBook.aspx", "keywords={0}", this.keywords), "Success");
 }
Exemplo n.º 4
0
        private void LoadNoteBook(int ID)
        {
            AreaDal dal = new AreaDal();

            Model.Area        modelArea = new Model.Area();
            Model.dt_feedback Model     = bllNot.GetModel(ID);
            chkPointValue.Value = Model.user_Function;
            if (Model.user_Function == "是")
            {
                chkPoint.Checked = true;
            }
            else
            {
                chkPoint.Checked = false;
            }
            lblName.Text = Model.user_name;
            lblsex.Text  = Model.user_qq;

            lblPhone.Text    = Model.user_tel;
            lbluser_tel.Text = Model.title;
            lblEmail.Text    = Model.user_email;
            lblContent.Text  = Model.content;
            lblZhuZhi.Text   = Model.zhuzhi;
            string DiDian  = Model.user_Address;
            string Address = string.Empty;

            if (!string.IsNullOrEmpty(DiDian))
            {
                if (DiDian.IndexOf('|') > 0)
                {
                    string[] addList = DiDian.Split('|');
                    for (int i = 0; i < addList.Length; i++)
                    {
                        if (!string.IsNullOrEmpty(addList[i].ToString()))
                        {
                            int AreaID = int.Parse(addList[i].ToString());
                            modelArea = dal.GetModel(AreaID);
                            if (modelArea != null)
                            {
                                if (i > 0)
                                {
                                    Address += "-";
                                }
                                Address += modelArea.title;
                            }
                        }
                    }
                }
            }
            lblAdress.Text    = Address;
            lblClassName.Text = Model.user_Class;
            //lblFunction.Text = Model.user_Function;
            lblMoney.Text  = Model.user_Money.ToString();
            lblMianJi.Text = Model.user_MianJi.ToString();

            if (Model.zhuzhi == "介紹房屋出售")
            {
                p1.Visible = true;
            }
            else
            {
                p1.Visible = false;
            }
            lblReplayContent.Text = Model.reply_content;
        }
Exemplo n.º 5
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(chkPointValue.Value) || chkPointValue.Value == "否")
            {
                if (chkPoint.Checked == true)
                {
                    //model.point = point + 5000;
                    BLL.users BLLUser = new BLL.users();
                    if (!string.IsNullOrEmpty(lblEmail.Text))
                    {
                        if (BLLUser.ExistsEmail(lblEmail.Text))
                        {
                            int UID = BLLUser.GetIDByExistsEmail(lblEmail.Text);
                            BLLUser.UpPoint(UID, 5000);

                            BLL.point_log   point = new BLL.point_log();
                            Model.point_log model = new Model.point_log();
                            model.user_id   = UID;
                            model.user_name = "";
                            model.value     = 5000;
                            model.remark    = "介紹房屋出售";
                            model.add_time  = DateTime.Now;
                            model.type      = 1;//2標誌點數是減少
                            int m = point.Add(model);
                        }
                    }
                }
            }
            else if (chkPointValue.Value == "是")
            {
                if (chkPoint.Checked == false)
                {
                    BLL.users BLLUser = new BLL.users();
                    if (!string.IsNullOrEmpty(lblEmail.Text))
                    {
                        if (BLLUser.ExistsEmail(lblEmail.Text))
                        {
                            int UID = BLLUser.GetIDByExistsEmail(lblEmail.Text);
                            BLLUser.UpJianPoint(UID, 5000);

                            BLL.point_log   point = new BLL.point_log();
                            Model.point_log model = new Model.point_log();
                            model.user_id   = UID;
                            model.user_name = "";
                            model.value     = 5000;
                            model.remark    = "取消介紹房屋出售點數";
                            model.type      = 2;//2標誌點數是減少
                            model.add_time  = DateTime.Now;

                            int m = point.Add(model);
                        }
                    }
                }
            }

            string replayContent = txtReContent.Text.Trim();

            Model.dt_feedback feedback = new Model.dt_feedback();
            if (chkPoint.Checked == true)
            {
                feedback.user_Function = "是";
            }
            else
            {
                feedback.user_Function = "否";
            }

            feedback.reply_content = replayContent;
            feedback.reply_time    = DateTime.Now;
            feedback.id            = int.Parse(Request.QueryString["id"].ToString());
            if (bllNot.Update(feedback))
            {
                setEmail();
                Response.Redirect("admin/NoteBook.aspx");
                JscriptMsg("留言回覆成功!", "admin/NoteBook.aspx.aspx", "Success");
            }
        }