예제 #1
0
 public FullPagePhotoDelyvery(ManagerDispatchMob managerDispatchMob, VehiclwInformation vehiclwInformation, string idShip, string pngPaternPhoto,
                              string typeCar, int photoIndex, InitDasbordDelegate initDasbordDelegate, GetVechicleDelegate getVechicleDelegate, string nameLayoute,
                              string onDeliveryToCarrier, string totalPaymentToCarrier)
 {
     this.pngPaternPhoto     = pngPaternPhoto;
     fullPagePhotoDelyveryMV = new FullPagePhotoDelyveryMV(managerDispatchMob, vehiclwInformation, idShip, typeCar, photoIndex, Navigation, initDasbordDelegate, getVechicleDelegate, onDeliveryToCarrier, totalPaymentToCarrier);
     InitializeComponent();
     Xamarin.Forms.NavigationPage.SetHasNavigationBar(this, false);
     BindingContext     = fullPagePhotoDelyveryMV;
     paternPhoto.Source = pngPaternPhoto;
     dmla.IsVisible     = false;
     if (fullPagePhotoDelyveryMV.Car.TypeIndex != null && fullPagePhotoDelyveryMV.Car.TypeIndex != "")
     {
         NameSelectPhoto.Text = $"{nameLayoute} - {photoIndex}/{fullPagePhotoDelyveryMV.Car.CountCarImg}";
     }
     else
     {
         NameSelectPhoto.Text = "--------------------";
     }
 }
예제 #2
0
        public async Task <VehiclwInformation> GetVehiclwInformationAndSaveDamageForUser(string idVech, string idShiping, List <DamageForUser> damageForUsers)
        {
            VehiclwInformation vehiclwInformation = context.VehiclwInformation.Where(v => v.Id.ToString() == idVech)
                                                    .Include(v => v.Ask)
                                                    .Include("PhotoInspections.Photos")
                                                    .Include("DamageForUsers")
                                                    .FirstOrDefault();
            Shipping shipping = context.Shipping
                                .Include("DamageForUsers")
                                .FirstOrDefault(v => v.Id == idShiping);

            if (shipping.DamageForUsers == null)
            {
                shipping.DamageForUsers = new List <DamageForUser>();
            }
            shipping.DamageForUsers.AddRange(damageForUsers);
            await context.SaveChangesAsync();

            return(vehiclwInformation);
        }
예제 #3
0
        private int GetData(string respJsonStr, ref string description, ref VehiclwInformation vehiclwInformation)
        {
            respJsonStr = respJsonStr.Replace("\\", "");
            respJsonStr = respJsonStr.Remove(0, 1);
            respJsonStr = respJsonStr.Remove(respJsonStr.Length - 1);
            var    responseAppS = JObject.Parse(respJsonStr);
            string status       = responseAppS.Value <string>("Status");

            if (status == "success")
            {
                vehiclwInformation = JsonConvert.DeserializeObject <VehiclwInformation>(responseAppS.
                                                                                        SelectToken("ResponseStr").ToString());
                return(3);
            }
            else
            {
                description = responseAppS
                              .Value <string>("description");
                return(2);
            }
        }
예제 #4
0
 private void AddBlocTakePictures(VehiclwInformation vehiclwInformation)
 {
     if (vehiclwInformation.Ask1 != null && vehiclwInformation.Ask1.Photo_after_loading_in_the_truck != null)
     {
         foreach (var item in vehiclwInformation.Ask1.Photo_after_loading_in_the_truck)
         {
             Image image = new Image()
             {
                 Source        = ImageSource.FromStream(() => new MemoryStream(ResizeImage(item.Base64))),
                 HeightRequest = 100,
                 WidthRequest  = 100,
                 Margin        = 3
             };
             image.GestureRecognizers.Add(new TapGestureRecognizer(VievFull));
             blockTakePictures.Children.Add(image);
         }
     }
     else
     {
         blockTakePictures.IsVisible      = false;
         TakePicturesNotContent.IsVisible = true;
     }
 }
예제 #5
0
 private void AddBlocSeatBelts(VehiclwInformation vehiclwInformation)
 {
     if (vehiclwInformation.Ask1 != null && vehiclwInformation.Ask1.App_will_force_driver_to_take_pictures_of_each_strap != null)
     {
         foreach (var item in vehiclwInformation.Ask1.App_will_force_driver_to_take_pictures_of_each_strap)
         {
             Image image = new Image()
             {
                 Source        = ImageSource.FromStream(() => new MemoryStream(ResizeImage(item.Base64))),
                 HeightRequest = 100,
                 WidthRequest  = 100,
                 Margin        = 3
             };
             image.GestureRecognizers.Add(new TapGestureRecognizer(VievFull));
             blockSeatBelts.Children.Add(image);
         }
     }
     else
     {
         blockSeatBelts.IsVisible  = false;
         strapNotContent.IsVisible = true;
     }
 }
예제 #6
0
 private void AddBlocItemPhoto(VehiclwInformation vehiclwInformation)
 {
     if (vehiclwInformation.Ask != null && vehiclwInformation.Ask.Any_personal_or_additional_items_with_or_in_vehicle != null)
     {
         foreach (var item in vehiclwInformation.Ask.Any_personal_or_additional_items_with_or_in_vehicle)
         {
             Image image = new Image()
             {
                 Source        = ImageSource.FromStream(() => new MemoryStream(ResizeImage(item.Base64))),
                 HeightRequest = 100,
                 WidthRequest  = 100,
                 Margin        = 3
             };
             image.GestureRecognizers.Add(new TapGestureRecognizer(VievFull));
             blockItems.Children.Add(image);
         }
     }
     else
     {
         blockItems.IsVisible      = false;
         itemsNotContent.IsVisible = true;
     }
 }
