/// <summary> /// Copies the elements of the specified <see cref="GoodsleavewordinfoCollection">GoodsleavewordinfoCollection</see> array to the end of the collection. /// </summary> /// <param name="value">An array of type <see cref="GoodsleavewordinfoCollection">GoodsleavewordinfoCollection</see> containing the Components to add to the collection.</param> public void AddRange(Goodsleavewordinfo[] value) { for (int i = 0; (i < value.Length); i = (i + 1)) { this.Add(value[i]); } }
/// <summary> /// 创建留言 /// </summary> /// <param name="goodsleavewordinfo">要创建的留言信息</param> /// <param name="selleruid">卖家id</param> /// <param name="sendnotice">是否发送通知</param> /// <returns></returns> public static int CreateLeaveWord(Goodsleavewordinfo goodsLeaveWordInfo, int sellerUid, bool sendNotice) { goodsLeaveWordInfo.Postdatetime = DateTime.Now; goodsLeaveWordInfo.Usesig = 0; goodsLeaveWordInfo.Invisible = 0; goodsLeaveWordInfo.Htmlon = 0; goodsLeaveWordInfo.Smileyoff = 1; goodsLeaveWordInfo.Parseurloff = 1; goodsLeaveWordInfo.Bbcodeoff = 1; //当为买家时,则发送消息给卖家 if (sendNotice && goodsLeaveWordInfo.Isbuyer == 1) { NoticeInfo noticeInfo = new NoticeInfo(); //商品交易通知 noticeInfo.Note = Utils.HtmlEncode(string.Format("有买家 <a href=\"userinfo.aspx?userid={0}\">{1}</a> 给您留言, 请<a href =\"showgoods.aspx?goodsid={2}\">点击这里</a>查看详情.", goodsLeaveWordInfo.Uid, goodsLeaveWordInfo.Username, sellerUid)); noticeInfo.Uid = sellerUid; noticeInfo.Type = NoticeType.GoodsLeaveWordNotice; noticeInfo.New = 1; noticeInfo.Posterid = goodsLeaveWordInfo.Uid; noticeInfo.Poster = goodsLeaveWordInfo.Username; noticeInfo.Postdatetime = Utils.GetDateTime(); Notices.CreateNoticeInfo(noticeInfo); } return DbProvider.GetInstance().CreateGoodsLeaveWord(goodsLeaveWordInfo); }
/// <summary> /// Gets a value indicating whether the collection contains the specified <see cref="GoodsleavewordinfoCollection">GoodsleavewordinfoCollection</see>. /// </summary> /// <param name="value">The <see cref="GoodsleavewordinfoCollection">GoodsleavewordinfoCollection</see> to search for in the collection.</param> /// <returns><b>true</b> if the collection contains the specified object; otherwise, <b>false</b>.</returns> public bool Contains(Goodsleavewordinfo value) { return this.List.Contains(value); }
public int Add(Goodsleavewordinfo value) { return this.List.Add(value); }
/// <summary> /// Initializes a new instance of the <see cref="GoodsleavewordinfoCollection">GoodsleavewordinfoCollection</see> class containing the specified array of <see cref="GoodsleavewordinfoCollection">GoodsleavewordinfoCollection</see> Components. /// </summary> /// <param name="value">An array of <see cref="GoodsleavewordinfoCollection">GoodsleavewordinfoCollection</see> Components with which to initialize the collection. </param> public GoodsleavewordinfoCollection(Goodsleavewordinfo[] value) { this.AddRange(value); }
/// <summary> /// 更新留言 /// </summary> /// <param name="goodsleaveword">要更新的留言信息</param> /// <returns></returns> public bool UpdateGoodsLeaveWord(Goodsleavewordinfo goodsLeaveWord) { DbParameter[] parms = { DbHelper.MakeInParam("@goodsid", (DbType)SqlDbType.Int, 4,goodsLeaveWord.Goodsid), DbHelper.MakeInParam("@tradelogid", (DbType)SqlDbType.Int, 4,goodsLeaveWord.Tradelogid), DbHelper.MakeInParam("@isbuyer", (DbType)SqlDbType.TinyInt, 1,goodsLeaveWord.Isbuyer), DbHelper.MakeInParam("@uid", (DbType)SqlDbType.Int, 4,goodsLeaveWord.Uid), DbHelper.MakeInParam("@username", (DbType)SqlDbType.NChar, 20,goodsLeaveWord.Username), DbHelper.MakeInParam("@message", (DbType)SqlDbType.NChar, 200,goodsLeaveWord.Message), DbHelper.MakeInParam("@invisible", (DbType)SqlDbType.Int, 4,goodsLeaveWord.Invisible), DbHelper.MakeInParam("@ip", (DbType)SqlDbType.NVarChar, 15,goodsLeaveWord.Ip), DbHelper.MakeInParam("@usesig", (DbType)SqlDbType.Int, 4,goodsLeaveWord.Usesig), DbHelper.MakeInParam("@htmlon", (DbType)SqlDbType.Int, 4,goodsLeaveWord.Htmlon), DbHelper.MakeInParam("@smileyoff", (DbType)SqlDbType.Int, 4,goodsLeaveWord.Smileyoff), DbHelper.MakeInParam("@parseurloff", (DbType)SqlDbType.Int, 4,goodsLeaveWord.Parseurloff), DbHelper.MakeInParam("@bbcodeoff", (DbType)SqlDbType.Int, 4,goodsLeaveWord.Bbcodeoff), DbHelper.MakeInParam("@postdatetime", (DbType)SqlDbType.DateTime, 8,goodsLeaveWord.Postdatetime), DbHelper.MakeInParam("@id", (DbType)SqlDbType.Int, 4,goodsLeaveWord.Id) }; string commandText = String.Format("Update [{0}goodsleavewords] Set [goodsid] = @goodsid, [tradelogid] = @tradelogid, [isbuyer] = @isbuyer, [uid] = @uid, [username] = @username, [message] = @message, [invisible] = @invisible, [ip] = @ip, [usesig] = @usesig, [htmlon] = @htmlon, [smileyoff] = @smileyoff, [parseurloff] = @parseurloff, [bbcodeoff] = @bbcodeoff, [postdatetime] = @postdatetime WHERE [id] = @id", BaseConfigs.GetTablePrefix); DbHelper.ExecuteNonQuery(CommandType.Text, commandText, parms); return true; }
/// <summary> /// 创建留言 /// </summary> /// <param name="goodsleavewordinfo">要创建的留言信息</param> /// <param name="selleruid">卖家id</param> /// <returns></returns> public static int CreateLeaveWord(Goodsleavewordinfo goodsLeaveWordInfo, int sellerUid) { return CreateLeaveWord(goodsLeaveWordInfo, sellerUid, true); }
/// <summary> /// 获得商品留言信息(DTO) /// </summary> /// <param name="__idatareader">要转换的数据</param> /// <returns>返回商品留言信息</returns> public static GoodsleavewordinfoCollection GetGoodsLeaveWordInfoList(IDataReader reader) { GoodsleavewordinfoCollection goodsLeaveWordInfoColl = new GoodsleavewordinfoCollection(); while (reader.Read()) { Goodsleavewordinfo goodsLeaveWordInfo = new Goodsleavewordinfo(); goodsLeaveWordInfo.Id = TypeConverter.ObjectToInt(reader["id"]); goodsLeaveWordInfo.Goodsid = TypeConverter.ObjectToInt(reader["goodsid"]); goodsLeaveWordInfo.Tradelogid = TypeConverter.ObjectToInt(reader["tradelogid"]); goodsLeaveWordInfo.Isbuyer = Convert.ToInt16(reader["isbuyer"].ToString()); goodsLeaveWordInfo.Uid = TypeConverter.ObjectToInt(reader["uid"]); goodsLeaveWordInfo.Username = reader["username"].ToString().Trim(); goodsLeaveWordInfo.Message = reader["message"].ToString().Trim(); goodsLeaveWordInfo.Invisible = TypeConverter.ObjectToInt(reader["invisible"]); goodsLeaveWordInfo.Ip = reader["ip"].ToString().Trim(); goodsLeaveWordInfo.Usesig = TypeConverter.ObjectToInt(reader["usesig"]); goodsLeaveWordInfo.Htmlon = TypeConverter.ObjectToInt(reader["htmlon"]); goodsLeaveWordInfo.Smileyoff = TypeConverter.ObjectToInt(reader["smileyoff"]); goodsLeaveWordInfo.Parseurloff = TypeConverter.ObjectToInt(reader["parseurloff"]); goodsLeaveWordInfo.Bbcodeoff = TypeConverter.ObjectToInt(reader["bbcodeoff"]); goodsLeaveWordInfo.Postdatetime = Convert.ToDateTime(reader["postdatetime"].ToString()); goodsLeaveWordInfoColl.Add(goodsLeaveWordInfo); } reader.Close(); return goodsLeaveWordInfoColl; }
public int IndexOf(Goodsleavewordinfo value) { return(base.List.IndexOf(value)); }
public bool Contains(Goodsleavewordinfo value) { return(base.List.Contains(value)); }
public int Add(Goodsleavewordinfo value) { return(base.List.Add(value)); }
public void Remove(Goodsleavewordinfo value) { base.List.Remove(value); }
public void Insert(int index, Goodsleavewordinfo value) { base.List.Insert(index, value); }
protected override void ShowPage() { if (config.Enablemall == 0) //未启用交易服务 { AddErrLine("系统未开启交易服务, 当前页面暂时无法访问!"); return; } headerad = ""; footerad = ""; // 如果商品交易日志不正确 if (goodstradelogid <= 0) { AddErrLine("无效的交易日志信息."); return; } goodstradelog = TradeLogs.GetGoodsTradeLogInfo(goodstradelogid); int oldstatus = goodstradelog.Status; if (config.Enablemall == 1) //开启普通模式 { forumid = GoodsCategories.GetCategoriesFid(goodstradelog.Categoryid); forum = Forums.GetForumInfo(forumid); forumname = forum.Name; forumnav = ForumUtils.UpdatePathListExtname(forum.Pathlist.Trim(), config.Extname); } else if (config.Enablemall == 2) //当为高级模式时 forumid = 0; ///得到广告列表 ///头部 headerad = Advertisements.GetOneHeaderAd("", forumid); footerad = Advertisements.GetOneFooterAd("", forumid); doublead = Advertisements.GetDoubleAd("", forumid); floatad = Advertisements.GetFloatAd("", forumid); pagetitle = goodstradelog.Subject; navhomemenu = Caches.GetForumListMenuDivCache(usergroupid, userid, config.Extname); if (useradminid != 0) { if (config.Enablemall == 1) //开启普通模式 ismoder = Moderators.IsModer(useradminid, userid, forumid) ? 1 : 0; //得到管理组信息 admininfo = AdminGroups.GetAdminGroupInfo(usergroupid); } //验证不通过则返回 if (!IsConditionsValid()) return; goodsleavewordlist = GoodsLeaveWords.GetLeaveWordList(goodstradelog.Id); if (goodstradelog.Status == 7 || goodstradelog.Status == 17) israted = GoodsRates.CanRate(goodstradelog.Id, userid) ? false : true; //如果当前用户已评价过则不允许再评价 //如果是提交则更新商品交易日志 if (ispost && goodstradelog.Status >= 0) { if (ForumUtils.IsCrossSitePost()) { AddErrLine("您的请求来路不正确,无法提交。如果您安装了某种默认屏蔽来路信息的个人防火墙软件(如 Norton Internet Security),请设置其不要禁止来路信息后再试。"); return; } //当要验证密码时 if (DNTRequest.GetInt("status", -1) > 0 && IsVerifyPassWord(goodstradelog.Status)) { if (Utils.StrIsNullOrEmpty(DNTRequest.GetString("password"))) { AddErrLine("密码不能为空, 请返回填写."); return; } int uid = -1; if (config.Passwordmode == 1) uid = Users.CheckDvBbsPassword(base.username, DNTRequest.GetString("password")); else uid = Users.CheckPassword(username, DNTRequest.GetString("password"), true); if (uid < 0) { AddErrLine("您输入的密码不正确, 不能修改订单状态, 请返回修改."); return; } //当验证密码正确后,则发送相应留言 Goodsleavewordinfo goodsleavewordinfo = new Goodsleavewordinfo(); goodsleavewordinfo.Ip = DNTRequest.GetIP(); goodsleavewordinfo.Goodsid = goodstradelog.Goodsid; goodsleavewordinfo.Tradelogid = goodstradelog.Id; goodsleavewordinfo.Uid = userid; goodsleavewordinfo.Username = username; goodsleavewordinfo.Message = DNTRequest.GetString("message"); goodsleavewordinfo.Isbuyer = buyerleaveword; GoodsLeaveWords.CreateLeaveWord(goodsleavewordinfo, goodsinfo.Selleruid); } goodstradelog.Status = DNTRequest.GetInt("status", -1); if (goodstradelog.Status == 0) { //当为买家时 if (isbuyer) { goodstradelog.Quality = goodsinfo.Quality; goodstradelog.Categoryid = goodsinfo.Categoryid; goodstradelog.Tax = 0; goodstradelog.Locus = goodsinfo.Locus; goodstradelog.Seller = goodsinfo.Seller; goodstradelog.Sellerid = goodsinfo.Selleruid; goodstradelog.Selleraccount = goodsinfo.Account; goodstradelog.Buyerid = userid; goodstradelog.Buyer = username; goodstradelog.Buyercontact = DNTRequest.GetString("buyercontact"); goodstradelog.Buyercredit = 0; goodstradelog.Buyermsg = DNTRequest.GetString("buyermsg"); goodstradelog.Lastupdate = DateTime.Now; goodstradelog.Buyername = DNTRequest.GetString("buyername"); goodstradelog.Buyerzip = DNTRequest.GetString("buyerzip"); goodstradelog.Buyerphone = DNTRequest.GetString("buyerphone"); goodstradelog.Buyermobile = DNTRequest.GetString("buyermobile"); goodstradelog.Transport = goodsinfo.Transport; goodstradelog.Baseprice = goodsinfo.Costprice; goodstradelog.Discount = goodsinfo.Discount; goodstradelog.Ratestatus = 0; goodstradelog.Message = ""; } if (isseller) //当为卖家时 goodstradelog.Transportfee = DNTRequest.GetInt("fee", 0); } if (TradeLogs.UpdateTradeLog(goodstradelog, oldstatus, true)) { SetUrl("offlinetrade.aspx?goodstradelogid=" + goodstradelogid); SetMetaRefresh(); AddMsgLine("交易单已更新, 现在转入交易单页面<br />(<a href=\"" + "offlinetrade.aspx?goodstradelogid=" + goodstradelogid + "\">如果您的浏览器没有自动跳转, 请点击这里</a>)<br />"); } } }
/// <summary> /// Copies the collection Components to a one-dimensional <see cref="T:System.Array">Array</see> instance beginning at the specified index. /// </summary> /// <param name="array">The one-dimensional <see cref="T:System.Array">Array</see> that is the destination of the values copied from the collection.</param> /// <param name="index">The index of the array at which to begin inserting.</param> public void CopyTo(Goodsleavewordinfo[] array, int index) { this.List.CopyTo(array, index); }
/// <summary> /// 更新指定的留言信息 /// </summary> /// <param name="goodsleavewordinfo">要更新的留言信息</param> /// <returns></returns> public static bool UpdateLeaveWord(Goodsleavewordinfo goodsLeaveWordInfo) { return DbProvider.GetInstance().UpdateGoodsLeaveWord(goodsLeaveWordInfo); }
/// <summary> /// Gets the index in the collection of the specified <see cref="GoodsleavewordinfoCollection">GoodsleavewordinfoCollection</see>, if it exists in the collection. /// </summary> /// <param name="value">The <see cref="GoodsleavewordinfoCollection">GoodsleavewordinfoCollection</see> to locate in the collection.</param> /// <returns>The index in the collection of the specified object, if found; otherwise, -1.</returns> public int IndexOf(Goodsleavewordinfo value) { return this.List.IndexOf(value); }
/// <summary> /// 获得商品留言信息(DTO) /// </summary> /// <param name="dt">要转换的数据表</param> /// <returns>返回商品留言信息</returns> public static Goodsleavewordinfo[] GetGoodsLeaveWordInfoArray(DataTable dt) { if (dt == null || dt.Rows.Count == 0) return null; Goodsleavewordinfo[] goodsLeaveWordInfoArray = new Goodsleavewordinfo[dt.Rows.Count]; for (int i = 0; i < dt.Rows.Count; i++) { goodsLeaveWordInfoArray[i] = new Goodsleavewordinfo(); goodsLeaveWordInfoArray[i].Id = TypeConverter.ObjectToInt(dt.Rows[i]["id"]); goodsLeaveWordInfoArray[i].Goodsid = TypeConverter.ObjectToInt(dt.Rows[i]["goodsid"]); goodsLeaveWordInfoArray[i].Tradelogid = TypeConverter.ObjectToInt(dt.Rows[i]["tradelogid"]); goodsLeaveWordInfoArray[i].Isbuyer = TypeConverter.ObjectToInt(dt.Rows[i]["isbuyer"]); goodsLeaveWordInfoArray[i].Uid = TypeConverter.ObjectToInt(dt.Rows[i]["uid"]); goodsLeaveWordInfoArray[i].Username = dt.Rows[i]["username"].ToString(); goodsLeaveWordInfoArray[i].Message = dt.Rows[i]["message"].ToString(); goodsLeaveWordInfoArray[i].Invisible = TypeConverter.ObjectToInt(dt.Rows[i]["invisible"]); goodsLeaveWordInfoArray[i].Ip = dt.Rows[i]["ip"].ToString(); goodsLeaveWordInfoArray[i].Usesig = TypeConverter.ObjectToInt(dt.Rows[i]["usesig"]); goodsLeaveWordInfoArray[i].Htmlon = TypeConverter.ObjectToInt(dt.Rows[i]["htmlon"]); goodsLeaveWordInfoArray[i].Smileyoff = TypeConverter.ObjectToInt(dt.Rows[i]["smileyoff"]); goodsLeaveWordInfoArray[i].Parseurloff = TypeConverter.ObjectToInt(dt.Rows[i]["parseurloff"]); goodsLeaveWordInfoArray[i].Bbcodeoff = TypeConverter.ObjectToInt(dt.Rows[i]["bbcodeoff"]); goodsLeaveWordInfoArray[i].Postdatetime = Convert.ToDateTime(dt.Rows[i]["postdatetime"].ToString()); } dt.Dispose(); return goodsLeaveWordInfoArray; }
public void Insert(int index, Goodsleavewordinfo value) { List.Insert(index, value); }
public void Remove(Goodsleavewordinfo value) { List.Remove(value); }
/// <summary> /// 创建留言 /// </summary> /// <param name="goodsleaveword">要创建的留言信息</param> /// <returns></returns> public int CreateGoodsLeaveWord(Goodsleavewordinfo goodsLeaveWord) { DbParameter[] parms = { DbHelper.MakeInParam("@goodsid", (DbType)SqlDbType.Int, 4,goodsLeaveWord.Goodsid), DbHelper.MakeInParam("@tradelogid", (DbType)SqlDbType.Int, 4,goodsLeaveWord.Tradelogid), DbHelper.MakeInParam("@isbuyer", (DbType)SqlDbType.TinyInt, 1,goodsLeaveWord.Isbuyer), DbHelper.MakeInParam("@uid", (DbType)SqlDbType.Int, 4,goodsLeaveWord.Uid), DbHelper.MakeInParam("@username", (DbType)SqlDbType.NChar, 20,goodsLeaveWord.Username), DbHelper.MakeInParam("@message", (DbType)SqlDbType.NChar, 200,goodsLeaveWord.Message), DbHelper.MakeInParam("@invisible", (DbType)SqlDbType.Int, 4,goodsLeaveWord.Invisible), DbHelper.MakeInParam("@ip", (DbType)SqlDbType.NVarChar, 15,goodsLeaveWord.Ip), DbHelper.MakeInParam("@usesig", (DbType)SqlDbType.Int, 4,goodsLeaveWord.Usesig), DbHelper.MakeInParam("@htmlon", (DbType)SqlDbType.Int, 4,goodsLeaveWord.Htmlon), DbHelper.MakeInParam("@smileyoff", (DbType)SqlDbType.Int, 4,goodsLeaveWord.Smileyoff), DbHelper.MakeInParam("@parseurloff", (DbType)SqlDbType.Int, 4,goodsLeaveWord.Parseurloff), DbHelper.MakeInParam("@bbcodeoff", (DbType)SqlDbType.Int, 4,goodsLeaveWord.Bbcodeoff), DbHelper.MakeInParam("@postdatetime", (DbType)SqlDbType.DateTime, 8,goodsLeaveWord.Postdatetime) }; string commandText = String.Format("INSERT INTO [{0}goodsleavewords] ([goodsid], [tradelogid], [isbuyer], [uid], [username], [message], [invisible], [ip], [usesig], [htmlon], [smileyoff], [parseurloff], [bbcodeoff], [postdatetime]) VALUES (@goodsid, @tradelogid, @isbuyer, @uid, @username, @message, @invisible, @ip, @usesig, @htmlon, @smileyoff, @parseurloff, @bbcodeoff, @postdatetime);SELECT SCOPE_IDENTITY() AS 'id'", BaseConfigs.GetTablePrefix); return TypeConverter.ObjectToInt(DbHelper.ExecuteDataset(CommandType.Text, commandText, parms).Tables[0].Rows[0][0], -1); }