private int GetRoleID() { try { UserPermission objUserPermission = new UserPermission(); var storedProcedureComandText = "SELECT ISNULL( MAX( RoleID ),0) +1 FROM [uRoleSetup]"; clsDataManipulation objclsDataManipulation = new clsDataManipulation(); return(objUserPermission.RoleID = objclsDataManipulation.GetSingleValue(this.ConnectionString, storedProcedureComandText)); } catch (Exception msgException) { throw msgException; } }
private int GetSecurityCode(CompanySetup objCompanySetup, UserSecurityCode objUserSecurityCode) { try { string sql = "SELECT [SecurityCode] FROM [UserSecurityCode] WHERE DataUsed = 'A' AND SecurityCodeStatus = 0 AND [CompanyID]= " + objCompanySetup.CompanyID + " AND [EmployeeID] = '" + objUserSecurityCode.UserKnownID + "'"; clsDataManipulation objclsDataManipulation = new clsDataManipulation(); objUserSecurityCode.SecurityCode = objclsDataManipulation.GetSingleValue(this.ConnectionString, sql); return(objUserSecurityCode.SecurityCode); } catch (Exception msgException) { throw msgException; } }
internal int GetEntityTypeID(OrganizationalChartSetup objOrganizationalChartSetup) { try { var sqlString = "SELECT [EntityTypeID] FROM [orgOrganizationalChartSetup] WHERE [EntityID] = " + objOrganizationalChartSetup.EntityID + ""; clsDataManipulation objclsDataManipulation = new clsDataManipulation(); var entityTypeID = objclsDataManipulation.GetSingleValue(this.ConnectionString, sqlString); return(entityTypeID); } catch (Exception msgException) { throw msgException; } }
internal string GetEmployeeEmail(EmployeeSetup objEmployeeSetup) { try { string sql = " SELECT [Email] FROM [hrEmployeeSetup] WHERE CompanyID = " + objEmployeeSetup.CompanyID + " AND DataUsed ='A' AND EmployeeID = '" + objEmployeeSetup.EmployeeID + "'"; EmployeeDetailsSetup objEmployeeDetailsSetup = new EmployeeDetailsSetup(); clsDataManipulation objclsDataManipulation = new clsDataManipulation(); return(objEmployeeDetailsSetup.Email = objclsDataManipulation.GetSingleValueAsString(this.ConnectionString, sql)); } catch (Exception msgException) { throw msgException; } }
private int CheckUserName(UserList objUserList) { try { int countUserProfileId = 0; string sqlString = "SELECT ISNULL( COUNT( UserProfileID),0) FROM uUserList WHERE UserName = '******'"; clsDataManipulation objclsDataManipulation = new clsDataManipulation(); countUserProfileId = objclsDataManipulation.GetSingleValue(this.ConnectionString, sqlString); return(countUserProfileId); } catch (Exception msgException) { throw msgException; } }
private string CheckSecurityCode(UserList objUserList) { try { string targetSecurityCode = null; string sql = @" SELECT B.SecurityCode FROM [hrEmployeeSetup] A INNER JOIN UserSecurityCode B ON A.CompanyID = B.CompanyID AND A.EmployeeID = B.EmployeeID WHERE B.SecurityCodeStatus = 0 AND B.DataUsed = 'A' AND A.Email = '" + objUserList.UserEmail + "'"; clsDataManipulation objclsDataManipulation = new clsDataManipulation(); targetSecurityCode = objclsDataManipulation.GetSingleValueAsString(this.ConnectionString, sql); return(targetSecurityCode); } catch (Exception msgException) { throw msgException; } }
private int CheckUserNameWithCompany(UserList objUserList) { try { int countUserProfileId = 0; string sqlString = " SELECT ISNULL( COUNT( A.UserProfileID),0) FROM uUserList A INNER JOIN uUserProfile B ON A.UserProfileID = B.UserProfileID " + " INNER JOIN UserSecurityCode C ON B.SecurityCode = C.SecurityCode WHERE B.DataUsed = 'A' AND C.DataUsed = 'A' AND " + " C.CompanyID =(SELECT CompanyID FROM UserSecurityCode WHERE SecurityCode = " + objUserList.SecurityCode + ") AND A.UserName = '******' "; clsDataManipulation objclsDataManipulation = new clsDataManipulation(); countUserProfileId = objclsDataManipulation.GetSingleValue(this.ConnectionString, sqlString); return(countUserProfileId); } catch (Exception msgException) { throw msgException; } }