public static List <StoreCustomMember> GetStoreCustomMemberListByStoreCustomId(int storeCustomId)
        {
            List <StoreCustomMember> list = new List <StoreCustomMember>();

            Database  db         = DatabaseFactory.CreateDatabase("Spar-StoreRep");
            string    sqlCommand = "GetStoreCustomMemberListByStoreCustomId";
            DbCommand dbCommand  = db.GetStoredProcCommand(sqlCommand);

            db.AddInParameter(dbCommand, "@StoreCustomId", DbType.Int32, storeCustomId);

            using (IDataReader dataReader = db.ExecuteReader(dbCommand))
            {
                while (dataReader.Read())
                {
                    StoreCustomMember storeCustomMember = new StoreCustomMember();
                    storeCustomMember.StoreCustomMemberId = Convert.ToInt32(dataReader["StoreCustomMemberId"]);
                    storeCustomMember.StoreCustomId       = Convert.ToInt32(dataReader["StoreCustomId"]);
                    storeCustomMember.EmployeeName        = dataReader["EmployeeName"].ToString();
                    storeCustomMember.RoleName            = dataReader["RoleName"].ToString();
                    storeCustomMember.Email         = dataReader["Email"].ToString();
                    storeCustomMember.ContactNumber = dataReader["ContactNumber"].ToString();
                    storeCustomMember.Birthday      = Convert.ToDateTime(dataReader["Birthday"]);

                    list.Add(storeCustomMember);
                }
            }
            return(list);
        }
        public static StoreCustomMember GetStoreCustomMemberByStoreCustomMemberId(int storeCustomMemberId)
        {
            Database  db         = DatabaseFactory.CreateDatabase("Spar-StoreRep");
            string    sqlCommand = "GetStoreCustomMemberByStoreCustomMemberId";
            DbCommand dbCommand  = db.GetStoredProcCommand(sqlCommand);

            db.AddInParameter(dbCommand, "@StoreCustomMemberId", DbType.Int32, storeCustomMemberId);
            db.AddOutParameter(dbCommand, "@StoreCustomId", DbType.Int32, 4);
            db.AddOutParameter(dbCommand, "@EmployeeName", DbType.String, 100);
            db.AddOutParameter(dbCommand, "@RoleName", DbType.String, 50);
            db.AddOutParameter(dbCommand, "@Email", DbType.String, 200);
            db.AddOutParameter(dbCommand, "@ContactNumber", DbType.String, 50);
            db.AddOutParameter(dbCommand, "@Birthday", DbType.DateTime, 8);

            db.ExecuteNonQuery(dbCommand);
            StoreCustomMember storeCustomMember = new StoreCustomMember();

            storeCustomMember.StoreCustomMemberId = storeCustomMemberId;
            storeCustomMember.StoreCustomId       = Convert.ToInt32(db.GetParameterValue(dbCommand, "StoreCustomId"));
            storeCustomMember.EmployeeName        = db.GetParameterValue(dbCommand, "EmployeeName").ToString();
            storeCustomMember.RoleName            = db.GetParameterValue(dbCommand, "RoleName").ToString();
            storeCustomMember.Email         = db.GetParameterValue(dbCommand, "Email").ToString();
            storeCustomMember.ContactNumber = db.GetParameterValue(dbCommand, "ContactNumber").ToString();
            storeCustomMember.Birthday      = Convert.ToDateTime(db.GetParameterValue(dbCommand, "Birthday"));

            return(storeCustomMember);
        }