internal int Delete(LivelogInfo r) { try { da = new tblLivelogTableAdapter(); n = da.Delete(r.LogID); } catch (Exception ex) { Interactive.LInfoError(ex.Message, "Insert Record"); } return(n); }
internal int Update(LivelogInfo r) { try { da = new tblLivelogTableAdapter(); n = da.Update(r.LogDate, r.RecordUID, r.TableName, r.UserID, r.Action, r.SystemUser, r.Computer, r.LogID); } catch (Exception ex) { Interactive.LInfoError(ex.Message, "Insert Record"); } return(n); }
internal int Insert(UserInfo r) { try { da = new tblUserTableAdapter(); n = da.Insert(r.UserID, r.Password, r.IsActive, r.RoleID, r.FullName); LivelogInfo.InsertLog(DateTime.Now, r.UserID, "User", UserInfo.LiveUserID, "added new record", UserInfo.SysUserID, UserInfo.Computer); } catch (Exception ex) { Interactive.LInfoError(ex.Message, "Insert Record"); } return(n); }
internal int Delete(RoleInfo r) { try { da = new tblRoleTableAdapter(); n = da.Delete(r.RoleID); LivelogInfo.InsertLog(DateTime.Now, r.RoleID, "Role", UserInfo.LiveUserID, "deleted record", UserInfo.SysUserID, UserInfo.Computer); } catch (Exception ex) { Interactive.LInfoError(ex.Message, "Insert Record"); } return(n); }
internal int UpdatePassword(UserInfo r) { try { da = new tblUserTableAdapter(); n = da.UpdatePassword(r.Password, r.UserID); LivelogInfo.InsertLog(DateTime.Now, UserInfo.LiveUserID, "Users", UserInfo.LiveUserID, "changed password", UserInfo.SysUserID, UserInfo.Computer); } catch (Exception ex) { Interactive.LInfoError(ex.Message, "Insert Record"); } return(n); }
internal int Authenticate(UserInfo r) { n = -1; try { string pass = string.Empty; da = new tblUserTableAdapter(); pass = da.GetPassword(r.UserID).ToString(); n = string.Compare(r.Password, pass); } catch (NullReferenceException exI) { n = -1; } catch (Exception ex) { Interactive.LInfoError(ex.Message, "Check User"); } LivelogInfo.InsertLog(DateTime.Now, "-", "-", UserInfo.LiveUserID, "Authenticating...", UserInfo.SysUserID, UserInfo.Computer); return(n); }
private void LiveLogin() { if (LiveFormIsValid()) { LiveEnableControls(false); myU = new UserInfo(); myU.UserID = txtUserID.Text.Trim(); myU.Password = txtPassword.Text.Trim(); myU.LoadPCProfile(); if (myU.IsLoginOk()) { if (UserInfo.LiveIsActive) { this.Hide(); Splash f = new Splash(); f.Show(); } else { LiveEnableControls(true); } } else { LivelogInfo.InsertLog(DateTime.Now, "-", "-", UserInfo.LiveUserID, "logged in failed", UserInfo.SysUserID, UserInfo.Computer); Interactive.LInfoError("User ID or Password is incorrect,\nPassword should be in the correct case", "Login failed"); LiveEnableControls(true); } this.Cursor = Cursors.Default; } else { Interactive.LInfoError(err, string.Empty); } this.Cursor = Cursors.Default; }