private void FeedbackDataBind() { IList <OrderFeedbackInfo> list = OrderFeedback.GetList(DataConverter.CLng(this.OrderId)); IList <OrderFeedbackInfo> list2 = new List <OrderFeedbackInfo>(); foreach (OrderFeedbackInfo info in list) { string replyName = info.ReplyName; info.ReplyName = string.Empty; list2.Add(info); if (!string.IsNullOrEmpty(info.ReplyContent)) { OrderFeedbackInfo item = new OrderFeedbackInfo(); item.Content = "管理员回复:" + info.ReplyContent; item.ReplyName = replyName; item.WriteTime = info.ReplyTime; item.ReplyContent = info.ReplyContent; item.Id = info.Id; list2.Add(item); } } this.EgvFeedback.DataSource = list2; this.EgvFeedback.DataBind(); if (this.ShowOptions == 1) { this.EgvFeedback.Columns[2].Visible = false; this.EgvFeedback.Columns[3].Visible = false; } }
public bool Update(OrderFeedbackInfo orderFeedbackInfo) { Parameters cmdParams = GetParameters(orderFeedbackInfo); cmdParams.AddInParameter("@ID", DbType.Int32, orderFeedbackInfo.Id); return(DBHelper.ExecuteSql("UPDATE PE_OrderFeedback SET OrderID = @OrderID, UserName = @UserName, Content = @Content, WriteTime = @WriteTime, ReplyName = @ReplyName, ReplyContent = @ReplyContent, ReplyTime = @ReplyTime WHERE ID = @ID ", cmdParams)); }
private static Parameters GetParameters(OrderFeedbackInfo orderFeedbackInfo) { Parameters parameters = new Parameters(); parameters.AddInParameter("@OrderID", DbType.Int32, orderFeedbackInfo.OrderId); parameters.AddInParameter("@UserName", DbType.String, orderFeedbackInfo.UserName); parameters.AddInParameter("@Content", DbType.String, orderFeedbackInfo.Content); parameters.AddInParameter("@WriteTime", DbType.DateTime, orderFeedbackInfo.WriteTime); parameters.AddInParameter("@ReplyName", DbType.String, orderFeedbackInfo.ReplyName); parameters.AddInParameter("@ReplyContent", DbType.String, orderFeedbackInfo.ReplyContent); parameters.AddInParameter("@ReplyTime", DbType.DateTime, orderFeedbackInfo.ReplyTime); return(parameters); }
private static OrderFeedbackInfo GetOrderFeedbackInfoFromrdr(NullableDataReader rdr) { OrderFeedbackInfo info = new OrderFeedbackInfo(); info.Id = rdr.GetInt32("ID"); info.OrderId = rdr.GetInt32("OrderID"); info.UserName = rdr.GetString("UserName"); info.Content = rdr.GetString("Content"); info.WriteTime = rdr.GetDateTime("WriteTime"); info.ReplyName = rdr.GetString("ReplyName"); info.ReplyContent = rdr.GetString("ReplyContent"); info.ReplyTime = rdr.GetDateTime("ReplyTime"); return(info); }
protected void EgvFeedback_RowCommand(object sender, CommandEventArgs e) { string commandName = e.CommandName; if (commandName != null) { if (!(commandName == "Del")) { if (!(commandName == "DelReply")) { if (commandName == "ReplyContent") { BaseUserControl.ResponseRedirect("OrderFeedbackModify.aspx?Action=ReplyContent&ID=" + e.CommandArgument.ToString()); } return; } } else { if (OrderFeedback.Delete(e.CommandArgument.ToString())) { BaseUserControl.WriteSuccessMsg("删除反馈信息成功", "OrderManage.aspx?OrderID=" + this.OrderId); return; } BaseUserControl.WriteErrMsg("删除反馈信息失败"); return; } OrderFeedbackInfo orderFeedbackById = OrderFeedback.GetOrderFeedbackById(DataConverter.CLng(e.CommandArgument)); if (!orderFeedbackById.IsNull) { orderFeedbackById.ReplyContent = string.Empty; orderFeedbackById.ReplyName = string.Empty; } if (OrderFeedback.Update(orderFeedbackById)) { BaseUserControl.WriteSuccessMsg("删除回复信息成功!", "OrderManage.aspx?OrderID=" + this.OrderId); } else { BaseUserControl.WriteErrMsg("删除回复信息失败!"); } } }
public static bool Update(OrderFeedbackInfo orderFeedbackInfo) { return(dal.Update(orderFeedbackInfo)); }
public static bool Add(OrderFeedbackInfo orderFeedbackInfo) { return(dal.Add(orderFeedbackInfo)); }
public bool Add(OrderFeedbackInfo orderFeedbackInfo) { Parameters cmdParams = GetParameters(orderFeedbackInfo); return(DBHelper.ExecuteSql("INSERT INTO PE_OrderFeedback (OrderID, UserName, Content, WriteTime, ReplyName, ReplyContent, ReplyTime) VALUES (@OrderID, @UserName, @Content, @WriteTime, @ReplyName, @ReplyContent, @ReplyTime)", cmdParams)); }