예제 #1
0
 private void Excute()
 {
     if (AppConstant.ValidateInput(RegistrationNo))
     {
         try
         {
             var id = SlotID.Split('-').ToList();
             PMSService.Insert(new Vehicle_Parking()
             {
                 RegistrationId = RegistrationNo,
                 ArrivalTime    = EntryTime.ToLocalTime(),
                 DepartTime     = null,
                 SlotId         = Convert.ToInt16(id.ElementAtOrDefault(1)),
                 TotalFare      = null,
                 VehicleType    = VehicleType.ToString(),
                 Floor          = id.ElementAt(0).ToString()
             });
         }
         catch (Exception ex)
         {
             Debug.WriteLine(ex.Message);
         }
         MessageBoxResult messageBoxResult = MessageBox.Show("Data inserted Successfully!", "Saved", MessageBoxButton.OK);
         if (messageBoxResult == MessageBoxResult.OK)
         {
             ClearForm();
         }
     }
     else
     {
         MessageBox.Show("Enter valid Registration No!", "Oops");
     }
 }
예제 #2
0
 /// <summary>
 /// Create a string to represent this object.
 /// It will display all the values as a single line string.
 /// </summary>
 /// <returns>String of this object.</returns>
 public override string ToString()
 {
     return(IdToString(ID) + ", " +
            EntryTime.ToString("yyyyMMdd, HHmmss") + ", " +
            Results + ", " +
            Notes);
 }
예제 #3
0
 public Entry(string filename, string path, EntryTime time, int size, byte[] data)
 {
     Filename = filename;
     Path     = path;
     Time     = time;
     Size     = size;
     Data     = data;
 }
예제 #4
0
 public override string Format()
 {
     return(JsonConvert.SerializeObject(new
     {
         TollId = TollId.ToString(CultureInfo.InvariantCulture),
         EntryTime = EntryTime.ToString("o"),
         LicensePlate,
         State,
         CarModel.Make,
         CarModel.Model,
         VehicleType = CarModel.VehicleType.ToString(CultureInfo.InvariantCulture),
         VehicleWeight = CarModel.VehicleWeight.ToString(CultureInfo.InvariantCulture),
         Toll = TollAmount.ToString(CultureInfo.InvariantCulture),
         Tag = Tag.ToString(CultureInfo.InvariantCulture)
     }));
 }
예제 #5
0
        public string this[string columnName]
        {
            get
            {
                string result = null;
                if (columnName == "SlotID")
                {
                    if (string.IsNullOrEmpty(SlotID))
                    {
                        result = "SlotId cannot be empty.";
                        return(result);
                    }
                }

                if (columnName == "EntryTime")
                {
                    if (string.IsNullOrEmpty(EntryTime.ToString()))
                    {
                        result = "Entry Time cannot be empty";
                        return(result);
                    }
                }

                if (columnName == "RegistrationNo")
                {
                    if (string.IsNullOrEmpty(RegistrationNo))
                    {
                        result = "RegistrationNo cannot be empty";
                        return(result);
                    }

                    if (!AppConstant.ValidateInput(RegistrationNo))
                    {
                        result = "Invalid registration number!";
                        return(result);
                    }
                }


                return(null);
            }
        }
예제 #6
0
 public override string ToString()
 {
     return(direction + "," + entryPrice + "," + EntryTime.ToString(TIMEFORMAT) + "," +
            exitPrice + "," + ExitTime.ToString(TIMEFORMAT));
 }
 /// <summary>
 /// نمایش رشته ای AttendanceTime
 /// </summary>
 /// <returns>رشته متناظر با IRNationalID</returns>
 public override string ToString()
 {
     return(string.Format("{0} ({1} - {2}, {3})", Employee.ToString(), EntryTime.ToShortTimeString(), ExitTime.ToShortTimeString()));
 }
예제 #8
0
 public void AssembleDatesTimes()
 {
     Entry = string.Format("{0} {1}", EntryDate.Trim(), EntryTime.Trim());
     Exit  = string.Format("{0} {1}", ExitDate.Trim(), ExitTime.Trim());
 }
예제 #9
0
 private bool CanExecute()
 {
     return(!String.IsNullOrWhiteSpace(SlotID) && !String.IsNullOrWhiteSpace(EntryTime.ToString()) && !String.IsNullOrWhiteSpace(RegistrationNo));
 }
        public async Task <ActionResult> Get(int id)
        {
            try
            {
                var SensorDetails = await _dataContext.SensorData.Include("Parameter_Master").Where(w => w.Device_Id == id).ToListAsync();

                if (SensorDetails != null)
                {
                    var DeviceDetails = await _dataContext.Device_info
                                        .Where(w => w.Id == id)
                                        .Select(s => new DeviceWiseData
                    {
                        Area           = s.Area,
                        Country        = s.Country,
                        Device_Id      = s.Id,
                        Device_Name    = s.Device_Name,
                        lastupdatedon  = s.lastupdatedon,
                        Latitude       = s.Latitude,
                        Longitude      = s.Longitude,
                        State          = s.State,
                        Status         = s.Status,
                        ParameterNames = new List <ParametersValue>(),
                        Entries        = new List <EntryTime>()
                    }).FirstOrDefaultAsync();

                    var names = SensorDetails.Select(s => s.Parameter_Master.Param_Name).Distinct().ToList();
                    foreach (var name in names)
                    {
                        var pUnit = SensorDetails.Where(n => n.Parameter_Master.Param_Name == name).Select(s => s.Parameter_Master.Unit).FirstOrDefault();

                        var Param_values = new ParametersValue {
                            Name = name, Unit = pUnit
                        };

                        DeviceDetails.ParameterNames.Add(Param_values);
                    }
                    //SensorDetails.Select(s => new ParametersValue
                    //{

                    //    Name = s.Parameter_Master.Param_Name,
                    //    Unit = s.Parameter_Master.Unit

                    //}
                    // ).Distinct().ToList(),

                    var dates = SensorDetails.Select(s => s.DataEntryTime).Distinct().ToList();


                    foreach (var date in dates)
                    {
                        var entry = new EntryTime {
                            datetime = date, Params = new List <ParamsForDevice>()
                        };

                        entry.Params = SensorDetails
                                       .Where(w => w.DataEntryTime == date)
                                       .Select(s => new ParamsForDevice
                        {
                            ParameterName = s.Parameter_Master.Param_Name,
                            Value         = s.Input_Value,
                            color         = "Green"
                        }).ToList();
                        DeviceDetails.Entries.Add(entry);
                    }

                    return(Ok(DeviceDetails));
                }
                else
                {
                    return(NotFound("No details found for this device"));
                }
            }
            catch (Exception ex)
            {
                _logger.LogError($"Error while getting the data{ex.Message}");
                return(BadRequest("No data available for the device"));
            }
        }
예제 #11
0
 public int CompareTo(object obj)
 {
     return(EntryTime.CompareTo(((Request)obj).EntryTime));
 }