示例#1
0
        public static List <MT_CarsTask> GetMtTasks(string token)
        {
            string             rezult = MTAPI_Helper.Get(String.Format(MTAPI_Helper.mt_url + "/modules/carroutes/tasks?token={0}", token));
            List <MT_CarsTask> tasks  = JsonHelper.JsonDeserialize <List <MT_CarsTask> >(rezult);

            return(tasks);
        }
示例#2
0
        public static MT_CarsTask PostCarsTask(MT_CarsTask cars_task, string token)
        {
            string      rezult   = MTAPI_Helper.Post(String.Format(MTAPI_Helper.mt_url + "/modules/carroutes/tasks?token={0}", token), JsonHelper.JsonSerializer <MT_CarsTask>(cars_task));
            MT_CarsTask new_task = JsonHelper.JsonDeserialize <MT_CarsTask>(rezult);

            return(new_task);
        }
示例#3
0
        public static MT_CarShortReportModel GetCarShortReport(int glonass_id, DateTime date_begin, DateTime date_end, string token)
        {
            String data = MTAPI_Helper.Get(String.Format(MTAPI_Helper.mt_url + "/reports/short/{0}/{1}/{2}?token={3}", glonass_id,
                                                         MTAPI_Helper.GetUnixTime(date_begin), MTAPI_Helper.GetUnixTime(date_end), token));

            return(JsonHelper.JsonDeserialize <MT_CarShortReportModel>(data));
        }
示例#4
0
 public static bool DeleteTask(int id_mt_task, string reason, string token)
 {
     try
     {
         MTAPI_Helper.Put(String.Format(MTAPI_Helper.mt_url + "/modules/carroutes/tasks/{0}/cancel?token={1}", id_mt_task, token),
                          "{" + String.Format("\"reason\":\"{0}\"", reason) + "}");
         return(true);
     }
     catch
     {
         return(false);
     }
 }
示例#5
0
 public static bool PostWayBills(List <MT_CarWayBill> way_bills, string token)
 {
     MTAPI_Helper.Post(String.Format(MTAPI_Helper.mt_url + "/wayBill?token={0}", token), JsonHelper.JsonSerializer <List <MT_CarWayBill> >(way_bills));
     return(true);
 }