Beispiel #1
0
        public static string ChangeTehObsluzh(string id_car, string teh_obslyzh)
        {
            var user   = User.GetInstance();
            var result = functions.GetDataString(functions.Translate("ApiUrl") + "Park.ChangeTehObsluzh&id_car=" + id_car + "&teh_obslyzh=" + teh_obslyzh + "&token=" + user.token + "&sign=" + Sign.CreateSign(user.token));

            return(result != "" ? result : "");
        }
Beispiel #2
0
 public static Task <List <WorkPlan> > Get()
 {
     return(Task.Run(() =>
     {
         var user = User.GetInstance();
         var result = functions.GetDataString(functions.Translate("ApiUrl") + "WorkPlan.Get&token=" + user.token + "&sign=" + Sign.CreateSign(user.token));
         return JsonConvert.DeserializeObject <List <WorkPlan> >(result);
     }));
 }
Beispiel #3
0
 public void Edit()
 {
     var user   = User.GetInstance();
     var result = functions.GetDataString(functions.Translate("ApiUrl") + "WorkPlan.Edit&plan=" + JsonConvert.SerializeObject(this) + "&token=" + user.token + "&sign=" + Sign.CreateSign(user.token));
 }
Beispiel #4
0
        public static List <Client> SearchClients(string phone)
        {
            var    user = User.GetInstance();
            string data = functions.GetDataString(functions.Translate("ApiUrl") + "Client.SearchClient&phone=" + phone + "&token=" + user.token + "&sign=" + Sign.CreateSign(user.token));

            return(JsonConvert.DeserializeObject <List <Client> >(data));
        }
Beispiel #5
0
        public static int GetClientId(string fio, string phone)
        {
            var user = User.GetInstance();

            return(Convert.ToInt32(functions.GetDataString(functions.Translate("ApiUrl") + "Client.GetClientId&fio=" + fio + "&phone=" + phone + "&token=" + user.token + "&sign=" + Sign.CreateSign(user.token))));
        }
Beispiel #6
0
        public static List <Order> GetLastOrder()
        {
            var    user = User.GetInstance();
            string data = functions.GetDataString(functions.Translate("ApiUrl") + "Order.GetLastOrders&token=" + user.token + "&sign=" + Sign.CreateSign(user.token));

            return(JsonConvert.DeserializeObject <List <Order> >(data));
        }
Beispiel #7
0
        public static List <OrderInService> GetClientHistory(int id_client)
        {
            var    user = User.GetInstance();
            string data = functions.GetDataString(functions.Translate("ApiUrl") + "Order.GetClientHistory&id_client=" + id_client + "&token=" + user.token + "&sign=" + Sign.CreateSign(user.token));

            return(JsonConvert.DeserializeObject <List <OrderInService> >(data));
        }
Beispiel #8
0
        public static void SetMap(string id, string map)
        {
            var user   = User.GetInstance();
            var massiv = map.Split('?');

            for (int i = 0; i <= massiv[1].Length / 100; i++)
            {
                if (i == massiv[1].Length / 100)
                {
                    var map_bufer = massiv[1].Substring(i * 100, massiv[1].Length - (i * 100));
                    functions.GetDataString(functions.Translate("ApiUrl") + "Rout.SetMap/id=" + id.ToString() + "&map=" + map_bufer + "&token=" + user.token + "&sign=" + Sign.CreateSign(user.token));
                }
                else
                {
                    var map_bufer = massiv[1].Substring(i * 100, 100);
                    functions.GetDataString(functions.Translate("ApiUrl") + "Rout.SetMap/id=" + id.ToString() + "&map=" + map_bufer + "&token=" + user.token + "&sign=" + Sign.CreateSign(user.token));
                }
            }
        }
Beispiel #9
0
        public Rout(int _id)
        {
            var user   = User.GetInstance();
            var data   = functions.GetDataString(functions.Translate("ApiUrl") + "Rout.Get&id=" + _id.ToString() + "&token=" + user.token + "&sign=" + Sign.CreateSign(user.token));
            var _marsh = JsonConvert.DeserializeObject <Rout>(data);

            id      = _marsh.id;
            name    = _marsh.name;
            url_map = _marsh.url_map;
            status  = _marsh.status;
        }
Beispiel #10
0
        public static List <Rout> GetMarshrutInArchive()
        {
            var    user = User.GetInstance();
            string data = functions.GetDataString(functions.Translate("ApiUrl") + "Rout.GetRoutsInArchive&token=" + user.token + "&sign=" + Sign.CreateSign(user.token));

            return(JsonConvert.DeserializeObject <List <Rout> >(data));
        }
Beispiel #11
0
        public static List <IApi> GetAllPromPynkt()
        {
            var    user = User.GetInstance();
            string data = functions.GetDataString(functions.Translate("ApiUrl") + "Rout.GetAllLocality&token=" + user.token + "&sign=" + Sign.CreateSign(user.token));

            return(JsonConvert.DeserializeObject <List <IApi> >(data));
        }
