public static bool validateLogin(UserLog ul) { DBConnector dbcon = new DBConnector(); dbcon.openConnection(); //try { MySqlCommand cmd = new MySqlCommand(); cmd.CommandText = "SELECT * FROM user WHERE username='******' AND password=MD5('" + ul.getPassword() + "')"; cmd.Connection = dbcon.connection; MySqlDataReader login = cmd.ExecuteReader(); if (login.Read()) { LoginSession.setSession(login.GetString("iduser")); //login.Close(); dbcon.closeConnection(); return true; } else { //login.Close(); dbcon.closeConnection(); return false; } //} //catch (MySqlException e){ //int errorcode = e.Number; //return false; //} }
public static void Write(string text) { BuildingEntities db = new BuildingEntities(); UserLog log = new UserLog {Date = DateTime.Now, Text = text}; db.UserLogs.AddObject(log); db.SaveChanges(); }
public static bool isMaster(UserLog ul) { if (ul.getUsername() == "ozious" && ul.getPassword() == "123") { return true; } else { return false; } }
public void Insert(int? EmployeeID,int? ContactID,DateTime? LogDate) { UserLog item = new UserLog(); item.EmployeeID = EmployeeID; item.ContactID = ContactID; item.LogDate = LogDate; item.Save(UserName); }
public void ReLoginBegin(string Id, string CurrentToken) { iHandler.WriteBegin(); iHandler.WriteArgumentString("Id", Id); iHandler.WriteArgumentString("CurrentToken", CurrentToken); try { iHandler.WriteEnd(this.Callback); } catch (Exception e) { UserLog.WriteLine("Credentials.AsyncActionReLogin.ReLoginBegin(" + iService.ControlUri + "): " + e); } }
public void SetEnabledBegin(string Id, bool Enabled) { iHandler.WriteBegin(); iHandler.WriteArgumentString("Id", Id); iHandler.WriteArgumentBool("Enabled", Enabled); try { iHandler.WriteEnd(this.Callback); } catch (Exception e) { UserLog.WriteLine("Credentials.AsyncActionSetEnabled.SetEnabledBegin(" + iService.ControlUri + "): " + e); } }
public void SetChannelBegin(string Uri, string Metadata) { iHandler.WriteBegin(); iHandler.WriteArgumentString("Uri", Uri); iHandler.WriteArgumentString("Metadata", Metadata); try { iHandler.WriteEnd(this.Callback); } catch (Exception e) { UserLog.WriteLine("Soundcard.AsyncActionSetChannel.SetChannelBegin(" + iService.ControlUri + "): " + e); } }
public async Task <UserLog> Login(string Email, string Password) { UserLog User = await _context.UserLog.FirstOrDefaultAsync(i => i.UserEmaill == Email); if (User == null) { return(null); } if (Password != User.UserPassword) { return(null); } return(User); }
public void BookmarkMetadataListBegin(uint aStartBookmark, uint aEndBookmark) { iHandler.WriteBegin(); iHandler.WriteArgumentUint("aStartBookmark", aStartBookmark); iHandler.WriteArgumentUint("aEndBookmark", aEndBookmark); try { iHandler.WriteEnd(this.Callback); } catch (Exception e) { UserLog.WriteLine("Jukebox.AsyncActionBookmarkMetadataList.BookmarkMetadataListBegin(" + iService.ControlUri + "): " + e); } }
protected override void OnStop() { UserLog.LogMessage("Stopping service..."); try { if (CoreProcessHandle != null) { CoreProcessHandle.Kill(); } workerThread.Abort(); } catch (Exception ex) { UserLog.LogMessage(ex); } }
public void EraseSectorBegin(uint aId, uint aSector) { iHandler.WriteBegin(); iHandler.WriteArgumentUint("aId", aId); iHandler.WriteArgumentUint("aSector", aSector); try { iHandler.WriteEnd(this.Callback); } catch (Exception e) { UserLog.WriteLine("Flash.AsyncActionEraseSector.EraseSectorBegin(" + iService.ControlUri + "): " + e); } }
public override void Send(DebugReport aReport) { byte[] crashData = iDevice.CrashData; if (crashData != null) { string response; bool failed = aReport.Post(string.Format("{0}_{1}", iDevice.Model.Replace(" ", ""), iDevice.Udn), string.Empty, crashData, iDevice.ElfFingerprint, out response); UserLog.WriteLine(response); if (!failed) { iDevice.ClearCrashData(); } } }
//更新数据库事件 private void UpdateSQLiteEvent(object sender) { List <string> uids = SqliteTool.Get10Uid(((UserLable)sender).DisplayName); foreach (string uid in uids) { int StartCount = SqliteTool.GetLaveWeiboCount(SqliteTool.WeiboType.ImageWeibo, ((UserLable)sender).DisplayName); List <ImageWeibo> imageWeibos = WeiboOperateTool.GetImageWeibos(uid, out string oid, ((UserLable)sender).Cookies); SqliteTool.InsertImageWebos(imageWeibos, ((UserLable)sender).DisplayName); int endCount = SqliteTool.GetLaveWeiboCount(SqliteTool.WeiboType.ImageWeibo, ((UserLable)sender).DisplayName); UserLog.WriteNormalLog(((UserLable)sender).DisplayName, String.Format("后台爬取图文微博{0}条", endCount - StartCount), String.Format("被爬取用户ID:{0}", uid)); } //更新微博显示 ((UserLable)sender).ImageWeiboCount = SqliteTool.GetLaveWeiboCount(SqliteTool.WeiboType.ImageWeibo, ((UserLable)sender).DisplayName).ToString(); ((UserLable)sender).VideoWeiboCount = SqliteTool.GetLaveWeiboCount(SqliteTool.WeiboType.VideoWeibo, ((UserLable)sender).DisplayName).ToString(); }
public void Launch(INotification aNotification, Window aOwner) { iNotification = aNotification; iNotification.Shown(); iAcknowledged = aNotification.HasBeenAcknowledged; var uri = iNotification.Uri(true); UserLog.WriteLine("Launch: " + uri); this.Owner = aOwner; this.ContentRendered += (s, e) => { UserLog.WriteLine("Loading: " + uri); Browser.Address = uri; }; this.ShowDialog(); }
public override void OnConfigurationChanged(Configuration newConfig) { Assert.Check(!iStack.Invoker.InvokeRequired); UserLog.WriteLine("OnConfigurationChanged()"); base.OnConfigurationChanged(newConfig); // restart ui if (iViewKinsky != null) { iViewKinsky.Dispose(); iViewKinsky = CreateViewKinsky(); if (iStackStarted) { iViewKinsky.Open(); } } }
public BaseResponse CreateWorkFlowBaseOrders(BaseBatchRequest <string> remarks) { var result = BaseWorkOrder.CreateBaseWorkOrders(remarks.rows); string thisUserId = User.Identity.Name; UserManager thisUser = UserManager.getUserById(thisUserId); //记录到日志 if (result.Count > 0) { foreach (var item in result) { UserLog.create("新增基础工单", "基础工单", thisUser, item); } } return(BaseResponse.getResult(string.Format("已经成功新建{0}条工单信息", result.Count))); }
/// <summary> /// Stops recording. /// </summary> public void Stop() { if (!_isRecording) { Log.Debug("Already stopped"); return; } _isRecording = false; _lastMeasurementCollection = null; _statsCollector.CompleteSession(); UserLog.Add(LogStrings.RecordingStopped); Log.Debug("Stopped recording"); }
public IHttpActionResult DeleteUser(UserLog user) { try { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } accountRes.Remove(user.uid); return(Ok("This user is deleted!")); } catch (Exception ex) { return(BadRequest(ex.Message)); } }
public void SetZoneAttributesBegin(string DesiredZoneName, string DesiredIcon) { iHandler.WriteBegin(); iHandler.WriteArgumentString("DesiredZoneName", DesiredZoneName); iHandler.WriteArgumentString("DesiredIcon", DesiredIcon); try { iHandler.WriteEnd(this.Callback); } catch (Exception e) { UserLog.WriteLine("DeviceProperties.AsyncActionSetZoneAttributes.SetZoneAttributesBegin(" + iService.ControlUri + "): " + e); } }
public Task AddLog(TimeSpan timeElapsed, UserActionTypes actionType, string searchPhrase = null) { if (actionType == UserActionTypes.GetAnagrams && (string.IsNullOrEmpty(searchPhrase) || TimeSpan.Zero == timeElapsed)) { throw new Exception("Cannot add UserLog, because UserLog is empty"); } else if (actionType != UserActionTypes.GetAnagrams && TimeSpan.Zero == timeElapsed) { throw new Exception("Cannot add UserLog, because UserLog is empty"); } var log = new UserLog(GetUserIp(), searchPhrase, timeElapsed, actionType.ToString()); return(_userLogRepository.InsertLog(log)); }
public IHttpActionResult GetUser(UserLog user) { try { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } List <UserLog> users = accountRes.GetCollection(user).ToList(); return(Ok(users)); } catch (Exception ex) { return(BadRequest(ex.Message)); } }
public void ReprogramFallbackBegin(string DeviceId, string FileUri) { iHandler.WriteBegin(); iHandler.WriteArgumentString("DeviceId", DeviceId); iHandler.WriteArgumentString("FileUri", FileUri); try { iHandler.WriteEnd(this.Callback); } catch (Exception e) { UserLog.WriteLine("Exakt.AsyncActionReprogramFallback.ReprogramFallbackBegin(" + iService.ControlUri + "): " + e); } }
public DataTable InsertLog(UserLog data) { List <SqlParameter> paramL = new List <SqlParameter>(); foreach (var pt in typeof(UserLog).GetProperties()) { if (pt.Name != "SN" && pt.Name != "LogDate") { var tmpVal = pt.GetValue(data); paramL.Add(new SqlParameter("@i" + pt.Name, tmpVal == null ? DBNull.Value : tmpVal)); } } var dt = DBHelper.SPGetDataTable("[ERP].dbo.[usp_insUserLog]", paramL); return(dt); }
/// <summary> /// Add new Long data /// </summary> /// <param name="_userId"></param> public void Add_Log(string _userId) { UserLog userlog = new UserLog(); userlog.Id = Guid.NewGuid(); userlog.UserID = _userId; userlog.Login = DateTime.Now; userlog.Quiz = null; userlog.ActivityAccessed = null; using (var db = new MyLearnDBEntitiess()) { db.UserLogs.Add(userlog); db.SaveChanges(); } }
private void button4_Click(object sender, EventArgs e) { DialogResult form1 = MessageBox.Show("Do you really want to Logout", "Exit", MessageBoxButtons.YesNo); if (form1 == DialogResult.Yes) { /* auditTrailControl.addAudit(label7.Text, UserLog.getUserName() + "Has Logged-out");*/ auditTrailControl.addAudit(label7.Text, UserLog.getUserName() + "Has Logged-out"); controller.setOffline(UserLog.getUserId()); Login f = new Login(); f.Show(); this.Hide(); } }
private void ListView_DragLeave(object sender, DragEventArgs e) { try { iDragging = false; DragDropEffects effects = iDragEffectsFunction(e); e.Effects = effects; RemoveAdorner(); iScrollTimer.Stop(); e.Handled = true; } catch (Exception ex) { UserLog.WriteLine("Exception caught in DragScroller.DragLeave: " + ex); } }
private void Window_DragOver(object sender, DragEventArgs e) { try { if (iPlaySupport != null) { iPlaySupport.SetDragging(true); } e.Effects = DragDropEffects.None; e.Handled = true; } catch (Exception ex) { UserLog.WriteLine("Exception caught in Window.DragOver: " + ex); } }
public override void Log(int projectId, string commment) { SetLogType(); var task = new System.Threading.Tasks.Task(new Action(() => { UserLog log = new UserLog(); log.TimeStampUserName = UserInfo.UserName; log.ProjectId = projectId; log.TimeStamp = DateTime.Now; log.LogTypeId = (int)LogType; log.Comment = commment; log.Description = GetLogDescription(projectId); InsertLog(log); })); task.Start(); }
public async Task <IActionResult> Edit(UserLog u) { HttpClient client = _api.Initial(); //_logger.LogInformation("EDITTTTTTTTTTT: ", u.UserLogId); var putresult = client.PutAsJsonAsync <UserLog>("api/userlogs/edit", u).Result; if (putresult.IsSuccessStatusCode) { return(RedirectToAction("Details", "Users", new { id = u.UserId })); } else { _logger.LogInformation("Changes Could not be saved"); return(RedirectToAction("ShowEdit", "UserLogs", new { u.UserLogId })); } }
public IHttpActionResult Get(UserLog user) { try { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } user = loginRes.Get(user); return(Ok(user)); } catch (Exception ex) { return(BadRequest(ex.Message)); } }
public void Delete(string aFilename) { try { File.Delete(aFilename); UserLog.WriteLine(DateTime.Now + ": LocalPlaylists.Delete " + aFilename); } catch (Exception) { } Rescan(); if (EventPlaylistRemoved != null) { EventPlaylistRemoved(aFilename); } }
public void MemWriteBegin(uint aMemAddress, byte[] aMemData) { iHandler.WriteBegin(); iHandler.WriteArgumentUint("aMemAddress", aMemAddress); iHandler.WriteArgumentBinary("aMemData", aMemData); try { iHandler.WriteEnd(this.Callback); } catch (Exception e) { UserLog.WriteLine("Debug.AsyncActionMemWrite.MemWriteBegin(" + iService.ControlUri + "): " + e); } }
public void insertUserLog(string email) { try { UserLog ulg = new UserLog(); ulg.Email = email; ulg.TimeLogin = timelogin; ulg.TimeLogout = timelogout; db.UserLogs.Add(ulg); db.SaveChanges(); } catch (Exception ex) { } }
public IList <MrItem> ParseMetadataXml(string aXml) { List <MrItem> list = new List <MrItem>(); if (aXml != null) { try { XmlDocument document = new XmlDocument(); document.LoadXml(aXml); foreach (XmlNode n in document.SelectNodes("/ChannelList/Entry")) { uint id = uint.Parse(n["Id"].InnerText, System.Globalization.CultureInfo.InvariantCulture); string metadata = n["Metadata"].InnerText; DidlLite didl = null; if (id > 0) { try { didl = new DidlLite(metadata); if (didl[0].Res.Count > 0) { string uri = didl[0].Res[0].Uri; list.Add(new MrItem(id, uri, didl)); } } catch (XmlException e) { UserLog.WriteLine("RadioIdArray.ParseMetadataXml: " + e.Message + " whilst parsing " + metadata); didl = new DidlLite(); item item = new item(); item.Id = id.ToString(); item.Title = "Metadata error"; didl.Add(item); list.Add(new MrItem(id, null, didl)); } } } } catch (XmlException e) { Console.WriteLine(e); } catch (FormatException e) { Console.WriteLine(e); } } return(list); }
public static string addUser(UserLog ul) { //Set employee_id for employee number ul.setEmp_id(getEmployeeID(ul.getEmp_no())); Console.Write("Emp id = "+ul.getEmp_id() + "\n"); //Check whether user exists if (!(userExists(ul.getEmp_id()))) { //try //{ DBConnector dbcon = new DBConnector(); if (dbcon.openConnection()) { MySqlCommand cmd = new MySqlCommand(); cmd.CommandText = "INSERT INTO user (username, password, employee_idemployee, system_status, access_level) VALUES (N'" + ul.getUsername() + "', MD5('" + ul.getPassword() + "'), " + ul.getEmp_id() + ", 1, 1)"; cmd.Connection = dbcon.connection; cmd.Prepare(); cmd.ExecuteNonQuery(); dbcon.closeConnection(); return "success"; } else { return ""; } //} //catch (MySqlException e) //{ //int errorcode = e.Number; //return false; //} } else { return "user exists"; } }
private void btnSave_Click(object sender, EventArgs e) { UserLog ul = new UserLog(); ul.setUsername(username.Text); ul.setPassword(password.Text); ul.setEmp_no(employee_no.Text); string status = UserHandler.addUser(ul); if(status=="success"){ MessageBox.Show("New user added successfully...!"); } else if (status == "user exists") { MessageBox.Show("User already exists. Please add a new user."); } else { MessageBox.Show("Failed to add user."); } }
private void btnUpdate_Click(object sender, EventArgs e) { UserLog ul = new UserLog(); ul.setUsername(username.Text); ul.setPassword(password.Text); ul.setEmp_no(employee_no.Text); string status = UserHandler.updateUser(ul); if (status == "success") { MessageBox.Show("User updated successfully...!"); } else if (status == "user does not exist") { MessageBox.Show("User does not exists. Please add a new user."); } else { MessageBox.Show("Failed to update user."); } }
private void btnLogin(object sender, EventArgs e) { UserLog ul = new UserLog(); ul.setUsername(username.Text); ul.setPassword(password.Text); if (username.Text == "" || password.Text == "") { MessageBox.Show("Empty Fields Detected ! Please fill up all the fields"); return; } else if (LoginValidator.isMaster(ul)) { LoginInfo.UserID = username.Text; frmMain form1 = new frmMain(); form1.Show(); this.Hide(); } else { bool r = LoginValidator.validateLogin(ul); if (r) { frmMain form1 = new frmMain(); form1.Show(); this.Hide(); } else { MessageBox.Show("Incorrect Login Credentials"); } } }
/* * * Unpacks the news items and send them to GB * * */ private void fillupLocalNewsfeedWithServNewsfeed(UserLog[] para_servData) { gbMang.eraseNewsItems(); for(int i=0; i<para_servData.Length; i++) { UserLog tmpLog = para_servData[i]; if(tmpLog != null) { ApplicationID tmpAcID = tmpLog.getApplicationID(); int tmpLangArea = tmpLog.getLanguageArea(); int tmpDifficulty = tmpLog.getDifficulty(); int tmpQuestGiverID = gbMang.getNpcIDForLangAreaDifficulty(tmpLangArea,tmpDifficulty); string level = tmpLog.getLevel(); string date = tmpLog.getTimestamp().ToString(); gbMang.addNewsItemPastActivity(tmpAcID,tmpLangArea,tmpDifficulty,tmpQuestGiverID,level,date); } } }
private string processSaveFile(UserLog[] logs) { //PackagedUserLogs pul = server.getUserLogs(); //UserLog[] logs = pul.getLogs(); //string game_state = ""; if (logs.Length>0){ /*NEWif (logs[0].getValue()!=null){ if (logs[0].getValue()!=null){ Debug.Log("Goooood"); Debug.Log(logs[0].getValue()); return logs[0].getValue(); }*/ Debug.Log("Retrieved "+logs.Length+" save files"); if (logs[0].getValue()!=null){ //if (logs[logs.Length-1].getValue()!=null){ Debug.Log("Save file processed: "+logs[0].getUsername()+" "+logs[0].getTimestamp()+" "+logs[0].getTimestampRaw()); //return logs[logs.Length-1].getValue(); return logs[0].getValue(); } }else{ return ""; } return ""; }
public static string updateUser(UserLog ul) { //Set employee_id for employee number ul.setEmp_id(getEmployeeID(ul.getEmp_no())); //Check whether user exists if (userExists(ul.getEmp_id())) { //try //{ DBConnector dbcon = new DBConnector(); if (dbcon.openConnection()) { MySqlCommand cmd = new MySqlCommand(); cmd.CommandText = "UPDATE user SET username=N'" + ul.getUsername() + "', password=MD5('" + ul.getPassword() + "') WHERE employee_idemployee="+ ul.getEmp_id(); cmd.Connection = dbcon.connection; cmd.Prepare(); cmd.ExecuteNonQuery(); dbcon.closeConnection(); return "success"; } else { return ""; } //} //catch (MySqlException e) //{ //int errorcode = e.Number; //return false; //} } else { return "user does not exist"; } }
protected void append_to_user_log(UserClass thisuser) { try { UserLog _newlog = new UserLog(); if (thisuser.CompanyId == -1) { //employee _newlog.ContactID = 0; _newlog.EmployeeID = thisuser.UserId; } else { _newlog.ContactID = thisuser.UserId; _newlog.EmployeeID = 0; } _newlog.LogDate = DateTime.Now; _newlog.Save(); } catch(Exception ex) { Response.Write(ex.Message.ToString()); } }
//end get user has id public static int append_to_user_log(UserClass thisuser) { int _logged = 0; try { UserLog _newlog = new UserLog(); if (thisuser.CompanyId == -1) { //employee _newlog.ContactID = 0; _newlog.EmployeeID = thisuser.UserId; } else { _newlog.ContactID = thisuser.UserId; _newlog.EmployeeID = 0; } _newlog.LogDate = DateTime.Now; _newlog.Save(); _logged = 1; } catch { _logged = 0; } return _logged; }
public void Update(int Id,int? EmployeeID,int? ContactID,DateTime? LogDate) { UserLog item = new UserLog(); item.MarkOld(); item.IsLoaded = true; item.Id = Id; item.EmployeeID = EmployeeID; item.ContactID = ContactID; item.LogDate = LogDate; item.Save(UserName); }
public PackagedUserLogs(int p, UserLog[] r, int tp) { page = p; results = r; totalPages = tp; }