/// <summary> /// Get station Information from the Device ID /// </summary> /// <param name="DevideID">String MAC Address </param> /// <returns>List<cstStationMasterTbl> </returns> public List <cstStationMasterTbl> GetStationList(String DevideNumber) { List <cstStationMasterTbl> _lsReturn = new List <cstStationMasterTbl>(); try { var stationMaster = from station in entx3v6.Stations where station.DeviceNumber == DevideNumber select station; foreach (var station in stationMaster) { cstStationMasterTbl TStaion = new cstStationMasterTbl(); TStaion.StationID = station.StationID; TStaion.StationName = station.StationName; TStaion.RequestedUserID = station.RequestedUserID; TStaion.StationAlive = station.StationAlive; TStaion.RegistrationDate = station.RegistrationDate; TStaion.DeviceNumber = station.DeviceNumber; TStaion.StaionLocation = station.StationLocation; _lsReturn.Add(TStaion); } } catch (Exception) { } return(_lsReturn); }
public Boolean SaveStation() { Boolean _return = false; try { List <cstStationMasterTbl> lsStationMaster = Global.controller.GetStationMaster(_deviceNumber); if (lsStationMaster.Count <= 0) { List <cstStationMasterTbl> _lsStation = new List <cstStationMasterTbl>(); cstStationMasterTbl Station = new cstStationMasterTbl(); Station.StationID = Guid.Empty; Station.StationName = txtStationName.Text; Station.DeviceNumber = _deviceNumber; Station.RequestedUserID = Global.LoggedUserId; Station.StationAlive = 0; Station.RegistrationDate = DateTime.UtcNow; Station.StaionLocation = Global.controller.ApplicationLocation(); _lsStation.Add(Station); _return = Global.controller.SaveStationMaster(_lsStation); } } catch (Exception) {} return(_return); }
/// <summary> /// Selected item from Station Table /// </summary> /// <param name="StationID">Guid StaionID</param> /// <returns>List<cstStationMasterTbl> Indication Station Information</returns> public cstStationMasterTbl GetStationList(Guid StationID) { cstStationMasterTbl TStaion = new cstStationMasterTbl(); try { List <GetService.StationMasterDTO> _lsstation = new List <GetService.StationMasterDTO>(); var station = Service.Get.StationMasterByStationID(StationID); foreach (var item in station) { _lsstation.Add(item); } //entx3v6.Stations.SingleOrDefault(i => i.StationID == StationID); TStaion.StationID = _lsstation[0].StationID; TStaion.StationName = _lsstation[0].StationName; TStaion.RequestedUserID = _lsstation[0].RequestedUserID; TStaion.StationAlive = _lsstation[0].StationAlive; TStaion.RegistrationDate = _lsstation[0].RegistrationDate; TStaion.DeviceNumber = _lsstation[0].DeviceNumber; TStaion.StaionLocation = _lsstation[0].StaionLocation; } catch (Exception) { } return(TStaion); }
/// <summary> /// Station Information filter by station Name /// </summary> /// <param name="StationName">String Station Name</param> /// <returns>CstStationMasterTbl Information</returns> public cstStationMasterTbl GetStationInfo(String StationName) { cstStationMasterTbl _return = new cstStationMasterTbl(); try { var station = Service.Get.StationMasterByStationName(StationName); foreach (var itemstation in station) { //_lsstation.Add(itemstation); //entx3v6.Stations.SingleOrDefault(i => i.StationName == StationName); cstStationMasterTbl TStaion = new cstStationMasterTbl(); TStaion.StationID = itemstation.StationID; TStaion.StationName = itemstation.StationName; TStaion.RequestedUserID = itemstation.RequestedUserID; TStaion.StationAlive = itemstation.StationAlive; TStaion.RegistrationDate = itemstation.RegistrationDate; TStaion.DeviceNumber = itemstation.DeviceNumber; TStaion.StaionLocation = itemstation.StaionLocation; _return = TStaion; } } catch (Exception) {} return(_return); }
/// <summary> /// Change station location when Device Location updated /// </summary> /// <param name="Location">String Location Code</param> /// <returns>null</returns> public void UpdateStationLocation(String Location) { try { String DeviceNumber = Global.controller.getDeviceMAC(); List <cstStationMasterTbl> lsStationMaster = Global.controller.GetStationMaster(DeviceNumber); cstStationMasterTbl Station = lsStationMaster[0]; Station.StaionLocation = Location; List <cstStationMasterTbl> lsNewLocStation = new List <cstStationMasterTbl>(); lsNewLocStation.Add(Station); Global.controller.SaveStationMaster(lsNewLocStation, DeviceNumber); } catch (Exception) { } }
/// <summary> /// Selected item from Station Table /// </summary> /// <param name="StationID">Guid StaionID</param> /// <returns>List<cstStationMasterTbl> Indication Station Information</returns> public cstStationMasterTbl GetStationList(Guid StationID) { cstStationMasterTbl TStaion = new cstStationMasterTbl(); try { Station station = entx3v6.Stations.SingleOrDefault(i => i.StationID == StationID); TStaion.StationID = station.StationID; TStaion.StationName = station.StationName; TStaion.RequestedUserID = station.RequestedUserID; TStaion.StationAlive = station.StationAlive; TStaion.RegistrationDate = station.RegistrationDate; TStaion.DeviceNumber = station.DeviceNumber; TStaion.StaionLocation = station.StationLocation; } catch (Exception) { } return(TStaion); }
protected void gvStations_SelectedIndexChanged(object sender, EventArgs e) { try { GridViewRow row = gvStations.SelectedRow; List <cstStationMasterTbl> lsStationMaster = call.GetStationMaster(row.Cells[3].Text.ToString()); cstStationMasterTbl Station = lsStationMaster[0]; Station.StationAlive = 1; if (row.Cells[2].Text.ToString() == "Active") { Station.StationAlive = 0; } List <cstStationMasterTbl> _lsStation = new List <cstStationMasterTbl>(); _lsStation.Add(Station); call.SaveStationMaster(_lsStation, row.Cells[3].Text.ToString()); //refresh Grid View FillDgvActiveStation(); } catch (Exception) {} }
/// <summary> /// Model Station information Object Fill. /// </summary> private void _modelSetStationInfotmation() { StationInfo = StationFucntions.GetStationList(StationID); }