// Use this for initialization protected virtual void Start() { _AudioSource = GetComponent<AudioSource>(); _colliders = GetComponentsInChildren<Collider>(); _zeroTransformVector = new TransformVector(); _initialTransformVector = new TransformVector(transform.localPosition,transform.localRotation); _transformCurve = new TransformCurve(_initialTransformVector, Time.time, _zeroTransformVector, _initialTransformVector, Time.time, _zeroTransformVector); BugManager = FindObjectOfType<BugManager>(); }
internal List <Enroller> IsPhoneNumberExist(long organizationId, string phoneNo) { try { //var myItem = // new EnrollerRepository().GetEnrollers() // .FindAll(x => x.OrganizationId == organizationId && x.MobileNumber == phoneNo); var myItem = new EnrollerRepository().GetEnrollers() .FindAll(x => x.MobileNumber == phoneNo); if (!myItem.Any()) { return(new List <Enroller>()); } return(myItem); } catch (Exception ex) { BugManager.LogApplicationBug(ex.StackTrace, ex.Source, ex.Message); return(null); } }
internal Enroller GetLastEnrollerRegisteredByOrganizationId(long organizationId, long clientStationId) { try { //var myItems = _enrollerRepository.GetAll(x => x.OrganizationId == organizationId && x.ClientStationId == clientStationId).OrderByDescending(o => o.EnrollerId).ToList(); var myItems = _enrollerRepository.GetAll( x => x.ClientStationId == clientStationId) .OrderByDescending(o => o.EnrollerId) .ToList(); if (!myItems.Any()) { return(new Enroller()); } return(myItems[0]); } catch (Exception ex) { BugManager.LogApplicationBug(ex.StackTrace, ex.Source, ex.Message); return(new Enroller()); } }
public static List <State> GetStates() { try { var connection = ConfigurationManager.ConnectionStrings["DataKioskEntities"].ConnectionString; if (string.IsNullOrEmpty(connection)) { return(new List <State>()); } using (var sqlConnection = new SqlConnection(connection)) { sqlConnection.Open(); var sqlBuilder = new StringBuilder(); sqlBuilder.AppendFormat("SELECT * FROM \"EnrollKiosk\".\"State\" "); string sql = sqlBuilder.ToString(); var command = new SqlCommand(sql, sqlConnection); var dr = command.ExecuteReader(); var items = new List <State>(); while (dr.Read()) { var item = new State(); { item.StateId = dr.GetInt32(dr.GetOrdinal("StateId")); item.Name = dr.GetString(dr.GetOrdinal("Name")); }; items.Add(item); } sqlConnection.Close(); return(items); } } catch (Exception ex) { BugManager.LogApplicationBug(ex.StackTrace, ex.Source, ex.Message); return(new List <State>()); } }
void Start() { goingHome = false; //gets our first state as begin state iActiveBugState = new BeginBugState(this); //so we can change it from WanderState bugLight = this.GetComponent <Light>(); if (iActiveBugState != null) { iActiveBugState.Enter(); } //get bug manager primarily to refrence bug attract points bugManager = GameObject.FindGameObjectWithTag("BugManager"); bugMan = bugManager.GetComponent <BugManager>(); //copying our vector3 arrays from bug manager, wish I knew how to do this earlier bugAttractors.AddRange(bugMan.bugAttractors); spawnPoints.AddRange(bugMan.spawnPointLocations); }
public ClientStation ValidateClientAccess(string stationId, string stationName, string accessKey, out string msg) { try { var stationInfo = GetStation(stationId); if (stationInfo == null || stationInfo.ClientStationId < 1) { msg = "Unregistered / Invalid Authorization Access"; return(null); } if ( string.Compare(stationInfo.APIAccessKey.Trim(), accessKey.Trim(), StringComparison.CurrentCultureIgnoreCase) != 0 || string.Compare(stationInfo.StationId.Trim(), stationId.Trim(), StringComparison.CurrentCultureIgnoreCase) != 0 || string.Compare(stationInfo.StationName.Trim(), stationName.Trim(), StringComparison.CurrentCultureIgnoreCase) != 0) { msg = "Unregistered / Invalid Authorization Access"; return(null); } if (stationInfo.Status != 2) { msg = "Unauthorized Access!"; return(null); } msg = ""; return(stationInfo); } catch (Exception ex) { msg = "Unable to validate Station Access"; BugManager.LogApplicationBug(ex.StackTrace, ex.Source, ex.Message); return(null); } }
private bool IsDuplicate(string roleName, out string msg) { try { var sql1 = String.Format( "Select * FROM \"EnrollKiosk\".\"Role\" WHERE lower(\"Name\") = lower('{0}')", roleName.Replace("'", "''")); var check = _repository.RepositoryContext().Database.SqlQuery <Role>(sql1).ToList(); msg = ""; if (check.IsNullOrEmpty()) { return(false); } msg = "Duplicate Error! Item already exist"; return(true); } catch (Exception ex) { msg = "Error: " + ex.Message; BugManager.LogApplicationBug(ex.StackTrace, ex.Source, ex.Message); return(true); } }
// // GET: /PortalUser/ //[EppSecurity_Authorize] public ActionResult Index() { ViewBag.Reply = Session["Reply"] as string; ViewBag.Error = Session["Error"] as string; Session["Reply"] = ""; Session["Error"] = ""; try { var items = PortalUser.GetUserList() ?? new List <RegisteredUserReportObj>(); if (!items.Any()) { ViewBag.Error = "No Registered User Info Found!"; return(View(new List <RegisteredUserReportObj>())); } if (!User.IsInRole("Super Admin")) { items = items.FindAll(m => m.RoleId != 1); if (!items.Any()) { ViewBag.Error = "No User Info Found!"; return(View(new List <RegisteredUserReportObj>())); } } var users = items.Where(item => !item.MyRole.Contains("Super Admin")).ToList(); Session["_portalUsersInfos"] = users; return(View(users)); } catch (Exception ex) { ViewBag.Error = ex.Message; BugManager.LogApplicationBug(ex.StackTrace, ex.Source, ex.Message); return(View(new List <RegisteredUserReportObj>())); } }