Пример #1
0
    public static string GetTripWMSSyncSQL(String trip_id)
    {
        StringBuilder result = new StringBuilder();

        result.AppendLine($"DELETE FROM ReleaseTripDetails WHERE trip = '{ trip_id }';");
        result.AppendLine($"DELETE FROM ReleaseTrips WHERE trip_id = '{ trip_id }';");

        DataSet set      = DataSupport.RunDataSet($"SELECT * FROM Trips WHERE trip_id = '{trip_id}'; SELECT * FROM TripOrders WHERE trip = '{trip_id}';");
        DataRow trip_row = set.Tables[0].Rows[0];

        Dictionary <String, Object> header = new Dictionary <string, object>();

        header.Add("trip_id", trip_id);
        header.Add("authorized_receiver", trip_row["in_charge"].ToString());
        header.Add("tms_name", DataSupport.GetTMSCode());

        result.Append(DataSupport.GetInsert("ReleaseTrips", header));

        foreach (DataRow row in set.Tables[1].Rows)
        {
            Dictionary <String, Object> detail = new Dictionary <string, object>();
            detail.Add("trip", trip_id);
            detail.Add("order_id", row["order_id"].ToString());
            detail.Add("drop_sequence", row["drop_sequence"].ToString());
            result.Append(DataSupport.GetInsert("ReleaseTripDetails", detail));
        }

        return(result.ToString());
    }
Пример #2
0
        public void WMSHeaderInsert(string tripId, string incharge)
        {
            var param = new Dictionary <string, object>();

            param.Add("trip_id", tripId);
            param.Add("authorized_receiver", incharge);
            param.Add("tms_name", DataSupport.GetTMSCode());
            WMSSqlScript.AppendLine(DataSupport.GetUpsert("ReleaseTrips", param, "trip_id"));
        }