//View the Selected Vehicle
 private void ViewSelected(object obj)
 {
     if (RequestProcessingList != null)
     {
         var vehicleModel   = RequestProcessingList.FirstOrDefault();
         var home           = new HomeWindowVM();
         var vehicleLocator = new VehicleLocatorVM();
         var vehicleDetails = new VehicleDetail();
         var window         = new Window()
         {
             Content = vehicleDetails
         };
         window.DataContext           = vehicleLocator.VehicalDetailsViewModel;
         vehicleLocator.Vin           = vehicleModel.Vin;
         vehicleLocator.VehicleId     = vehicleModel.VehiclesID;
         vehicleLocator.CustomerID    = vehicleModel.CustomerID;
         vehicleLocator.CreatedBy     = vehicleModel.CreatedBy;
         vehicleLocator.SelectedItems = new ObservableCollection <object>()
         {
             vehicleLocator
         };
         var list = new List <VehicleLocatorVM>()
         {
             vehicleLocator
         };
         DelegateEventVehicle.SetValueListMethod(list);
         DelegateEventVehicle.SetValueMethodTabEnable(false);
         DelegateEventVehicle.SetValueMethodCmd("Edit");
         window.Show();
     }
 }
示例#2
0
        /// <summary>
        /// Function to Clear the Customer List.
        /// </summary>
        /// <param name="objLoginProp"></param>
        /// <returns>void</returns>
        /// <createdBy></createdBy>
        /// <createdOn>May 10,2016</createdOn>
        private void Continue(object obj)
        {
            CommonSettings.logger.LogInfo(typeof(string), string.Format(CultureInfo.InvariantCulture, Resources.loggerMsgStart, DateTime.Now.ToShortDateString(), DateTime.Now.ToShortTimeString(), MethodBase.GetCurrentMethod().Name));
            try
            {
                if (SelectedDisRecipientGridItem != null)
                {
                    DelegateEventCustomer.SetCustomerValueMethod(SelectedDisRecipientGridItem);
                    DelegateEventVehicle.SetValueMethodCmd("Add");
                    //int countWindow = 0;
                    Application.Current.Properties["SearchCount"] = 0;
                    OnCloseWindowRequested();
                    //foreach (System.Windows.Window window in System.Windows.Application.Current.Windows)
                    //{
                    //    if (countWindow == 1)
                    //    {
                    //        window.Close();
                    //    }
                    //    countWindow++;
                    //}
                }
                else
                {
                    MessageBox.Show(Resources.MsgSelectUser);
                }
            }
            catch (Exception ex)
            {
                LogHelper.LogErrorToDb(ex);
                bool displayErrorOnUI = false;
                CommonSettings.logger.LogError(this.GetType(), ex);
                if (displayErrorOnUI)
                {
                    throw;
                }
            }

            finally
            {
                CommonSettings.logger.LogInfo(typeof(string), string.Format(CultureInfo.InvariantCulture, Resources.loggerMsgEnd, DateTime.Now.ToShortDateString(), DateTime.Now.ToShortTimeString(), MethodBase.GetCurrentMethod().Name));
            }
        }
示例#3
0
        /// <summary>
        /// Function to FIll Customer Data on row selection.
        /// </summary>
        /// <param name="objLoginProp"></param>
        /// <returns>void</returns>
        /// <createdBy></createdBy>
        /// <createdOn>May 10,2016</createdOn>
        private void FillData(object obj)
        {
            CommonSettings.logger.LogInfo(typeof(string), string.Format(CultureInfo.InvariantCulture, Resources.loggerMsgStart, DateTime.Now.ToShortDateString(), DateTime.Now.ToShortTimeString(), MethodBase.GetCurrentMethod().Name));
            try
            {
                DelegateEventCustomer.SetCustomerValueMethod(SelectedDisRecipientGridItem);
                DelegateEventVehicle.SetValueMethodCmd("Add");
            }
            catch (Exception ex)
            {
                LogHelper.LogErrorToDb(ex);
                bool displayErrorOnUI = false;
                CommonSettings.logger.LogError(this.GetType(), ex);
                if (displayErrorOnUI)
                {
                    throw;
                }
            }

            finally
            {
                CommonSettings.logger.LogInfo(typeof(string), string.Format(CultureInfo.InvariantCulture, Resources.loggerMsgEnd, DateTime.Now.ToShortDateString(), DateTime.Now.ToShortTimeString(), MethodBase.GetCurrentMethod().Name));
            }
        }