Example #1
0
 public string Save(ChannelOrder channelOrder)
 {
     channelOrder.Replace4MySQL();
     StringBuilder strSql = new StringBuilder("insert into channel_order(`channel_id`,`order_id`,`channel_detail_id`,`store_dispatch_file`,`dispatch_seq`,`createtime`");
     strSql.AppendFormat(",`ordertime`,`latest_deliver_date`)values({0},'{1}','{2}'", channelOrder.Channel_Id, channelOrder.Order_Id, channelOrder.Channel_Detail_Id);
     strSql.AppendFormat(",'{0}','{1}',", channelOrder.Store_Dispatch_File, channelOrder.Dispatch_Seq);
     strSql.Append(channelOrder.Createtime == DateTime.MinValue ? "null," : "'" + channelOrder.Createtime.ToString("yyyy/MM/dd HH:mm:ss") + "',");
     strSql.Append(channelOrder.Ordertime == DateTime.MinValue ? "null," : "'" + channelOrder.Ordertime.ToString("yyyy/MM/dd HH:mm:ss") + "',");
     strSql.Append(channelOrder.Latest_Deliver_Date == DateTime.MinValue ? "null)" : "'" + channelOrder.Latest_Deliver_Date.ToString("yyyy/MM/dd HH:mm:ss") + "')");
     return strSql.ToString();
 }
Example #2
0
 public List<ChannelOrder> Query(ChannelOrder query)
 {
     query.Replace4MySQL();
     StringBuilder strSql = new StringBuilder("select serial_number,channel_id,order_id,channel_detail_id,store_dispatch_file,dispatch_seq,createtime,ordertime,latest_deliver_date from channel_order where 1=1 ");
     if (!string.IsNullOrEmpty(query.Order_Id))
     {
         strSql.AppendFormat(" and order_id='{0}'", query.Order_Id);
     }
     if (query.Channel_Id != 0)
     {
         strSql.AppendFormat(" and channel_id={0}", query.Channel_Id);
     }
     if (!string.IsNullOrEmpty(query.Channel_Detail_Id))
     {
         strSql.AppendFormat(" and channel_detail_id = '{0}'", query.Channel_Detail_Id);
     }
     return _dbAccess.getDataTableForObj<ChannelOrder>(strSql.ToString());
 }