Beispiel #1
0
        public string getOrderDeliveryState(string orderid)
        {
            string            result    = "配送";
            string            selectSql = string.Format(@"Select * From Store_DeliveryOrder Where orderid='{0}'", orderid);
            DbCommand         command   = this.database.GetSqlStringCommand(selectSql);
            DeliveryOrderInfo info      = new DeliveryOrderInfo();

            using (IDataReader reader = this.database.ExecuteReader(command))
            {
                info = ReaderConvert.ReaderToModel <DeliveryOrderInfo>(reader);
            }
            if (info == null)
            {
                return(result);
            }
            if (info.State == 1)
            {
                result = "送达";
            }
            else if (info.State == 2)
            {
                result = "结束";
            }
            return(result);
        }
Beispiel #2
0
 public bool SetDeliveryUser(DeliveryOrderInfo info)
 {
     try
     {
         string         execSql = "insert into Store_DeliveryOrder (OrderId,State,DeliveryUserId,AddTime,StoreId) values (@OrderId,@State,@DeliveryUserId,@AddTime,@StoreId)";
         SqlParameter[] para    = new SqlParameter[]
         {
             new SqlParameter("@OrderId", info.OrderId),
             new SqlParameter("@State", info.State),
             new SqlParameter("@DeliveryUserId", info.DeliveryUserId),
             new SqlParameter("@AddTime", info.AddTime),
             new SqlParameter("@StoreId", info.StoreId),
         };
         DbCommand sqlCommand = this.database.GetSqlStringCommand(execSql);
         this.database.AddInParameter(sqlCommand, "OrderId", DbType.String, info.OrderId);
         this.database.AddInParameter(sqlCommand, "State", DbType.Int32, info.State);
         this.database.AddInParameter(sqlCommand, "DeliveryUserId", DbType.Int32, info.DeliveryUserId);
         this.database.AddInParameter(sqlCommand, "AddTime", DbType.Date, info.AddTime);
         this.database.AddInParameter(sqlCommand, "StoreId", DbType.Int32, info.StoreId);
         return(this.database.ExecuteNonQuery(sqlCommand) > 0);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Beispiel #3
0
        public bool arrivedDeliveryOrder(DeliveryOrderInfo info)
        {
            DbCommand command = this.database.GetSqlStringCommand(string.Format("update Store_DeliveryOrder set [state]=2 ,ArrivedTime='{1}'  where orderid='{0}'", info.OrderId, info.ArrivedTime));

            return(this.database.ExecuteNonQuery(command) > 0);
        }