private void GetUserNamesAndSetToUserNameTxtBox_AutoComplete() { try { using (DataTable dtUserNames = UserMasterDAL.GetAllUsersInformation()) { if (dtUserNames != null) { if (dtUserNames.Rows.Count > 0) { AutoCompleteStringCollection usrNameColl = new AutoCompleteStringCollection(); for (int i = 0; i < dtUserNames.Rows.Count; i++) { if (dtUserNames.Rows[i]["USER_NAME"] != null) { usrNameColl.Add(dtUserNames.Rows[i]["USER_NAME"].ToString()); } } txtUserName.AutoCompleteMode = AutoCompleteMode.SuggestAppend; txtUserName.AutoCompleteSource = AutoCompleteSource.CustomSource; txtUserName.AutoCompleteCustomSource = usrNameColl; } } } } catch (Exception ex) { ErrorHandling.WriteErrorLog(ex.Message); } }
/// <summary> /// Fill Roles drop down. /// </summary> private void FillRolesDropDownList() { try { DataTable dtRoles = UserMasterDAL.GetRoles(); if (dtRoles != null) { if (dtRoles.Rows.Count > 0) { cmbRole.DataSource = dtRoles; cmbRole.DisplayMember = "ROLE_NAME"; cmbRole.ValueMember = "ROLE_ID"; } } } catch (Exception ex) { ErrorHandling.WriteErrorLog(ex.ToString()); } }
public List <GroupUser> GetAllUser(/*, int VesselID*/) { UserMasterDAL dAL = new UserMasterDAL(); return(dAL.GetAllUser(/*, VesselID*/)); }
public List <UserMasterPOCO> GetAllUserForDropDown() { UserMasterDAL shipDal = new UserMasterDAL(); return(shipDal.GetAllUserListForDropDown()); }
public int AllowSignatureUpload(int UserId) { UserMasterDAL dAL = new UserMasterDAL(); return(dAL.AllowSignatureUpload(UserId)); }
public int UploadPermissionUserMaster(int UserId /*, ref string oUTPUT*/) { UserMasterDAL dAL = new UserMasterDAL(); return(dAL.UploadPermissionUserMaster(UserId /*, ref oUTPUT*/)); }
public int DeleteUserMaster(int UserId /*, ref string oUTPUT*/) { UserMasterDAL dAL = new UserMasterDAL(); return(dAL.DeleteUserMaster(UserId /*, ref oUTPUT*/)); }
public List <UserMasterPOCO> GetUserByEmailId(string Email /*, int VesselID*/) { UserMasterDAL dAL = new UserMasterDAL(); return(dAL.GetUserByEmailId(Email /*, VesselID*/)); }
public User spCheckUserMasterByID(String UserName, String Password) { return(UserMasterDAL.spCheckUserMasterByID(UserName, Password)); }
public DataTable GetUserMasterByID(int UserID) { //return UserMasterDAL.GetUserMasterByID(UserID); return(UserMasterDAL.spGetUserMasterByID(UserID)); }
public void DeleteUserMaster(int UserID) { //UserMasterDAL.DeleteUserMaster(UserID); UserMasterDAL.spDeleteUserMaster(UserID); }
public void UpdateUserMaster(int UserID, String UserName, String Password, String Status) { //UserMasterDAL.UpdateUserMaster(UserID ,UserName , Password, Status); UserMasterDAL.spUpdateUserMaster(UserID, UserName, Password, Status); }
public void AddUserMaster(String UserName, String Password, String Status) { //UserMasterDAL.AddUserMaster( UserName, Password, Status); UserMasterDAL.spAddUserMaster(UserName, Password, Status); }
public DataTable GetUserMaster() { //return UserMasterDAL.GetUserMaster(); return(UserMasterDAL.spGetUserMaster()); }
public UserMasterPOCO GetUserByUserId(int UserId /*, int VesselID*/) { UserMasterDAL dAL = new UserMasterDAL(); return(dAL.GetUserByUserId(UserId /*, VesselID*/)); }
public List <UserMasterPOCO> GetUserByIMO(string VesselIMO /*, int VesselID*/) { UserMasterDAL dAL = new UserMasterDAL(); return(dAL.GetUserByIMO(VesselIMO /*, VesselID*/)); }
//for Ship drp public List <UserMasterPOCO> GetAllShipForDrp(/*int VesselID*/) { UserMasterDAL dAL = new UserMasterDAL(); return(dAL.GetAllShipForDrp(/*VesselID*/)); }
public List <UserMasterPOCO> GetUserByRank(int RankId /*, int VesselID*/) { UserMasterDAL dAL = new UserMasterDAL(); return(dAL.GetUserByRank(RankId /*, VesselID*/)); }
public string GetRoleByUserId(int UserId /*, ref string oUTPUT*/) { UserMasterDAL dAL = new UserMasterDAL(); return(dAL.GetRoleByUserId(UserId /*, ref oUTPUT*/)); }
public int ApprovedRoNotInUserMaster(int UserId /*, ref string oUTPUT*/) { UserMasterDAL dAL = new UserMasterDAL(); return(dAL.ApprovedRoNotInUserMaster(UserId /*, ref oUTPUT*/)); }
/// <summary> /// Added on 13th Jul 2021 @BK /// </summary> /// <param name="pOCO"></param> /// <returns></returns> public int ChangePassword(UserMasterPOCO aUserMaster) { UserMasterDAL umDAL = new UserMasterDAL(); return(umDAL.ChangePassword(aUserMaster)); }
public string GenerateUserCode(string asUserType, string asShipId, string asRankId, string asUserName) { UserMasterDAL userDal = new UserMasterDAL(); return(userDal.GenerateUserCode(asUserType, asShipId, asRankId, asUserName)); }
public int ForgotPassword(UserMasterPOCO pOCO, ref string initialPwd, ref string userCode) { UserMasterDAL umDAL = new UserMasterDAL(); return(umDAL.ForgotPassword(pOCO, ref initialPwd, ref userCode)); }
public int SaveUpdateUser(UserMasterPOCO pOCO /*,int VesselID*/) { UserMasterDAL dAL = new UserMasterDAL(); return(dAL.SaveUpdateUser(pOCO /*, VesselID*/)); }
public List <UserMasterPOCO> GetAllUserPageWise(int pageIndex, ref int recordCount, int length, int UserType, int shipId) { UserMasterDAL dAL = new UserMasterDAL(); return(dAL.GetAllUserPageWise(pageIndex, ref recordCount, length, UserType, shipId)); }
public List <UserMasterPOCO> GetAllUserByShipForDropDown(int shipId) { UserMasterDAL shipDal = new UserMasterDAL(); return(shipDal.GetAllUserListByShipForDropDown(shipId)); }
/// <summary> /// Validate LDAP user & give access to appplication. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnLogin_Click(object sender, EventArgs e) { try { string strErrMsg = ""; if (ValidateUserInputs(out strErrMsg)) { //bool blStatus = ChemistryOperations.MoleculeComparisonTest("", ""); //Get User Details DataTable dtUserDetails = UserMasterDAL.GetUserDetailsByUserNameAndRoleId(txtUserName.Text.Trim(), Convert.ToInt32(cmbRole.SelectedValue), cmbModule.Text); if (dtUserDetails != null && dtUserDetails.Rows.Count > 0) { char isLDAPUser = Convert.ToChar(dtUserDetails.Rows[0]["IS_LDAP_USER"]); if (isLDAPUser == 'N') { DataTable dtUserCredentilas = UserMasterDAL.GetUserCredentialsByUserNameAndPassword(txtUserName.Text.Trim(), txtPassword.Text.Trim()); if (dtUserCredentilas != null && dtUserCredentilas.Rows.Count > 0) { //Filling Data into Global variables. GlobalVariables.UserName = txtUserName.Text.Trim(); GlobalVariables.RoleName = cmbRole.Text; GlobalVariables.Module = cmbModule.Text; GlobalVariables.RoleId = Convert.ToInt32(cmbRole.SelectedValue); GlobalVariables.UserID = Convert.ToInt32(dtUserDetails.Rows[0]["USER_ID"].ToString()); GlobalVariables.UR_ID = Convert.ToInt32(dtUserDetails.Rows[0]["UR_ID"].ToString()); GlobalVariables.IsLoginSuccess = true; DialogResult = DialogResult.OK; this.Close(); } else { MessageBox.Show("Invalid User Name / Password", GlobalVariables.MessageCaption, MessageBoxButtons.OK, MessageBoxIcon.Error); } } else { // LDAP user exists or not if (ValidateUserAgainstLDAP()) { //Filling Data into Global variables. GlobalVariables.UserName = txtUserName.Text.Trim(); GlobalVariables.RoleName = cmbRole.Text; GlobalVariables.Module = cmbModule.Text; GlobalVariables.RoleId = Convert.ToInt32(cmbRole.SelectedValue); GlobalVariables.UserID = Convert.ToInt32(dtUserDetails.Rows[0]["USER_ID"].ToString()); GlobalVariables.UR_ID = Convert.ToInt32(dtUserDetails.Rows[0]["UR_ID"].ToString()); GlobalVariables.IsLoginSuccess = true; DialogResult = DialogResult.OK; this.Close(); } else { MessageBox.Show("Invalid User Name / Password", GlobalVariables.MessageCaption, MessageBoxButtons.OK, MessageBoxIcon.Error); }//End LDAP. } } else { MessageBox.Show("Invalid User Name / Password / Role", GlobalVariables.MessageCaption, MessageBoxButtons.OK, MessageBoxIcon.Error); } } else { MessageBox.Show(strErrMsg, GlobalVariables.MessageCaption, MessageBoxButtons.OK, MessageBoxIcon.Error); } } catch (Exception ex) { ErrorHandling.WriteErrorLog(ex.ToString()); } }