internal override string SaveOrderInfo() { string sql = "orders_Save_Suit"; DbCommand comm = CommDataAccess.DbWriter.GetStoredProcCommand(sql); if (!String.IsNullOrEmpty(this.OrderId) && this.Exists()) { throw new NoName.NetShop.Common.ShopException("订单已经被存储过了"); } else { this.OrderId = CommDataHelper.GetNewSerialStr(AppType.Order); CommDataAccess.DbWriter.AddInParameter(comm, "OrderID", DbType.String, this.OrderId); CommDataAccess.DbWriter.AddInParameter(comm, "PayMethod", DbType.Int32, PayMethodId); CommDataAccess.DbWriter.AddInParameter(comm, "ShipMethod", DbType.Int32, ShipMethodId); CommDataAccess.DbWriter.AddInParameter(comm, "PaySum", DbType.Decimal, TotalSum); CommDataAccess.DbWriter.AddInParameter(comm, "ShipFee", DbType.Decimal, this.ShipFee); CommDataAccess.DbWriter.AddInParameter(comm, "ProductFee", DbType.Decimal, ProductSum); CommDataAccess.DbWriter.AddInParameter(comm, "DerateFee", DbType.Decimal, this.DerateFee); CommDataAccess.DbWriter.AddInParameter(comm, "isNeedInvoice", DbType.Boolean, !String.IsNullOrEmpty(Invoice)); CommDataAccess.DbWriter.AddInParameter(comm, "InvoiceTitle", DbType.String, Invoice); CommDataAccess.DbWriter.AddInParameter(comm, "UserNotes", DbType.String, UserNotes); CommDataAccess.DbWriter.AddInParameter(comm, "serverip", DbType.String, ServerIp); CommDataAccess.DbWriter.AddInParameter(comm, "ClientIp", DbType.String, ClientIp); CommDataAccess.DbWriter.AddInParameter(comm, "OrderType", DbType.Int32, (int)OpType); CommDataAccess.DbWriter.AddInParameter(comm, "userId", DbType.String, Address.UserId); CommDataAccess.DbWriter.AddInParameter(comm, "RecieverName", DbType.String, Address.RecieverName); CommDataAccess.DbWriter.AddInParameter(comm, "RecieverEmail", DbType.String, Address.Email); CommDataAccess.DbWriter.AddInParameter(comm, "RecieverCountry", DbType.String, Address.Country); CommDataAccess.DbWriter.AddInParameter(comm, "RecieverProvince", DbType.String, Address.Province); CommDataAccess.DbWriter.AddInParameter(comm, "RecieverCity", DbType.String, Address.City); CommDataAccess.DbWriter.AddInParameter(comm, "RecieverCounty", DbType.String, Address.County); CommDataAccess.DbWriter.AddInParameter(comm, "RecieverPhone", DbType.String, (Address.Telephone + " " + Address.Mobile).Trim()); CommDataAccess.DbWriter.AddInParameter(comm, "AddressDetial", DbType.String, Address.AddressDetail); CommDataAccess.DbWriter.AddInParameter(comm, "PostalCode", DbType.String, Address.Postalcode); CommDataAccess.DbWriter.AddInParameter(comm, "SuitId", DbType.Int32, this.SuitId); CommDataAccess.DbWriter.ExecuteNonQuery(comm); return(this.OrderId); } }
internal override string SaveOrderInfo() { string sql = "orders_Save_gift"; DbCommand comm = CommDataAccess.DbWriter.GetStoredProcCommand(sql); if (!String.IsNullOrEmpty(this.OrderId) && this.Exists()) { throw new NoName.NetShop.Common.ShopException("订单已经被存储过了"); } else { this.OrderId = CommDataHelper.GetNewSerialStr(AppType.Order); CommDataAccess.DbWriter.AddInParameter(comm, "userId", DbType.String, Address.UserId); CommDataAccess.DbWriter.AddInParameter(comm, "OrderID", DbType.String, this.OrderId); CommDataAccess.DbWriter.AddInParameter(comm, "ShipMethod", DbType.Int32, ShipMethodId); CommDataAccess.DbWriter.AddInParameter(comm, "TotalScore", DbType.Int32, TotalScore); CommDataAccess.DbWriter.AddInParameter(comm, "UserNotes", DbType.String, UserNotes); CommDataAccess.DbWriter.AddInParameter(comm, "serverip", DbType.String, ServerIp); CommDataAccess.DbWriter.AddInParameter(comm, "ClientIp", DbType.String, ClientIp); CommDataAccess.DbWriter.AddInParameter(comm, "OrderType", DbType.Int32, (int)OpType); CommDataAccess.DbWriter.AddInParameter(comm, "RecieverName", DbType.String, Address.RecieverName); CommDataAccess.DbWriter.AddInParameter(comm, "RecieverEmail", DbType.String, Address.Email); CommDataAccess.DbWriter.AddInParameter(comm, "RecieverCountry", DbType.String, Address.Country); CommDataAccess.DbWriter.AddInParameter(comm, "RecieverProvince", DbType.String, Address.Province); CommDataAccess.DbWriter.AddInParameter(comm, "RecieverCity", DbType.String, Address.City); CommDataAccess.DbWriter.AddInParameter(comm, "RecieverCounty", DbType.String, Address.County); CommDataAccess.DbWriter.AddInParameter(comm, "RecieverPhone", DbType.String, (Address.Telephone + " " + Address.Mobile).Trim()); CommDataAccess.DbWriter.AddInParameter(comm, "AddressDetial", DbType.String, Address.AddressDetail); CommDataAccess.DbWriter.AddInParameter(comm, "PostalCode", DbType.String, Address.Postalcode); CommDataAccess.DbWriter.ExecuteNonQuery(comm); MemberInfo.LogScore(Address.UserId, NoName.NetShop.Common.ScoreType.Gift, -this.TotalScore, this.OrderId, "积分礼品兑换订单生成"); return(this.OrderId); } }