Beispiel #12
0
        public string Unarchive()
        {
            var user   = User.GetInstance();
            var result = functions.GetDataString(functions.Translate("ApiUrl") + "Rout.Unarchive&id=" + id.ToString() + "&token=" + user.token + "&sign=" + Sign.CreateSign(user.token));

            return(result != "" ? result : "");
        }
Beispiel #13
0
        public string ChangePassword(string _pass)
        {
            var user   = GetInstance();
            var result = functions.GetDataString(functions.Translate("ApiUrl") + "User.ChangePassword&id_user="******"&pass="******"&token=" + user.token + "&sign=" + Sign.CreateSign(user.token));

            return(result != "" ? result : "");
        }
Beispiel #14
0
        public static User Login(int id, string pass)
        {
            var result = functions.GetDataString(functions.Translate("ApiUrl") + "User.Login&id=" + id + "&password="******"&sign=" + Sign.CreateSignLogin());

            switch (result)
            {
            case "Неверный пароль":
                return(null);

            case "Ошибка подписи":
                return(null);

            default:
                return(JsonConvert.DeserializeObject <User>(result));
            }
        }
Beispiel #15
0
        public static Order GetOrder(string id_order)
        {
            var    user = User.GetInstance();
            string data = functions.GetDataString(functions.Translate("ApiUrl") + "Order.GetOrder&id_order=" + id_order + "&token=" + user.token + "&sign=" + Sign.CreateSign(user.token));

            return(JsonConvert.DeserializeObject <Order>(data));
        }
Beispiel #16
0
        public void GetPromPynkt()
        {
            var    user = User.GetInstance();
            string data = functions.GetDataString(functions.Translate("ApiUrl") + "Rout.GetLocality&id_rout=" + id + "&token=" + user.token + "&sign=" + Sign.CreateSign(user.token));

            PromPynkt = JsonConvert.DeserializeObject <List <IApi> >(data);
        }
Beispiel #17
0
        public static string CreateNewOrder(Order NewOrder, string id_client)
        {
            var user   = User.GetInstance();
            var result = functions.GetDataString(functions.Translate("ApiUrl") + "Order.CreateOrderFromMesto&id_type=" + NewOrder.type_bilet + "&fio_client=" + NewOrder.fio + "&id_client=" + id_client + "&otkyda=" + NewOrder.otkyda.ToString() + "&kyda=" + NewOrder.kyda.ToString() + "&id_poezdka=" + NewOrder.id_poezdka.ToString() + "&id_akcia=" + NewOrder.id_akcia + "&cost=" + NewOrder.cost.ToString() + "&mesto=" + NewOrder.mesto + "&status=" + NewOrder.status + "&from_order=" + NewOrder.from_order + "&token=" + user.token + "&sign=" + Sign.CreateSign(user.token));

            return(result != "" ? result : "");
        }
Beispiel #18
0
        public string CreateMarshrut()
        {
            var user = User.GetInstance();
            var po   = "";

            for (int i = 0; i < PromPynkt.Count; i++)
            {
                if (i == PromPynkt.Count - 1)
                {
                    po += PromPynkt[i].id.ToString();
                }
                else
                {
                    po += PromPynkt[i].id.ToString() + ",";
                }
            }
            var result = functions.GetDataString(functions.Translate("ApiUrl") + "Rout.Create&name=" + name + "&url_map=" + url_map + "&pp=" + po + "&token=" + user.token + "&sign=" + Sign.CreateSign(user.token));

            return(result != "" ? result : "");
        }
Beispiel #19
0
        public static string SetOrder(Order Order, int id_client)
        {
            var user   = User.GetInstance();
            var result = functions.GetDataString(functions.Translate("ApiUrl") + "Order.SetOrderAdmin&id_order=" + Order.id.ToString() + "&id_type=" + Order.type_bilet + "&fio_client=" + Order.fio + "&id_client=" + id_client.ToString() + "&otkyda=" + Order.otkyda.ToString() + "&kyda=" + Order.kyda.ToString() + "&id_poezdka_new=" + Order.id_poezdka.ToString() + "&id_akcia=" + Order.id_akcia + "&cost_new=" + Order.cost.ToString() + "&mesto_new=" + Order.mesto + "&status=" + Order.status + "&token=" + user.token + "&sign=" + Sign.CreateSign(user.token));

            return(result != "" ? result : "");
        }
Beispiel #20
0
        public static List <OrderInService> GetLastOrderNotDispetcher(string limit)
        {
            var    user = User.GetInstance();
            string data = functions.GetDataString(functions.Translate("ApiUrl") + "Order.GetLastOrderNotDispetcher&limit=" + limit + "&token=" + user.token + "&sign=" + Sign.CreateSign(user.token));

            return(JsonConvert.DeserializeObject <List <OrderInService> >(data));
        }
