public UserPaswordHistoryBO GetCurrentPaswordDetails(DBEgine dbEngine,int userID)
        {
            UserPaswordHistoryBO hs = null;

            try
            {
                SqlParameter[] parms = new SqlParameter[1];

                SqlParameter p1 = new SqlParameter();
                p1.ParameterName = "@UserID";
                p1.SqlDbType = SqlDbType.Int;
                p1.Direction = ParameterDirection.Input;
                p1.Value = userID;
                parms[0] = p1;

                DataTable dtHistry = dbEngine.ExecuteDataTable("UserManagement.UM_GetCurrentPasswordDetails", parms);
                if (dtHistry.Rows.Count > 0)
                {

                    foreach (DataRow r in dtHistry.Rows)
                    {
                        hs = new UserPaswordHistoryBO();

                        if (r.Table.Columns.Contains("UserPaswordHistoryID"))
                            if (r["UserPaswordHistoryID"] != DBNull.Value)
                                hs.UserPaswordHistoryID = (int)r["UserPaswordHistoryID"];

                        if (r.Table.Columns.Contains("UserID"))
                            if (r["UserID"] != DBNull.Value)
                                hs.UserID = (int)r["UserID"];

                        if (r.Table.Columns.Contains("Password"))
                            if (r["Password"] != DBNull.Value)
                                hs.Password = r["Password"].ToString();

                        if (r.Table.Columns.Contains("CreatedBy"))
                            if (r["CreatedBy"] != DBNull.Value)
                                hs.CreatedBy = (int)r["CreatedBy"];

                        if (r.Table.Columns.Contains("CreatedDate"))
                            if (r["CreatedDate"] != DBNull.Value)
                                hs.CreatedDate = DateTime.Parse(r["CreatedDate"].ToString());

                        if (r.Table.Columns.Contains("DayProcessID"))
                            if (r["DayProcessID"] != DBNull.Value)
                                hs.DayProcessID = r["DayProcessID"].ToString();

                        if (r.Table.Columns.Contains("IsCurrent"))
                            if (r["IsCurrent"] != DBNull.Value)
                                hs.IsCurrent = (bool)r["IsCurrent"];
                    }

                }
                return hs;
            }
            catch
            {
                throw;
            }
        }
Exemplo n.º 2
0
        public static List<RelationshipBO> GetAllRelationship()
        {
            List<RelationshipBO> listRel = new List<RelationshipBO>();

            DBEgine dbEgine = new DBEgine();
            try
            {
                dbEgine.DBOpen();
                DataTable dt = dbEgine.ExecuteDataTable("U_GetAllRelationship", null);
                if (dt.Rows.Count > 0)
                {
                    foreach (DataRow r in dt.Rows)
                    {
                        var relationshipBO = new RelationshipBO();

                        if (r["RelationShipID"] != DBNull.Value)
                            relationshipBO.RelationShipID = (int)r["RelationShipID"];

                        if (r["RelationShipName"] != DBNull.Value)
                            relationshipBO.RelationShipName = r["RelationShipName"].ToString();

                        if (r["IsActive"] != DBNull.Value)
                            relationshipBO.IsActive = (bool)r["IsActive"];

                        if (r["CreatedBy"] != DBNull.Value)
                            relationshipBO.CreatedBy = (int)r["CreatedBy"];

                        if (r["CreatedDate"] != DBNull.Value)
                            relationshipBO.CreatedDate = (DateTime)r["CreatedDate"];

                        if (r["ModifiedBy"] != DBNull.Value)
                            relationshipBO.ModifiedBy = (int)r["ModifiedBy"];

                        if (r["ModifiedDate"] != DBNull.Value)
                            relationshipBO.ModifiedDate = (DateTime)r["ModifiedDate"];

                        listRel.Add(relationshipBO);
                    }
                }
            }
            catch
            {
                throw;
            }
            finally
            {
                dbEgine.DBClose();
            }

            return listRel;
        }
Exemplo n.º 3
0
        public bool IsUserSessionComplete(int userID)
        {
            DBEgine dbEngine = new DBEgine();
            bool isCompleted = true;
            try
            {

                dbEngine.DBOpen();
                SqlParameter[] parms = new SqlParameter[1];

                SqlParameter p1 = new SqlParameter();
                p1.ParameterName = "UserID";
                p1.SqlDbType = SqlDbType.Int;
                p1.Value = userID;
                parms[0] = p1;

                DataTable dtStatus = dbEngine.ExecuteDataTable("UM_IsSessionCompletedByUser", parms);

                if (dtStatus.Rows.Count > 0)
                    isCompleted = (bool)dtStatus.Rows[0]["IsLogout"];

            }
            catch
            {
                throw;
            }
            finally
            {
                dbEngine.DBClose();
            }
            return isCompleted;
        }
Exemplo n.º 4
0
        public bool IsPassWordAlreadyTaken(int userId, string userPassword)
        {
            bool exist = false;

            DBEgine dbEgine = new DBEgine();

            try
            {

                dbEgine.DBOpen();
                SqlParameter[] parms = new SqlParameter[2];

                SqlParameter p1 = new SqlParameter();
                p1.ParameterName = "@UserId";
                p1.SqlDbType = SqlDbType.Int;
                p1.Direction = ParameterDirection.Input;
                p1.Value = userId;
                parms[0] = p1;

                SqlParameter p2 = new SqlParameter();
                p2.ParameterName = "@Password";
                p2.SqlDbType = SqlDbType.NVarChar;
                p2.Size = 500;
                p2.Direction = ParameterDirection.Input;
                p2.Value = userPassword;
                parms[1] = p2;

                DataTable dt=dbEgine.ExecuteDataTable("UM_IsPassWordAlreadyTaken", parms);

                if (dt.Rows.Count>0)
                {
                    exist = true;
                }

                dbEgine.DBClose();

            }

            catch
            {
                throw;
            }

            finally
            {
                dbEgine.DBClose();
            }

            return exist;
        }