public IList <Model.TD_Shop_Order> GetUnPayOrder() { string sql = "SELECT OrderID FROM TD_Shop_Order WHERE IsPay='0' and OrderTime<@Time"; MySqlParameter[] parameters = { new MySqlParameter("@Time", DateTime.Now.AddHours(-1)) }; IList <ShiMiao.Model.TD_Shop_Order> list = new List <ShiMiao.Model.TD_Shop_Order>(); using (DbDataReader dr = MySqlHelperUtil.ExecuteReader(sql, parameters)) { while (dr.Read()) { ShiMiao.Model.TD_Shop_Order model = new ShiMiao.Model.TD_Shop_Order(); if (dr[0] != DBNull.Value) { model.OrderID = dr.GetString(0); } list.Add(model); } return(list); } }
public IList <decimal> GetCount(string where) { IList <decimal> list = new List <decimal>(); StringBuilder sql = new StringBuilder(); sql.Append("SELECT COUNT(1),SUM(orders.realprice) FROM TD_Shop_Order as orders inner join TD_Shop_OrderGoods as goods on orders.OrderID=goods.OrderID"); if (!string.IsNullOrEmpty(where)) { sql.AppendFormat(" where {0}", where); } using (DbDataReader dr = MySqlHelperUtil.ExecuteReader(sql.ToString())) { if (dr.Read()) { if (dr[0] != DBNull.Value) { list.Add(dr.GetInt32(0)); } else { list.Add(0); } if (dr[1] != DBNull.Value) { list.Add(dr.GetDecimal(1)); } else { list.Add(0); } } } return(list); }
public IList <Model.TD_Shop_OrderGoods> GetListByOrderID(string orderID) { StringBuilder strSql = new StringBuilder(); strSql.Append("SELECT OrderGoodsID,OrderID,GoodsID,Title,Amount,OrgID,OriPrice,RealPrice,OrderTime FROM TD_Shop_OrderGoods"); strSql.Append(" where OrderID=@OrderID"); MySqlParameter[] parameters = { new MySqlParameter("@OrderID", orderID) }; IList <ShiMiao.Model.TD_Shop_OrderGoods> list = new List <ShiMiao.Model.TD_Shop_OrderGoods>(); using (DbDataReader dr = MySqlHelperUtil.ExecuteReader(strSql.ToString(), parameters)) { while (dr.Read()) { ShiMiao.Model.TD_Shop_OrderGoods model = new ShiMiao.Model.TD_Shop_OrderGoods(); if (dr[0] != DBNull.Value) { model.OrderGoodsID = dr.GetString(0); } if (dr[1] != DBNull.Value) { model.OrderID = dr.GetString(1); } if (dr[2] != DBNull.Value) { model.GoodsID = dr.GetString(2); } if (dr[3] != DBNull.Value) { model.Title = dr.GetString(3); } if (dr[4] != DBNull.Value) { model.Amount = dr.GetInt32(4); } if (dr[5] != DBNull.Value) { model.OrgID = dr.GetInt32(5); } if (dr[6] != DBNull.Value) { model.OriPrice = dr.GetDecimal(6); } if (dr[7] != DBNull.Value) { model.RealPrice = dr.GetDecimal(7); } if (dr[8] != DBNull.Value) { model.OrderTime = dr.GetDateTime(8); } list.Add(model); } return(list); } }
public IList <Model.OrderDetailEx> GetListByPage2(string where, string orderField, int startIndex, int pageSize) { StringBuilder strSql = new StringBuilder(); strSql.Append("SELECT orders.NickName,orders.OrderTime,orders.RealPrice,orderGoods.Amount,orderGoods.Title,HeaderImage"); strSql.Append(" FROM TD_Shop_Order as orders"); strSql.Append(" inner join TD_Shop_OrderGoods as orderGoods on orders.OrderID=orderGoods.OrderID"); if (!string.IsNullOrEmpty(where)) { strSql.Append(" WHERE " + where); } if (!string.IsNullOrEmpty(orderField)) { strSql.AppendFormat(" order by {0}", orderField); } strSql.AppendFormat(" limit {0}, {1}", startIndex, pageSize); List <MySqlParameter> parameters = new List <MySqlParameter>(); IList <ShiMiao.Model.OrderDetailEx> list = new List <ShiMiao.Model.OrderDetailEx>(); using (DbDataReader dr = MySqlHelperUtil.ExecuteReader(strSql.ToString(), parameters.ToArray())) { while (dr.Read()) { ShiMiao.Model.OrderDetailEx model = new ShiMiao.Model.OrderDetailEx(); if (dr[0] != DBNull.Value) { model.NickName = dr.GetString(0); } if (dr[1] != DBNull.Value) { model.OrderTime = dr.GetDateTime(1); } if (dr[2] != DBNull.Value) { model.RealPrice = dr.GetDecimal(2); } if (dr[3] != DBNull.Value) { model.Amount = dr.GetInt32(3); } if (dr[4] != DBNull.Value) { model.Title = dr.GetString(4); } if (dr[5] != DBNull.Value) { model.HeaderImage = dr.GetString(5); } list.Add(model); } parameters.Clear(); return(list); } }
public IList <decimal> GetCount(string where, IDictionary <string, object> dictParams) { IList <decimal> list = new List <decimal>(); StringBuilder strSql = new StringBuilder(); strSql.Append("select count(1),sum(Fee) from TD_Donation_Order"); if (!string.IsNullOrEmpty(where)) { strSql.Append(" where " + where); } List <MySqlParameter> parameters = new List <MySqlParameter>(); if (dictParams != null) { foreach (var pair in dictParams) { MySqlParameter parameter = new MySqlParameter("@" + pair.Key, pair.Value); parameters.Add(parameter); } } using (DbDataReader dr = MySqlHelperUtil.ExecuteReader(strSql.ToString(), parameters.ToArray())) { if (dr.Read()) { if (dr[0] != DBNull.Value) { list.Add(dr.GetInt32(0)); } else { list.Add(0); } if (dr[1] != DBNull.Value) { list.Add(dr.GetDecimal(1)); } else { list.Add(0); } } } parameters.Clear(); return(list); }
public TD_Shop_Order_Consignee getConsignee(string OrderID) {//该订单获取收件人信息 StringBuilder strSql = new StringBuilder(); strSql.Append("select OrderID, Name, Phone,Address,Identification"); strSql.Append(" from TD_Order_Consignee "); strSql.Append(" where OrderID=@OrderID "); MySqlParameter[] parameters = { new MySqlParameter("@OrderID", OrderID) }; ShiMiao.Model.TD_Shop_Order_Consignee model = null; using (DbDataReader dr = MySqlHelperUtil.ExecuteReader(strSql.ToString(), parameters)) { if (dr.Read()) { model = new ShiMiao.Model.TD_Shop_Order_Consignee(); if (dr[0] != DBNull.Value) { model.OrderID = dr.GetString(0); } if (dr[1] != DBNull.Value) { model.Name = dr.GetString(1); } if (dr[2] != DBNull.Value) { model.Phone = dr.GetString(2); } if (dr[3] != DBNull.Value) { model.Address = dr.GetString(3); } if (dr[4] != DBNull.Value) { model.Identification = dr.GetString(4); } } return(model); } }
/// <summary> /// 得到一个对象实体 /// </summary> public ShiMiao.Model.TD_Donation_Info GetModel(string DonationID) { StringBuilder strSql = new StringBuilder(); strSql.Append("select DonationID, Title, ImageURL, Content, ReadCount, IsImage, IsDeleted, CreateTime, CreatorID, CreatorName, UpdateTime, UpdaterID, UpdaterName, PublishOrgID, PublishOrgName "); strSql.Append(" from TD_Donation_Info "); strSql.Append(" where DonationID=@DonationID "); MySqlParameter[] parameters = { new MySqlParameter("@DonationID", DonationID) }; ShiMiao.Model.TD_Donation_Info model = null; using (DbDataReader dr = MySqlHelperUtil.ExecuteReader(strSql.ToString(), parameters)) { while (dr.Read()) { model = new ShiMiao.Model.TD_Donation_Info(); if (dr[0] != DBNull.Value) { model.DonationID = dr.GetString(0); } if (dr[1] != DBNull.Value) { model.Title = dr.GetString(1); } if (dr[2] != DBNull.Value) { model.ImageURL = dr.GetString(2); } if (dr[3] != DBNull.Value) { model.Content = dr.GetString(3); } if (dr[4] != DBNull.Value) { model.ReadCount = dr.GetInt32(4); } if (dr[5] != DBNull.Value) { model.IsImage = dr.GetString(5); } if (dr[6] != DBNull.Value) { model.IsDeleted = dr.GetString(6); } if (dr[7] != DBNull.Value) { model.CreateTime = dr.GetDateTime(7); } if (dr[8] != DBNull.Value) { model.CreatorID = dr.GetDecimal(8); } if (dr[9] != DBNull.Value) { model.CreatorName = dr.GetString(9); } if (dr[10] != DBNull.Value) { model.UpdateTime = dr.GetDateTime(10); } if (dr[11] != DBNull.Value) { model.UpdaterID = dr.GetDecimal(11); } if (dr[12] != DBNull.Value) { model.UpdaterName = dr.GetString(12); } if (dr[13] != DBNull.Value) { model.PublishOrgID = dr.GetDecimal(13); } if (dr[14] != DBNull.Value) { model.PublishOrgName = dr.GetString(14); } } return(model); } }
/// <summary> /// 得到一个对象实体 /// </summary> public ShiMiao.Model.TD_Donation_Order GetModel(string OrderID) { StringBuilder strSql = new StringBuilder(); strSql.Append("select OrderID, DonationID, OpenID, NickName, HeaderImage, OrderTime, Fee, IsPay, PayType, PayTime,Name,Mobile "); strSql.Append(" from TD_Donation_Order "); strSql.Append(" where OrderID=@OrderID "); MySqlParameter[] parameters = { new MySqlParameter("@OrderID", OrderID) }; ShiMiao.Model.TD_Donation_Order model = null; using (DbDataReader dr = MySqlHelperUtil.ExecuteReader(strSql.ToString(), parameters)) { while (dr.Read()) { model = new ShiMiao.Model.TD_Donation_Order(); if (dr[0] != DBNull.Value) { model.OrderID = dr.GetString(0); } if (dr[1] != DBNull.Value) { model.DonationID = dr.GetString(1); } if (dr[2] != DBNull.Value) { model.OpenID = dr.GetString(2); } if (dr[3] != DBNull.Value) { model.NickName = dr.GetString(3); } if (dr[4] != DBNull.Value) { model.HeaderImage = dr.GetString(4); } if (dr[5] != DBNull.Value) { model.OrderTime = dr.GetDateTime(5); } if (dr[6] != DBNull.Value) { model.Fee = dr.GetDecimal(6); } if (dr[7] != DBNull.Value) { model.IsPay = dr.GetString(7); } if (dr[8] != DBNull.Value) { model.PayType = dr.GetInt32(8); } if (dr[9] != DBNull.Value) { model.PayTime = dr.GetDateTime(9); } if (dr[10] != DBNull.Value) { model.Name = dr.GetString(10); } if (dr[11] != DBNull.Value) { model.Mobile = dr.GetString(11); } } return(model); } }
/// <summary> /// 获取数据列表 /// </summary> public IList <ShiMiao.Model.TD_Donation_Info> GetList(IList <Guid> list) { StringBuilder sql = new StringBuilder(); sql.AppendLine("CREATE TABLE #TEMP(id uniqueidentifier primary key)"); for (int i = 0; i < list.Count; i++) { sql.AppendFormat(" INSERT INTO #TEMP VALUES(@Parameter{0})", i); sql.AppendLine(); } sql.Append(" SELECT t1.DonationID, t1.Title, t1.ImageURL, t1.Content, t1.ReadCount, t1.IsImage, t1.IsDeleted, t1.CreateTime, t1.CreatorID, t1.CreatorName, t1.UpdateTime, t1.UpdaterID, t1.UpdaterName, t1.PublishOrgID, t1.PublishOrgName "); sql.Append(" from TD_Donation_Info t1 INNER JOIN #TEMP t2 ON t1.DonationID=t2.id"); sql.Append(" drop table #TEMP"); List <MySqlParameter> parameters = new List <MySqlParameter>(); for (int i = 0; i < list.Count; i++) { MySqlParameter parameter = new MySqlParameter("@Parameter" + i.ToString(), list[i]); parameters.Add(parameter); } IList <ShiMiao.Model.TD_Donation_Info> modelList = new List <ShiMiao.Model.TD_Donation_Info>(); using (DbDataReader dr = MySqlHelperUtil.ExecuteReader(sql.ToString(), parameters.ToArray())) { while (dr.Read()) { ShiMiao.Model.TD_Donation_Info model = new ShiMiao.Model.TD_Donation_Info(); if (dr[0] != DBNull.Value) { model.DonationID = dr.GetString(0); } if (dr[1] != DBNull.Value) { model.Title = dr.GetString(1); } if (dr[2] != DBNull.Value) { model.ImageURL = dr.GetString(2); } if (dr[3] != DBNull.Value) { model.Content = dr.GetString(3); } if (dr[4] != DBNull.Value) { model.ReadCount = dr.GetInt32(4); } if (dr[5] != DBNull.Value) { model.IsImage = dr.GetString(5); } if (dr[6] != DBNull.Value) { model.IsDeleted = dr.GetString(6); } if (dr[7] != DBNull.Value) { model.CreateTime = dr.GetDateTime(7); } if (dr[8] != DBNull.Value) { model.CreatorID = dr.GetDecimal(8); } if (dr[9] != DBNull.Value) { model.CreatorName = dr.GetString(9); } if (dr[10] != DBNull.Value) { model.UpdateTime = dr.GetDateTime(10); } if (dr[11] != DBNull.Value) { model.UpdaterID = dr.GetDecimal(11); } if (dr[12] != DBNull.Value) { model.UpdaterName = dr.GetString(12); } if (dr[13] != DBNull.Value) { model.PublishOrgID = dr.GetDecimal(13); } if (dr[14] != DBNull.Value) { model.PublishOrgName = dr.GetString(14); } modelList.Add(model); } parameters.Clear(); return(modelList); } }
public Model.TD_Shop_Order GetModel(string OrderID) { StringBuilder strSql = new StringBuilder(); strSql.Append("select OrderID,PayNo,OrgID,OriPrice,RealPrice,Status,MemberID,NickName,HeaderImage,Mobile,OrderType,PayType,IsPay,IsMemberDeleted,OrderTime,PayTime,CompleteTime ,Message,ExtraPrice"); strSql.Append(" from TD_Shop_Order "); strSql.Append(" where OrderID=@OrderID "); MySqlParameter[] parameters = { new MySqlParameter("@OrderID", OrderID) }; ShiMiao.Model.TD_Shop_Order model = null; using (DbDataReader dr = MySqlHelperUtil.ExecuteReader(strSql.ToString(), parameters)) { while (dr.Read()) { model = new ShiMiao.Model.TD_Shop_Order(); if (dr[0] != DBNull.Value) { model.OrderID = dr.GetString(0); } if (dr[1] != DBNull.Value) { model.PayNo = dr.GetString(1); } if (dr[2] != DBNull.Value) { model.OrgID = dr.GetInt32(2); } if (dr[3] != DBNull.Value) { model.OriPrice = dr.GetDecimal(3); } if (dr[4] != DBNull.Value) { model.RealPrice = dr.GetDecimal(4); } if (dr[5] != DBNull.Value) { model.Status = dr.GetInt32(5); } if (dr[6] != DBNull.Value) { model.MemberID = dr.GetString(6); } if (dr[7] != DBNull.Value) { model.NickName = dr.GetString(7); } if (dr[8] != DBNull.Value) { model.HeaderImage = dr.GetString(8); } if (dr[9] != DBNull.Value) { model.Mobile = dr.GetString(9); } if (dr[10] != DBNull.Value) { model.OrderType = dr.GetInt32(10); } if (dr[11] != DBNull.Value) { model.PayType = dr.GetInt32(11); } if (dr[12] != DBNull.Value) { model.IsPay = dr.GetString(12); } if (dr[13] != DBNull.Value) { model.IsMemberDeleted = dr.GetString(13); } if (dr[14] != DBNull.Value) { model.OrderTime = dr.GetDateTime(14); } if (dr[15] != DBNull.Value) { model.PayTime = dr.GetDateTime(15); } if (dr[16] != DBNull.Value) { model.CompleteTime = dr.GetDateTime(16); } if (dr[17] != DBNull.Value) { model.Message = dr.GetString(17); } if (dr[18] != DBNull.Value) { model.ExtraPrice = dr.GetDecimal(18); } } return(model); } }
/// <summary> /// 获取分页数据列表 /// </summary> public IList <ShiMiao.Model.TD_Donation_LeaveMsg> GetListByPage(string where, string orderby, IDictionary <string, object> dictParams, int startIndex, int pageSize) { StringBuilder strSql = new StringBuilder(); strSql.Append("SELECT LeaveMsgID,DonationID,MemberID,NickName,HeaderImage,Message,CreateTime FROM TD_Donation_LeaveMsg"); if (!string.IsNullOrEmpty(where)) { strSql.Append(" WHERE " + where); } if (!string.IsNullOrEmpty(orderby)) { strSql.AppendFormat(" order by {0}", orderby); } strSql.AppendFormat(" limit {0}, {1}", startIndex, pageSize); List <MySqlParameter> parameters = new List <MySqlParameter>(); if (dictParams != null) { foreach (var pair in dictParams) { MySqlParameter parameter = new MySqlParameter("@" + pair.Key, pair.Value); parameters.Add(parameter); } } IList <ShiMiao.Model.TD_Donation_LeaveMsg> list = new List <ShiMiao.Model.TD_Donation_LeaveMsg>(); using (DbDataReader dr = MySqlHelperUtil.ExecuteReader(strSql.ToString(), parameters.ToArray())) { while (dr.Read()) { ShiMiao.Model.TD_Donation_LeaveMsg model = new ShiMiao.Model.TD_Donation_LeaveMsg(); if (dr[0] != DBNull.Value) { model.LeaveMsgID = dr.GetString(0); } if (dr[1] != DBNull.Value) { model.DonationID = dr.GetString(1); } if (dr[2] != DBNull.Value) { model.MemberID = dr.GetString(2); } if (dr[3] != DBNull.Value) { model.NickName = dr.GetString(3); } if (dr[4] != DBNull.Value) { model.HeaderImage = dr.GetString(4); } if (dr[5] != DBNull.Value) { model.Message = dr.GetString(5); } if (dr[6] != DBNull.Value) { model.CreateTime = dr.GetDateTime(6); } list.Add(model); } parameters.Clear(); return(list); } }
/// <summary> /// 获得数据列表 /// </summary> public IList <Model.TD_WeiXin_Menu> GetList(string where, string orderBy, IDictionary <string, object> dictParams) { StringBuilder strSql = new StringBuilder(); strSql.Append("select MenuID, OrgID, OrgName, MenuName, MenuType, MenuValue, ParentID, OrderIndex "); strSql.Append(" FROM TD_WeiXin_Menu "); if (!string.IsNullOrEmpty(where)) { strSql.AppendFormat(" where {0}", where); } if (!string.IsNullOrEmpty(orderBy)) { strSql.AppendFormat(" order by {0}", orderBy); } List <MySqlParameter> parameters = new List <MySqlParameter>(); if (dictParams != null) { foreach (var pair in dictParams) { MySqlParameter parameter = new MySqlParameter("@" + pair.Key, pair.Value); parameters.Add(parameter); } } IList <Model.TD_WeiXin_Menu> list = new List <Model.TD_WeiXin_Menu>(); using (DbDataReader dr = MySqlHelperUtil.ExecuteReader(strSql.ToString(), parameters.ToArray())) { while (dr.Read()) { Model.TD_WeiXin_Menu model = new Model.TD_WeiXin_Menu(); if (dr[0] != DBNull.Value) { model.MenuID = dr.GetInt32(0); } if (dr[1] != DBNull.Value) { model.OrgID = dr.GetInt32(1); } if (dr[2] != DBNull.Value) { model.OrgName = dr.GetString(2); } if (dr[3] != DBNull.Value) { model.MenuName = dr.GetString(3); } if (dr[4] != DBNull.Value) { model.MenuType = dr.GetInt32(4); } if (dr[5] != DBNull.Value) { model.MenuValue = dr.GetString(5); } if (dr[6] != DBNull.Value) { model.ParentID = dr.GetInt32(6); } if (dr[7] != DBNull.Value) { model.OrderIndex = dr.GetInt32(7); } list.Add(model); } parameters.Clear(); return(list); } }
public IList <ShiMiao.Model.TD_Shop_Goods> GetListByPage(string where, string orderby, IDictionary <string, object> dictParams, int startIndex, int pageSize) { StringBuilder strSql = new StringBuilder(); strSql.Append("SELECT GoodsID, OrgID, Title, Image, Content, Amount, Balance, Price, CreateTime, OrderIndex, StateCode,Frozen,Unit FROM TD_Shop_Goods"); if (!string.IsNullOrEmpty(where)) { strSql.Append(" WHERE " + where); } if (!string.IsNullOrEmpty(orderby)) { strSql.AppendFormat(" order by {0}", orderby); } strSql.AppendFormat(" limit {0}, {1}", startIndex, pageSize); List <MySqlParameter> parameters = new List <MySqlParameter>(); if (dictParams != null) { foreach (var pair in dictParams) { MySqlParameter parameter = new MySqlParameter("@" + pair.Key, pair.Value); parameters.Add(parameter); } } IList <ShiMiao.Model.TD_Shop_Goods> list = new List <ShiMiao.Model.TD_Shop_Goods>(); using (DbDataReader dr = MySqlHelperUtil.ExecuteReader(strSql.ToString(), parameters.ToArray())) { while (dr.Read()) { ShiMiao.Model.TD_Shop_Goods model = new ShiMiao.Model.TD_Shop_Goods(); if (dr[0] != DBNull.Value) { model.GoodsID = dr.GetString(0); } if (dr[1] != DBNull.Value) { model.OrgID = dr.GetInt32(1); } if (dr[2] != DBNull.Value) { model.Title = dr.GetString(2); } if (dr[3] != DBNull.Value) { model.Image = dr.GetString(3); } if (dr[4] != DBNull.Value) { model.Content = dr.GetString(4); } if (dr[5] != DBNull.Value) { model.Amount = dr.GetInt32(5); } if (dr[6] != DBNull.Value) { model.Balance = dr.GetInt32(6); } if (dr[7] != DBNull.Value) { model.Price = dr.GetDecimal(7); } if (dr[8] != DBNull.Value) { model.CreateTime = dr.GetDateTime(8); } if (dr[9] != DBNull.Value) { model.OrderIndex = dr.GetInt32(9); } if (dr[10] != DBNull.Value) { model.StateCode = dr.GetInt32(10); } if (dr[11] != DBNull.Value) { model.Frozen = dr.GetInt32(11); } if (dr[12] != DBNull.Value) { model.Unit = dr.GetString(12); } list.Add(model); } parameters.Clear(); return(list); } }
/// <summary> /// 获取数据列表 /// </summary> public IList <ShiMiao.Model.TD_Donation_Order> GetList(IList <Guid> list) { StringBuilder sql = new StringBuilder(); sql.AppendLine("CREATE TABLE #TEMP(id uniqueidentifier primary key)"); for (int i = 0; i < list.Count; i++) { sql.AppendFormat(" INSERT INTO #TEMP VALUES(@Parameter{0})", i); sql.AppendLine(); } sql.Append(" SELECT t1.OrderID, t1.DonationID, t1.OpenID, t1.NickName, t1.HeaderImage, t1.OrderTime, t1.Fee, t1.IsPay, t1.PayType, t1.PayTime "); sql.Append(" from TD_Donation_Order t1 INNER JOIN #TEMP t2 ON t1.OrderID=t2.id"); sql.Append(" drop table #TEMP"); List <MySqlParameter> parameters = new List <MySqlParameter>(); for (int i = 0; i < list.Count; i++) { MySqlParameter parameter = new MySqlParameter("@Parameter" + i.ToString(), list[i]); parameters.Add(parameter); } IList <ShiMiao.Model.TD_Donation_Order> modelList = new List <ShiMiao.Model.TD_Donation_Order>(); using (DbDataReader dr = MySqlHelperUtil.ExecuteReader(sql.ToString(), parameters.ToArray())) { while (dr.Read()) { ShiMiao.Model.TD_Donation_Order model = new ShiMiao.Model.TD_Donation_Order(); if (dr[0] != DBNull.Value) { model.OrderID = dr.GetString(0); } if (dr[1] != DBNull.Value) { model.DonationID = dr.GetString(1); } if (dr[2] != DBNull.Value) { model.OpenID = dr.GetString(2); } if (dr[3] != DBNull.Value) { model.NickName = dr.GetString(3); } if (dr[4] != DBNull.Value) { model.HeaderImage = dr.GetString(4); } if (dr[5] != DBNull.Value) { model.OrderTime = dr.GetDateTime(5); } if (dr[6] != DBNull.Value) { model.Fee = dr.GetDecimal(6); } if (dr[7] != DBNull.Value) { model.IsPay = dr.GetString(7); } if (dr[8] != DBNull.Value) { model.PayType = dr.GetInt32(8); } if (dr[9] != DBNull.Value) { model.PayTime = dr.GetDateTime(9); } modelList.Add(model); } parameters.Clear(); return(modelList); } }
public List <WXBill> getOneDay(DateTime time) { List <WXBill> _billList = new List <WXBill>(); StringBuilder strSql = new StringBuilder(); strSql.Append(@" select limit 100 RecordID, TranDate, AppID, MCHID, SubMCHID, DeviceID, TransactionID, OutTradeNo, UserInfo, TranType , TranSta, PayBank , Currency , Cost , EnterpriseLuckyMoney , RefundID , OutRefundNo , RefundMoney , EnterpriseRefundLuckyMoney, RefundType , RefundSta , GoodsName , MerchantData , ExFee , Rates "); strSql.Append(" from TD_Order_WeiXinPay_dz "); strSql.Append(" where dzzt=0 and trandate>'" + time.ToString("yyyy-MM-dd") + "' and trandate<'" + time.AddDays(1).ToString("yyyy-MM-dd") + "'"); MySqlParameter[] parameters = { }; using (DbDataReader dr = MySqlHelperUtil.ExecuteReader(strSql.ToString(), parameters)) { while (dr.HasRows && dr.Read()) { int i = -1; //ID,jysj,gzzhid,shh,zshh,sbh,wxddh,shddh,wbbh,jylx,jyzt,fkyh,hbzl,zje,qyhbje,wxtkdh,shtkdh,tkje,qyhbtkje,tklx,tkzt,spmc,shsjb,sxf,fl WXBill _bill = new WXBill(); if (!dr.IsDBNull(++i)) { _bill.RecordID = dr.GetString(i); } if (!dr.IsDBNull(++i)) { _bill.TranDate = dr.GetDateTime(i); } if (!dr.IsDBNull(++i)) { _bill.AppID = dr.GetString(i); } if (!dr.IsDBNull(++i)) { _bill.MCHID = dr.GetString(i); } if (!dr.IsDBNull(++i)) { _bill.SubMCHID = dr.GetString(i); } if (!dr.IsDBNull(++i)) { _bill.DeviceID = dr.GetString(i); } if (!dr.IsDBNull(++i)) { _bill.TransactionID = dr.GetString(i); } if (!dr.IsDBNull(++i)) { _bill.OutTradeNo = dr.GetString(i); } if (!dr.IsDBNull(++i)) { _bill.UserInfo = dr.GetString(i); } if (!dr.IsDBNull(++i)) { _bill.TranType = dr.GetString(i); } if (!dr.IsDBNull(++i)) { _bill.TranSta = dr.GetString(i); } if (!dr.IsDBNull(++i)) { _bill.PayBank = dr.GetString(i); } if (!dr.IsDBNull(++i)) { _bill.Currency = dr.GetString(i); } if (!dr.IsDBNull(++i)) { _bill.Cost = dr.GetDecimal(i); } if (!dr.IsDBNull(++i)) { _bill.EnterpriseLuckyMoney = dr.GetDecimal(i); } if (!dr.IsDBNull(++i)) { _bill.RefundID = dr.GetString(i); } if (!dr.IsDBNull(++i)) { _bill.OutRefundNo = dr.GetString(i); } if (!dr.IsDBNull(++i)) { _bill.RefundMoney = dr.GetDecimal(i); } if (!dr.IsDBNull(++i)) { _bill.EnterpriseRefundLuckyMoney = dr.GetDecimal(i); } if (!dr.IsDBNull(++i)) { _bill.RefundType = dr.GetString(i); } if (!dr.IsDBNull(++i)) { _bill.RefundSta = dr.GetString(i); } if (!dr.IsDBNull(++i)) { _bill.GoodsName = dr.GetString(i); } if (!dr.IsDBNull(++i)) { _bill.MerchantData = dr.GetString(i); } if (!dr.IsDBNull(++i)) { _bill.ExFee = dr.GetDecimal(i); } if (!dr.IsDBNull(++i)) { _bill.Rates = dr.GetString(i); } _billList.Add(_bill); } } if (_billList.Count <= 0) { return(null); } return(_billList); }
/// <summary> /// 获得数据列表 /// </summary> public IList <ShiMiao.Model.TD_Order_WeiXinPay> GetList(string where, string orderBy, IDictionary <string, object> dictParams) { StringBuilder strSql = new StringBuilder(); strSql.Append("select OrderID, NonceStr, Timestamp, OrgID, WeiXinOrderID, OrderFee, CashFee, Package, Status, PayTime, CallBackTime "); strSql.Append(" FROM TD_Order_WeiXinPay "); if (!string.IsNullOrEmpty(where)) { strSql.AppendFormat(" where {0}", where); } if (!string.IsNullOrEmpty(orderBy)) { strSql.AppendFormat(" order by {0}", orderBy); } List <MySqlParameter> parameters = new List <MySqlParameter>(); if (dictParams != null) { foreach (var pair in dictParams) { MySqlParameter parameter = new MySqlParameter("@" + pair.Key, pair.Value); parameters.Add(parameter); } } IList <ShiMiao.Model.TD_Order_WeiXinPay> list = new List <ShiMiao.Model.TD_Order_WeiXinPay>(); using (DbDataReader dr = MySqlHelperUtil.ExecuteReader(strSql.ToString(), parameters.ToArray())) { while (dr.Read()) { ShiMiao.Model.TD_Order_WeiXinPay model = new ShiMiao.Model.TD_Order_WeiXinPay(); if (dr[0] != DBNull.Value) { model.OrderID = dr.GetString(0); } if (dr[1] != DBNull.Value) { model.NonceStr = dr.GetString(1); } if (dr[2] != DBNull.Value) { model.Timestamp = dr.GetInt32(2); } if (dr[3] != DBNull.Value) { model.OrgID = dr.GetInt32(3); } if (dr[4] != DBNull.Value) { model.WeiXinOrderID = dr.GetString(4); } if (dr[5] != DBNull.Value) { model.OrderFee = dr.GetInt32(5); } if (dr[6] != DBNull.Value) { model.CashFee = dr.GetInt32(6); } if (dr[7] != DBNull.Value) { model.Package = dr.GetString(7); } if (dr[8] != DBNull.Value) { model.Status = dr.GetInt32(8); } if (dr[9] != DBNull.Value) { model.PayTime = dr.GetDateTime(9); } if (dr[10] != DBNull.Value) { model.CallBackTime = dr.GetDateTime(10); } list.Add(model); } parameters.Clear(); return(list); } }
public ShiMiao.Model.m_Sell_Goods GetModel(string goodsID) { StringBuilder strSql = new StringBuilder(); strSql.Append("select GoodsID, OrgID, Title, Content, Amount, Balance, Price, CreateTime, OrderIndex, StateCode,Frozen,isSell "); strSql.Append(" from TD_Sell_Goods "); strSql.Append(" where GoodsID=@GoodsID and isSell=1"); MySqlParameter[] parameters = { new MySqlParameter("@GoodsID", goodsID) }; ShiMiao.Model.m_Sell_Goods model = null; using (DbDataReader dr = MySqlHelperUtil.ExecuteReader(strSql.ToString(), parameters)) { if (dr.Read()) { model = new ShiMiao.Model.m_Sell_Goods(); int i = -1; if (dr[++i] != DBNull.Value) { model.GoodsID = dr.GetString(i); } if (dr[++i] != DBNull.Value) { model.OrgID = dr.GetInt32(i); } if (dr[++i] != DBNull.Value) { model.Title = dr.GetString(i); } if (dr[++i] != DBNull.Value) { model.Content = dr.GetString(i); } if (dr[++i] != DBNull.Value) { model.Amount = dr.GetInt32(i); } if (dr[++i] != DBNull.Value) { model.Balance = dr.GetInt32(i); } if (dr[++i] != DBNull.Value) { model.Price = dr.GetDecimal(i); } if (dr[++i] != DBNull.Value) { model.CreateTime = dr.GetDateTime(i); } if (dr[++i] != DBNull.Value) { model.OrderIndex = dr.GetInt32(i); } if (dr[++i] != DBNull.Value) { model.StateCode = dr.GetInt32(i); } if (dr[++i] != DBNull.Value) { model.Frozen = dr.GetInt32(i); } if (dr[++i] != DBNull.Value) { model.isSell = dr.GetInt32(i); } } return(model); } }
/// <summary> /// 得到一个对象实体 /// </summary> public ShiMiao.Model.TD_Order_WeiXinPay GetModel(string OrderID, string NonceStr) { StringBuilder strSql = new StringBuilder(); strSql.Append("select OrderID, NonceStr, Timestamp, OrgID, WeiXinOrderID, OrderFee, CashFee, Package, Status, PayTime, CallBackTime "); strSql.Append(" from TD_Order_WeiXinPay "); strSql.Append(" where OrderID=@OrderID and NonceStr=@NonceStr "); MySqlParameter[] parameters = { new MySqlParameter("@OrderID", OrderID), new MySqlParameter("@NonceStr", NonceStr) }; ShiMiao.Model.TD_Order_WeiXinPay model = null; using (DbDataReader dr = MySqlHelperUtil.ExecuteReader(strSql.ToString(), parameters)) { while (dr.Read()) { model = new ShiMiao.Model.TD_Order_WeiXinPay(); if (dr[0] != DBNull.Value) { model.OrderID = dr.GetString(0); } if (dr[1] != DBNull.Value) { model.NonceStr = dr.GetString(1); } if (dr[2] != DBNull.Value) { model.Timestamp = dr.GetInt32(2); } if (dr[3] != DBNull.Value) { model.OrgID = dr.GetInt32(3); } if (dr[4] != DBNull.Value) { model.WeiXinOrderID = dr.GetString(4); } if (dr[5] != DBNull.Value) { model.OrderFee = dr.GetInt32(5); } if (dr[6] != DBNull.Value) { model.CashFee = dr.GetInt32(6); } if (dr[7] != DBNull.Value) { model.Package = dr.GetString(7); } if (dr[8] != DBNull.Value) { model.Status = dr.GetInt32(8); } if (dr[9] != DBNull.Value) { model.PayTime = dr.GetDateTime(9); } if (dr[10] != DBNull.Value) { model.CallBackTime = dr.GetDateTime(10); } } return(model); } }
public IList <Model.TD_WeiXin_Member> GetListByMemberIDs(IList <string> list) { StringBuilder sql = new StringBuilder(); sql.AppendLine("CREATE TEMPORARY TABLE TEMP(id varchar(36));"); for (int i = 0; i < list.Count; i++) { sql.AppendFormat(" INSERT INTO TEMP(id) VALUES(@Parameter{0});", i); sql.AppendLine(); } sql.Append(" SELECT t1.MemberID,t1.NickName,t1.HeaderImage,t1.OpenID,t1.CreateTime,t1.IsFocused,t1.FocusTime,t1.UnFocusTime,t1.Sex,t1.Country,t1.Province,t1.City"); sql.Append(" from TD_WeiXin_Member t1 INNER JOIN TEMP t2 ON t1.MemberID=t2.id;"); sql.Append(" drop table TEMP;"); List <MySqlParameter> parameters = new List <MySqlParameter>(); for (int i = 0; i < list.Count; i++) { MySqlParameter parameter = new MySqlParameter("@Parameter" + i.ToString(), list[i]); parameters.Add(parameter); } IList <ShiMiao.Model.TD_WeiXin_Member> modelList = new List <ShiMiao.Model.TD_WeiXin_Member>(); using (DbDataReader dr = MySqlHelperUtil.ExecuteReader(sql.ToString(), parameters.ToArray())) { while (dr.Read()) { ShiMiao.Model.TD_WeiXin_Member model = new ShiMiao.Model.TD_WeiXin_Member(); if (dr[0] != DBNull.Value) { model.MemberID = dr.GetString(0); } if (dr[1] != DBNull.Value) { model.NickName = dr.GetString(1); } if (dr[2] != DBNull.Value) { model.HeaderImage = dr.GetString(2); } if (dr[3] != DBNull.Value) { model.OpenID = dr.GetString(3); } if (dr[4] != DBNull.Value) { model.CreateTime = dr.GetDateTime(4); } if (dr[5] != DBNull.Value) { model.IsFocused = dr.GetString(5); } if (dr[6] != DBNull.Value) { model.FocusTime = dr.GetDateTime(6); } if (dr[7] != DBNull.Value) { model.UnFocusTime = dr.GetDateTime(7); } if (dr[8] != DBNull.Value) { model.Sex = dr.GetInt16(8); } if (dr[9] != DBNull.Value) { model.Country = dr.GetString(9); } if (dr[10] != DBNull.Value) { model.Province = dr.GetString(10); } if (dr[11] != DBNull.Value) { model.City = dr.GetString(11); } modelList.Add(model); } parameters.Clear(); return(modelList); } }
public Model.TD_WeiXin_Member GetModelByOpenID(string openID) { StringBuilder strSql = new StringBuilder(); strSql.Append("select MemberID,NickName,HeaderImage,OpenID,CreateTime,IsFocused,FocusTime,UnFocusTime,Sex,Country,Province,City"); strSql.Append(" from TD_WeiXin_Member "); strSql.Append(" where OpenID=@OpenID "); MySqlParameter[] parameters = { new MySqlParameter("@OpenID", openID) }; ShiMiao.Model.TD_WeiXin_Member model = null; using (DbDataReader dr = MySqlHelperUtil.ExecuteReader(strSql.ToString(), parameters)) { while (dr.Read()) { model = new ShiMiao.Model.TD_WeiXin_Member(); if (dr[0] != DBNull.Value) { model.MemberID = dr.GetString(0); } if (dr[1] != DBNull.Value) { model.NickName = dr.GetString(1); } if (dr[2] != DBNull.Value) { model.HeaderImage = dr.GetString(2); } if (dr[3] != DBNull.Value) { model.OpenID = dr.GetString(3); } if (dr[4] != DBNull.Value) { model.CreateTime = dr.GetDateTime(4); } if (dr[5] != DBNull.Value) { model.IsFocused = dr.GetString(5); } if (dr[6] != DBNull.Value) { model.FocusTime = dr.GetDateTime(6); } if (dr[7] != DBNull.Value) { model.UnFocusTime = dr.GetDateTime(7); } if (dr[8] != DBNull.Value) { model.Sex = dr.GetInt16(8); } if (dr[9] != DBNull.Value) { model.Country = dr.GetString(9); } if (dr[10] != DBNull.Value) { model.Province = dr.GetString(10); } if (dr[11] != DBNull.Value) { model.City = dr.GetString(11); } } return(model); } }
/// <summary> /// 获得数据列表 /// </summary> public IList <ShiMiao.Model.TD_Donation_Info> GetList(string where, string orderBy, IDictionary <string, object> dictParams) { StringBuilder strSql = new StringBuilder(); strSql.Append("select DonationID, Title, ImageURL, Content, ReadCount, IsImage, IsDeleted, CreateTime, CreatorID, CreatorName, UpdateTime, UpdaterID, UpdaterName, PublishOrgID, PublishOrgName "); strSql.Append(" FROM TD_Donation_Info "); if (!string.IsNullOrEmpty(where)) { strSql.AppendFormat(" where {0}", where); } if (!string.IsNullOrEmpty(orderBy)) { strSql.AppendFormat(" order by {0}", orderBy); } List <MySqlParameter> parameters = new List <MySqlParameter>(); if (dictParams != null) { foreach (var pair in dictParams) { MySqlParameter parameter = new MySqlParameter("@" + pair.Key, pair.Value); parameters.Add(parameter); } } IList <ShiMiao.Model.TD_Donation_Info> list = new List <ShiMiao.Model.TD_Donation_Info>(); using (DbDataReader dr = MySqlHelperUtil.ExecuteReader(strSql.ToString(), parameters.ToArray())) { while (dr.Read()) { ShiMiao.Model.TD_Donation_Info model = new ShiMiao.Model.TD_Donation_Info(); if (dr[0] != DBNull.Value) { model.DonationID = dr.GetString(0); } if (dr[1] != DBNull.Value) { model.Title = dr.GetString(1); } if (dr[2] != DBNull.Value) { model.ImageURL = dr.GetString(2); } if (dr[3] != DBNull.Value) { model.Content = dr.GetString(3); } if (dr[4] != DBNull.Value) { model.ReadCount = dr.GetInt32(4); } if (dr[5] != DBNull.Value) { model.IsImage = dr.GetString(5); } if (dr[6] != DBNull.Value) { model.IsDeleted = dr.GetString(6); } if (dr[7] != DBNull.Value) { model.CreateTime = dr.GetDateTime(7); } if (dr[8] != DBNull.Value) { model.CreatorID = dr.GetDecimal(8); } if (dr[9] != DBNull.Value) { model.CreatorName = dr.GetString(9); } if (dr[10] != DBNull.Value) { model.UpdateTime = dr.GetDateTime(10); } if (dr[11] != DBNull.Value) { model.UpdaterID = dr.GetDecimal(11); } if (dr[12] != DBNull.Value) { model.UpdaterName = dr.GetString(12); } if (dr[13] != DBNull.Value) { model.PublishOrgID = dr.GetDecimal(13); } if (dr[14] != DBNull.Value) { model.PublishOrgName = dr.GetString(14); } list.Add(model); } parameters.Clear(); return(list); } }
/// <summary> /// 获取分页数据列表 /// </summary> public IList <ShiMiao.Model.TD_Donation_Order> GetListByPage(string where, string orderby, IDictionary <string, object> dictParams, int startIndex, int pageSize) { StringBuilder strSql = new StringBuilder(); strSql.Append("SELECT OrderID, DonationID, OpenID, NickName, HeaderImage, OrderTime, Fee, IsPay, PayType, PayTime,Name,Mobile,MemberID,Message,IsAnonymous FROM TD_Donation_Order"); if (!string.IsNullOrEmpty(where)) { strSql.Append(" WHERE " + where); } if (!string.IsNullOrEmpty(orderby)) { strSql.AppendFormat(" order by {0}", orderby); } strSql.AppendFormat(" limit {0}, {1}", startIndex, pageSize); List <MySqlParameter> parameters = new List <MySqlParameter>(); if (dictParams != null) { foreach (var pair in dictParams) { MySqlParameter parameter = new MySqlParameter("@" + pair.Key, pair.Value); parameters.Add(parameter); } } IList <ShiMiao.Model.TD_Donation_Order> list = new List <ShiMiao.Model.TD_Donation_Order>(); using (DbDataReader dr = MySqlHelperUtil.ExecuteReader(strSql.ToString(), parameters.ToArray())) { while (dr.Read()) { ShiMiao.Model.TD_Donation_Order model = new ShiMiao.Model.TD_Donation_Order(); if (dr[0] != DBNull.Value) { model.OrderID = dr.GetString(0); } if (dr[1] != DBNull.Value) { model.DonationID = dr.GetString(1); } if (dr[2] != DBNull.Value) { model.OpenID = dr.GetString(2); } if (dr[3] != DBNull.Value) { model.NickName = dr.GetString(3); } if (dr[4] != DBNull.Value) { model.HeaderImage = dr.GetString(4); } if (dr[5] != DBNull.Value) { model.OrderTime = dr.GetDateTime(5); } if (dr[6] != DBNull.Value) { model.Fee = dr.GetDecimal(6); } if (dr[7] != DBNull.Value) { model.IsPay = dr.GetString(7); } if (dr[8] != DBNull.Value) { model.PayType = dr.GetInt32(8); } if (dr[9] != DBNull.Value) { model.PayTime = dr.GetDateTime(9); } if (dr[10] != DBNull.Value) { model.Name = dr.GetString(10); } if (dr[11] != DBNull.Value) { model.Mobile = dr.GetString(11); } if (dr[12] != DBNull.Value) { model.MemberID = dr.GetString(12); } if (dr[13] != DBNull.Value) { model.Message = dr.GetString(13); } if (dr[14] != DBNull.Value) { model.IsAnonymous = dr.GetString(14); } list.Add(model); } parameters.Clear(); return(list); } }
public WXBill selectOneBillBySHDDH(WXBill _NewBill) { WXBill _bill = null; try { StringBuilder strSql = new StringBuilder(); //"select ID,jysj,gzzhid,shh,zshh,sbh,wxddh,shddh,wbbh,jylx,jyzt,fkyh,hbzl,zje,qyhbje,wxtkdh,shtkdh,tkje,qyhbtkje,tklx,tkzt,spmc,shsjb,sxf,fl from " + SQL_TABLE_NAME + " where shddh = :shddh and wxddh = :wxddh and wxtkdh = :wxtkdh and shtkdh = :shtkdh"; strSql.Append(@" select RecordID, TranDate, AppID, MCHID, SubMCHID, DeviceID, TransactionID, OutTradeNo, UserInfo, TranType , TranSta, PayBank , Currency , Cost , EnterpriseLuckyMoney , RefundID , OutRefundNo , RefundMoney , EnterpriseRefundLuckyMoney, RefundType , RefundSta , GoodsName , MerchantData , ExFee , Rates "); strSql.Append(" from TD_Order_WeiXinPay_dz "); strSql.Append(" where TransactionID=@TransactionID and OutTradeNo=@OutTradeNo and RefundID=@RefundID and OutRefundNo=@OutRefundNo"); MySqlParameter[] parameters = { new MySqlParameter("@TransactionID", _NewBill.TransactionID), new MySqlParameter("@OutTradeNo", _NewBill.OutTradeNo), new MySqlParameter("@RefundID", _NewBill.RefundID), new MySqlParameter("@OutRefundNo", _NewBill.OutRefundNo) }; using (DbDataReader dr = MySqlHelperUtil.ExecuteReader(strSql.ToString(), parameters)) { if (dr.HasRows) { int i = -1; dr.Read(); //ID,jysj,gzzhid,shh,zshh,sbh,wxddh,shddh,wbbh,jylx,jyzt,fkyh,hbzl,zje,qyhbje,wxtkdh,shtkdh,tkje,qyhbtkje,tklx,tkzt,spmc,shsjb,sxf,fl _bill = new WXBill(); if (!dr.IsDBNull(++i)) { _bill.RecordID = dr.GetString(i); } if (!dr.IsDBNull(++i)) { _bill.TranDate = dr.GetDateTime(i); } if (!dr.IsDBNull(++i)) { _bill.AppID = dr.GetString(i); } if (!dr.IsDBNull(++i)) { _bill.MCHID = dr.GetString(i); } if (!dr.IsDBNull(++i)) { _bill.SubMCHID = dr.GetString(i); } if (!dr.IsDBNull(++i)) { _bill.DeviceID = dr.GetString(i); } if (!dr.IsDBNull(++i)) { _bill.TransactionID = dr.GetString(i); } if (!dr.IsDBNull(++i)) { _bill.OutTradeNo = dr.GetString(i); } if (!dr.IsDBNull(++i)) { _bill.UserInfo = dr.GetString(i); } if (!dr.IsDBNull(++i)) { _bill.TranType = dr.GetString(i); } if (!dr.IsDBNull(++i)) { _bill.TranSta = dr.GetString(i); } if (!dr.IsDBNull(++i)) { _bill.PayBank = dr.GetString(i); } if (!dr.IsDBNull(++i)) { _bill.Currency = dr.GetString(i); } if (!dr.IsDBNull(++i)) { _bill.Cost = dr.GetDecimal(i); } if (!dr.IsDBNull(++i)) { _bill.EnterpriseLuckyMoney = dr.GetDecimal(i); } if (!dr.IsDBNull(++i)) { _bill.RefundID = dr.GetString(i); } if (!dr.IsDBNull(++i)) { _bill.OutRefundNo = dr.GetString(i); } if (!dr.IsDBNull(++i)) { _bill.RefundMoney = dr.GetDecimal(i); } if (!dr.IsDBNull(++i)) { _bill.EnterpriseRefundLuckyMoney = dr.GetDecimal(i); } if (!dr.IsDBNull(++i)) { _bill.RefundType = dr.GetString(i); } if (!dr.IsDBNull(++i)) { _bill.RefundSta = dr.GetString(i); } if (!dr.IsDBNull(++i)) { _bill.GoodsName = dr.GetString(i); } if (!dr.IsDBNull(++i)) { _bill.MerchantData = dr.GetString(i); } if (!dr.IsDBNull(++i)) { _bill.ExFee = dr.GetDecimal(i); } if (!dr.IsDBNull(++i)) { _bill.Rates = dr.GetString(i); } } } } catch (Exception ex) { throw ex; } return(_bill); }
/// <summary> /// 获得数据列表 /// </summary> public IList <ShiMiao.Model.TD_Donation_Order> GetTopList(int top, string where, string orderBy, IDictionary <string, object> dictParams) { StringBuilder strSql = new StringBuilder(); strSql.Append("select OrderID, DonationID, OpenID, NickName, HeaderImage, OrderTime, Fee, IsPay, PayType, PayTime "); strSql.Append(" FROM TD_Donation_Order "); if (!string.IsNullOrEmpty(where)) { strSql.AppendFormat(" where {0}", where); } if (!string.IsNullOrEmpty(orderBy)) { strSql.AppendFormat(" order by {0}", orderBy); } strSql.AppendFormat(" limit {0} ", top); List <MySqlParameter> parameters = new List <MySqlParameter>(); if (dictParams != null) { foreach (var pair in dictParams) { MySqlParameter parameter = new MySqlParameter("@" + pair.Key, pair.Value); parameters.Add(parameter); } } IList <ShiMiao.Model.TD_Donation_Order> list = new List <ShiMiao.Model.TD_Donation_Order>(); using (DbDataReader dr = MySqlHelperUtil.ExecuteReader(strSql.ToString(), parameters.ToArray())) { while (dr.Read()) { ShiMiao.Model.TD_Donation_Order model = new ShiMiao.Model.TD_Donation_Order(); if (dr[0] != DBNull.Value) { model.OrderID = dr.GetString(0); } if (dr[1] != DBNull.Value) { model.DonationID = dr.GetString(1); } if (dr[2] != DBNull.Value) { model.OpenID = dr.GetString(2); } if (dr[3] != DBNull.Value) { model.NickName = dr.GetString(3); } if (dr[4] != DBNull.Value) { model.HeaderImage = dr.GetString(4); } if (dr[5] != DBNull.Value) { model.OrderTime = dr.GetDateTime(5); } if (dr[6] != DBNull.Value) { model.Fee = dr.GetDecimal(6); } if (dr[7] != DBNull.Value) { model.IsPay = dr.GetString(7); } if (dr[8] != DBNull.Value) { model.PayType = dr.GetInt32(8); } if (dr[9] != DBNull.Value) { model.PayTime = dr.GetDateTime(9); } list.Add(model); } parameters.Clear(); return(list); } }
public List <ShiMiao.Model.m_Sell_Goods> getAllModel() { StringBuilder strSql = new StringBuilder(); strSql.Append("select GoodsID, OrgID, Title, Content, Amount, Balance, Price, CreateTime, OrderIndex, StateCode,Frozen,isSell "); strSql.Append(" from TD_Sell_Goods "); strSql.Append(" where isSell=@isSell"); MySqlParameter[] parameters = { new MySqlParameter("@isSell", 1) }; List <ShiMiao.Model.m_Sell_Goods> _list = new List <ShiMiao.Model.m_Sell_Goods>(); using (DbDataReader dr = MySqlHelperUtil.ExecuteReader(strSql.ToString(), parameters)) { while (dr.Read()) { ShiMiao.Model.m_Sell_Goods model = new ShiMiao.Model.m_Sell_Goods(); int i = -1; if (dr[++i] != DBNull.Value) { model.GoodsID = dr.GetString(i); } if (dr[++i] != DBNull.Value) { model.OrgID = dr.GetInt32(i); } if (dr[++i] != DBNull.Value) { model.Title = dr.GetString(i); } if (dr[++i] != DBNull.Value) { model.Content = dr.GetString(i); } if (dr[++i] != DBNull.Value) { model.Amount = dr.GetInt32(i); } if (dr[++i] != DBNull.Value) { model.Balance = dr.GetInt32(i); } if (dr[++i] != DBNull.Value) { model.Price = dr.GetDecimal(i); } if (dr[++i] != DBNull.Value) { model.CreateTime = dr.GetDateTime(i); } if (dr[++i] != DBNull.Value) { model.OrderIndex = dr.GetInt32(i); } if (dr[++i] != DBNull.Value) { model.StateCode = dr.GetInt32(i); } if (dr[++i] != DBNull.Value) { model.Frozen = dr.GetInt32(i); } if (dr[++i] != DBNull.Value) { model.isSell = dr.GetInt32(i); } _list.Add(model); } return(_list); } }
public ShiMiao.Model.TD_Shop_Goods GetModel(string goodsID) { StringBuilder strSql = new StringBuilder(); strSql.Append("select GoodsID, OrgID, Title, Image, Content, Amount, Balance, Price, CreateTime, OrderIndex, StateCode,Frozen "); strSql.Append(" from TD_Shop_Goods "); strSql.Append(" where GoodsID=@GoodsID "); MySqlParameter[] parameters = { new MySqlParameter("@GoodsID", goodsID) }; ShiMiao.Model.TD_Shop_Goods model = null; using (DbDataReader dr = MySqlHelperUtil.ExecuteReader(strSql.ToString(), parameters)) { while (dr.Read()) { model = new ShiMiao.Model.TD_Shop_Goods(); if (dr[0] != DBNull.Value) { model.GoodsID = dr.GetString(0); } if (dr[1] != DBNull.Value) { model.OrgID = dr.GetInt32(1); } if (dr[2] != DBNull.Value) { model.Title = dr.GetString(2); } if (dr[3] != DBNull.Value) { model.Image = dr.GetString(3); } if (dr[4] != DBNull.Value) { model.Content = dr.GetString(4); } if (dr[5] != DBNull.Value) { model.Amount = dr.GetInt32(5); } if (dr[6] != DBNull.Value) { model.Balance = dr.GetInt32(6); } if (dr[7] != DBNull.Value) { model.Price = dr.GetDecimal(7); } if (dr[8] != DBNull.Value) { model.CreateTime = dr.GetDateTime(8); } if (dr[9] != DBNull.Value) { model.OrderIndex = dr.GetInt32(9); } if (dr[10] != DBNull.Value) { model.StateCode = dr.GetInt32(10); } if (dr[11] != DBNull.Value) { model.Frozen = dr.GetInt32(11); } } return(model); } }