Beispiel #21
0
        public static Client GetClient(int id)
        {
            var    user = User.GetInstance();
            string data = functions.GetDataString(functions.Translate("ApiUrl") + "Client.GetClient&id=" + id.ToString() + "&token=" + user.token + "&sign=" + Sign.CreateSign(user.token));

            return(JsonConvert.DeserializeObject <Client>(data));
        }
Beispiel #22
0
        public static double GetOrderCount(string date, string parametr, string type_method)
        {
            var user = User.GetInstance();

            switch (type_method)
            {
            case "0":
                return(Convert.ToDouble(functions.GetDataString(functions.Translate("ApiUrl") + "Order.GetOrderCountForGraphicZagr&id_marsh=" + parametr + "&date=" + date + "&token=" + user.token + "&sign=" + Sign.CreateSign(user.token))));

            case "1":
                return(Convert.ToDouble(functions.GetDataString(functions.Translate("ApiUrl") + "Order.GetOrderCountForGraphicTypeBilet&id_type=" + parametr + "&date=" + date + "&token=" + user.token + "&sign=" + Sign.CreateSign(user.token))));

            case "2":
                return(Convert.ToDouble(functions.GetDataString(functions.Translate("ApiUrl") + "Order.GetOrderCountForGraphicFromOrder&id_type=" + parametr + "&date=" + date + "&token=" + user.token + "&sign=" + Sign.CreateSign(user.token))));

            default:
                return(0);
            }
        }
Beispiel #23
0
        public string Set(string fio, string phone, DateTime dr, string email)
        {
            var    user = User.GetInstance();
            string data = functions.GetDataString(functions.Translate("ApiUrl") + "Client.EditClient&id=" + id.ToString() + "&fio=" + fio + "&phone=" + phone + "&date=" + dr.ToString("yyyy-MM-dd") + "&email=" + email + "&token=" + user.token + "&sign=" + Sign.CreateSign(user.token));

            return(data);
        }
Beispiel #24
0
        public static int CountOrderFromSiteAndMobile()
        {
            var user = User.GetInstance();

            return(Convert.ToInt32(functions.GetDataString(functions.Translate("ApiUrl") + "Order.CountOrderFromSiteAndMobile&token=" + user.token + "&sign=" + Sign.CreateSign(user.token))));
        }
Beispiel #25
0
        public static string Create(string id_order)
        {
            var user = User.GetInstance();

            return(functions.GetDataString(functions.Translate("ApiUrl") + "Tranzaction.Create/id_order=" + id_order + "&cost=0&token=" + user.token + "&sign=" + Sign.CreateSign(user.token)));
        }
Beispiel #26
0
        public static bool CheckEditOrder(string id_order)
        {
            var user = User.GetInstance();

            return(Convert.ToBoolean(functions.GetDataString(functions.Translate("ApiUrl") + "Order.CheckEditOrder&id_order=" + id_order + "&token=" + user.token + "&sign=" + Sign.CreateSign(user.token))));
        }
Beispiel #27
0
        public static int GetCountOrder(DateTime date_start, DateTime date_end)
        {
            var user   = User.GetInstance();
            var result = functions.GetDataString(functions.Translate("ApiUrl") + "WorkPlan.GetCountOrder&date_start=" + date_start.ToString("yyyy-MM-dd") + "&date_end=" + date_end.ToString("yyyy-MM-dd") + "&token=" + user.token + "&sign=" + Sign.CreateSign(user.token));

            return(Convert.ToInt32(result));
        }
Beispiel #28
0
        public static List <Order> GetOrders(string Date, string SelectMarshId)
        {
            var    user = User.GetInstance();
            string data = functions.GetDataString(functions.Translate("ApiUrl") + "Order.GetAllOrders&date=" + Date + "&id_marsh=" + SelectMarshId + "&token=" + user.token + "&sign=" + Sign.CreateSign(user.token));

            return(JsonConvert.DeserializeObject <List <Order> >(data));
        }
Beispiel #29
0
 public void Delete()
 {
     var user   = User.GetInstance();
     var result = functions.GetDataString(functions.Translate("ApiUrl") + "WorkPlan.Delete&id=" + id.ToString() + "&token=" + user.token + "&sign=" + Sign.CreateSign(user.token));
 }
Beispiel #30
0
        public static string RenewLease(string id_car, string arenda_nach, string arenda_konec)
        {
            var user   = User.GetInstance();
            var result = functions.GetDataString(functions.Translate("ApiUrl") + "Park.RenewLease&id_car=" + id_car + "&arenda_nach=" + arenda_nach + "&arenda_konec=" + arenda_konec + "&token=" + user.token + "&sign=" + Sign.CreateSign(user.token));

            return(result != "" ? result : "");
        }