예제 #7
0
 public ClientStart(ManagerDispatchMob managerDispatchMob, VehiclwInformation vehiclwInformation, string idShip, InitDasbordDelegate initDasbordDelegate, string onDeliveryToCarrier, string totalPaymentToCarrier)
 {
     askForUser = new AskForUser(managerDispatchMob, vehiclwInformation, idShip, initDasbordDelegate, onDeliveryToCarrier, totalPaymentToCarrier);
     InitializeComponent();
 }
예제 #8
0
        public string GetStrAction(string key, string idConmpany, string idOrder, string idVech, string idDriver, string action)
        {
            string strAction = "";

            //int idUser = _sqlEntityFramworke.GetUserIdByKey(key);
            if (action == "Assign")
            {
                string fullNameUser   = _sqlEntityFramworke.GetFullNameUserByKey(key);
                string fullNameDriver = _sqlEntityFramworke.GetFullNameDriverById(idDriver);
                strAction = $"{fullNameUser} assign the driver ordered {fullNameDriver}";
            }
            else if (action == "Unassign")
            {
                string fullNameUser   = _sqlEntityFramworke.GetFullNameUserByKey(key);
                string fullNameDriver = _sqlEntityFramworke.GetFullNameDriverById(idDriver);
                strAction = $"{fullNameUser} withdrew an order from {fullNameDriver} driver";
            }
            else if (action == "Solved")
            {
                string fullNameUser = _sqlEntityFramworke.GetFullNameUserByKey(key);
                strAction = $"{fullNameUser} clicked on the \"Solved\" button";
            }
            else if (action == "ArchivedOrder")
            {
                string fullNameUser = _sqlEntityFramworke.GetFullNameUserByKey(key);
                strAction = $"{fullNameUser} transferred the order to the archive";
            }
            else if (action == "DeletedOrder")
            {
                string fullNameUser = _sqlEntityFramworke.GetFullNameUserByKey(key);
                strAction = $"{fullNameUser} transferred the order to deleted orders";
            }
            else if (action == "Creat")
            {
                string fullNameUser = _sqlEntityFramworke.GetFullNameUserByKey(key);
                strAction = $"{fullNameUser} created an order";
            }
            else if (action == "SavaOrder")
            {
                string fullNameUser = _sqlEntityFramworke.GetFullNameUserByKey(key);
                strAction = $"{fullNameUser} edited the order";
            }
            else if (action == "SavaVech")
            {
                string             fullNameUser       = _sqlEntityFramworke.GetFullNameUserByKey(key);
                VehiclwInformation vehiclwInformation = _sqlEntityFramworke.GetVechById(idVech);
                strAction = $"{fullNameUser} edited the vehicle {vehiclwInformation.Year} y. {vehiclwInformation.Make} {vehiclwInformation.Model}";
            }
            else if (action == "RemoveVech")
            {
                string             fullNameUser       = _sqlEntityFramworke.GetFullNameUserByKey(key);
                VehiclwInformation vehiclwInformation = _sqlEntityFramworke.GetVechById(idVech);
                strAction = $"{fullNameUser} removed the vehicle {vehiclwInformation.Year} y. {vehiclwInformation.Make} {vehiclwInformation.Make}";
            }
            else if (action == "AddVech")
            {
                string fullNameUser = _sqlEntityFramworke.GetFullNameUserByKey(key);
                strAction = $"{fullNameUser} created a vehicle";
            }
            return(strAction);
        }
 public ClientStart(ManagerDispatchMob managerDispatchMob, string idShip, InitDasbordDelegate initDasbordDelegate, string onDeliveryToCarrier, string totalPaymentToCarrier, VehiclwInformation vehiclwInformation, GetShiping getShiping, GetVechicleDelegate getVechicleDelegate, bool isproplem)
 {
     askForUserDelyvery = new AskForUserDelyvery(managerDispatchMob, idShip, initDasbordDelegate, onDeliveryToCarrier, totalPaymentToCarrier, vehiclwInformation, getShiping, getVechicleDelegate, isproplem);
     InitializeComponent();
 }
예제 #10
0
        public int GetVehiclwInformation(string token, int idVech, ref string description, ref VehiclwInformation vehiclwInformation)
        {
            IRestResponse response = null;
            string        content  = null;

            try
            {
                RestClient  client  = new RestClient(Config.BaseReqvesteUrl);
                RestRequest request = new RestRequest("Mobile/GetVechicleInffo", Method.POST);
                client.Timeout = 60000;
                request.AddHeader("Accept", "application/json");
                request.AddParameter("token", token);
                request.AddParameter("idVech", idVech);
                response = client.Execute(request);
                content  = response.Content;
            }
            catch (Exception)
            {
                return(4);
            }
            if (content == "" || response.StatusCode == System.Net.HttpStatusCode.NotFound)
            {
                return(4);
            }
            else
            {
                return(GetData(content, ref description, ref vehiclwInformation));
            }
        }