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;
     }
 }
 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;
     }
 }
 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;
     }
 }
 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 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;
     }
 }