示例#1
0
 protected void lnk_Delete_Click(object sender, System.EventArgs e)
 {
     if (!base.IsAuthorizedOp(ActionType.Delete.ToString()))
     {
         base.ShowAjaxMsg(this.UpdatePanel1, "Không có thẩm quyền");
     }
     else
     {
         int         @int     = WebUtils.GetInt((sender as LinkButton).CommandArgument);
         GoodsQAInfo dataById = SinGooCMS.BLL.GoodsQA.GetDataById(@int);
         if (dataById == null)
         {
             base.ShowAjaxMsg(this.UpdatePanel1, "Những thông tin này không được tìm thấy, các dữ liệu không tồn tại hoặc đã bị xóa");
         }
         else if (SinGooCMS.BLL.GoodsQA.Delete(@int))
         {
             this.BindData();
             PageBase.log.AddEvent(base.LoginAccount.AccountName, "删除商品咨询成功");
             base.ShowAjaxMsg(this.UpdatePanel1, "Thao tác thành công");
         }
         else
         {
             base.ShowAjaxMsg(this.UpdatePanel1, "Thao tác thất bại");
         }
     }
 }
示例#2
0
        public static int Add(GoodsQAInfo entity)
        {
            int result;

            if (entity == null)
            {
                result = 0;
            }
            else
            {
                result = BizBase.dbo.InsertModel <GoodsQAInfo>(entity);
            }
            return(result);
        }
示例#3
0
 protected void btnok_Click(object sender, System.EventArgs e)
 {
     if (base.Action.Equals("Reply") && !base.IsAuthorizedOp("Reply"))
     {
         base.ShowMsg("Không có thẩm quyền");
     }
     else
     {
         GoodsQAInfo dataById = SinGooCMS.BLL.GoodsQA.GetDataById(base.OpID);
         dataById.Answer = base.Server.HtmlEncode(this.txtReply.Text);
         if (SinGooCMS.BLL.GoodsQA.Update(dataById))
         {
             PageBase.log.AddEvent(base.LoginAccount.AccountName, "回复商品咨询成功");
             MessageUtils.DialogCloseAndParentReload(this);
         }
         else
         {
             base.ShowMsg("Thao tác thất bại");
         }
     }
 }
示例#4
0
        private void SendGoodsQA()
        {
            ProductInfo dataById   = Product.GetDataById(WebUtils.GetFormInt("proid"));
            string      formString = WebUtils.GetFormString("question");

            if (dataById == null)
            {
                base.WriteJsonTip(false, "商品不存在或者已删除", "");
            }
            else if (base.UserID == -1)
            {
                base.WriteJsonTip(false, "会员没有登录", "");
            }
            else if (string.IsNullOrEmpty(formString))
            {
                base.WriteJsonTip(false, "请输入问题内容", "");
            }
            else
            {
                GoodsQAInfo entity = new GoodsQAInfo
                {
                    ProductID     = dataById.AutoID,
                    ProductName   = dataById.ProductName,
                    UserName      = base.UserName,
                    Question      = formString,
                    Answer        = string.Empty,
                    IsShow        = true,
                    AutoTimeStamp = System.DateTime.Now
                };
                if (GoodsQA.Add(entity) > 0)
                {
                    base.WriteJsonTip(true, "问题提交成功!我们将尽快回复你。", "");
                }
                else
                {
                    base.WriteJsonTip(false, "Thao tác thất bại!", "");
                }
            }
        }
示例#5
0
 private void InitForModify()
 {
     this.qa            = SinGooCMS.BLL.GoodsQA.GetDataById(base.OpID);
     this.txtReply.Text = this.qa.Answer;
 }
示例#6
0
 public static bool Update(GoodsQAInfo entity)
 {
     return(entity != null && BizBase.dbo.UpdateModel <GoodsQAInfo>(entity));
 }